1. 04 Sep, 2019 1 commit
  2. 19 Jun, 2019 1 commit
  3. 17 Jan, 2019 3 commits
  4. 09 Jan, 2019 1 commit
    • Linus Walleij's avatar
      spi: ath79: Convert to use CS GPIO descriptors · 8db79547
      Linus Walleij authored and Mark Brown's avatar Mark Brown committed
      
      
      This converts the ATH79 SPI master driver to use GPIO descriptors
      for chip select handling.
      
      The ATH79 driver was requesting the GPIO and driving it from the
      bitbang .chipselect callback. Do not request it anymore as the SPI
      core will request it, remove the line inversion semantics for the
      GPIO case (handled by gpiolib) and let the SPI core deal with
      requesting the GPIO line from the device tree node of the controller.
      
      This driver can be instantiated from a board file (no device tree)
      but the board files only use native CS (no GPIO lines) so we should
      be fine just letting the SPI core grab the GPIO from the device.
      
      The fact that the driver is actively driving the GPIO in the
      ath79_spi_chipselect() callback is confusing since the host does
      not set SPI_MASTER_GPIO_SS so this should not ever get called when
      using GPIO CS. I put in a comment about this.
      
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Alban Bedel <albeu@free.fr>
      Cc: Linuxarm <linuxarm@huawei.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      8db79547
  5. 01 Aug, 2018 1 commit
  6. 17 Jul, 2017 1 commit
  7. 14 Dec, 2016 2 commits
  8. 23 Nov, 2016 1 commit
  9. 30 Sep, 2015 1 commit
  10. 27 Apr, 2015 3 commits
  11. 20 Oct, 2014 1 commit
  12. 14 Apr, 2014 1 commit
  13. 03 Mar, 2014 1 commit
  14. 03 Feb, 2014 1 commit
  15. 17 Dec, 2013 1 commit
  16. 07 Oct, 2013 1 commit
    • Axel Lin's avatar
      spi: bitbang: Let spi_bitbang_start() take a reference to master · 702a4879
      Axel Lin authored
      
      
      Many drivers that use bitbang library have a leak on probe error paths.
      This is because once a spi_master_get() call succeeds, we need an additional
      spi_master_put() call to free the memory.
      
      Fix this issue by moving the code taking a reference to master to
      spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
      success. With this change, the caller is responsible for calling
      spi_bitbang_stop() to decrement the reference and spi_master_put() as
      counterpart of spi_alloc_master() to prevent a memory leak.
      
      So now we have below patten for drivers using bitbang library:
      
      probe:
      spi_alloc_master        -> Init reference count to 1
      spi_bitbang_start       -> Increment reference count
      remove:
      spi_bitbang_stop        -> Decrement reference count
      spi_master_put          -> Decrement reference count (reference count reaches 0)
      
      Fixup all users accordingly.
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Suggested-by: default avatarUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Acked-by: default avatarUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      702a4879
  17. 17 Sep, 2013 1 commit
    • Axel Lin's avatar
      spi: bitbang: Let spi_bitbang_start() take a reference to master · 94c69f76
      Axel Lin authored
      
      
      Many drivers that use bitbang library have a leak on probe error paths.
      This is because once a spi_master_get() call succeeds, we need an additional
      spi_master_put() call to free the memory.
      
      Fix this issue by moving the code taking a reference to master to
      spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
      success. With this change, the caller is responsible for calling
      spi_bitbang_stop() to decrement the reference and spi_master_put() as
      counterpart of spi_alloc_master() to prevent a memory leak.
      
      So now we have below patten for drivers using bitbang library:
      
      probe:
      spi_alloc_master        -> Init reference count to 1
      spi_bitbang_start       -> Increment reference count
      remove:
      spi_bitbang_stop        -> Decrement reference count
      spi_master_put          -> Decrement reference count (reference count reaches 0)
      
      Fixup all users accordingly.
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Suggested-by: default avatarUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Acked-by: default avatarUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      94c69f76
  18. 29 Aug, 2013 1 commit
  19. 29 May, 2013 1 commit
  20. 13 May, 2013 1 commit
  21. 06 Feb, 2013 1 commit
    • Gabor Juhos's avatar
      spi/ath79: add shutdown handler · 7410e848
      Gabor Juhos authored and Grant Likely's avatar Grant Likely committed
      
      
      The SPI controller of the AR7xxx/AR9xxx SoCs
      have a special mode which allows the SoC to
      directly read data from SPI flash chips. In
      this mode, the content of the SPI flash chip
      can be accessed via a memory mapped region.
      
      During early init time, the kernel expects
      that the flash chip is accessible through
      that memory region because it reads board
      specific values (e.g. MAC address, WiFi
      calibration data) from the flash on various
      boards.
      
      This is working if the kernel is loaded
      directly by the bootloader because that
      leaves the SPI controller in the special
      mode. However it is not working in a kexec'd
      kernel because the SPI driver does not restore
      the special mode during shutdown.
      
      The patch adds a shutdown handler to fix this
      issue.
      Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
      Signed-off-by: Grant Likely's avatarGrant Likely <grant.likely@secretlab.ca>
      7410e848
  22. 05 Feb, 2013 5 commits
  23. 07 Dec, 2012 1 commit
  24. 20 May, 2012 1 commit
  25. 07 Dec, 2011 1 commit
    • Gabor Juhos's avatar
      spi/ath79: fix compile error due to missing include · 807cc4b1
      Gabor Juhos authored
      
      
      Whithout including 'linux/module.h' spi-ath79 driver fails to compile
      with the these errors:
      
      drivers/spi/spi-ath79.c:273:12: error: 'THIS_MODULE' undeclared here (not in a function)
      drivers/spi/spi-ath79.c:278:20: error: expected declaration specifiers or '...' before string constant
      drivers/spi/spi-ath79.c:278:1: warning: data definition has no type or storage class
      drivers/spi/spi-ath79.c:278:1: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
      drivers/spi/spi-ath79.c:278:20: warning: function declaration isn't a prototype
      drivers/spi/spi-ath79.c:279:15: error: expected declaration specifiers or '...' before string constant
      drivers/spi/spi-ath79.c:279:1: warning: data definition has no type or storage class
      drivers/spi/spi-ath79.c:279:1: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
      drivers/spi/spi-ath79.c:279:15: warning: function declaration isn't a prototype
      drivers/spi/spi-ath79.c:280:16: error: expected declaration specifiers or '...' before string constant
      drivers/spi/spi-ath79.c:280:1: warning: data definition has no type or storage class
      drivers/spi/spi-ath79.c:280:1: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
      drivers/spi/spi-ath79.c:280:16: warning: function declaration isn't a prototype
      drivers/spi/spi-ath79.c:281:14: error: expected declaration specifiers or '...' before string constant
      drivers/spi/spi-ath79.c:281:1: warning: data definition has no type or storage class
      drivers/spi/spi-ath79.c:281:1: warning: type defaults to 'int' in declaration of 'MODULE_ALIAS'
      drivers/spi/spi-ath79.c:281:14: warning: function declaration isn't a prototype
      Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      807cc4b1
  26. 24 Oct, 2011 1 commit
  27. 11 Jun, 2011 1 commit
  28. 06 Jun, 2011 1 commit
  29. 18 Jan, 2011 1 commit