1. 23 8月, 2013 1 次提交
    • S
      spi: conditional checking of mode and transfer bits. · db90a441
      Sourav Poddar 提交于
      There is a bug in the following patch:
      http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420
      
      spi: DUAL and QUAD support
      
          fix the previous patch some mistake below:
          1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
             "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
             previous way to get the property in @of_register_spi_devices().
          2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
             SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
          3. Add the following check
             (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
                single, dual and quad.
             (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
                example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
                         to QUAD(SPI_NBITS_QUAD)
             (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
                single(SPI_NBITS_SINGLE)
      
      Checking of the tx/rx transfer bits and mode bits should be done conditionally
      based on type of buffer filled else EINVAL condition will
      always get hit either for rx or tx.
      Signed-off-by: NSourav Poddar <sourav.poddar@ti.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      db90a441
  2. 22 8月, 2013 1 次提交
    • W
      spi: DUAL and QUAD support · f477b7fb
      wangyuhang 提交于
      fix the previous patch some mistake below:
      1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
         "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
         previous way to get the property in @of_register_spi_devices().
      2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
         SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
      3. Add the following check
         (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
            single, dual and quad.
         (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
            example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
                     to QUAD(SPI_NBITS_QUAD)
         (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
            single(SPI_NBITS_SINGLE)
      Signed-off-by: Nwangyuhang <wangyuhang2014@gmail.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      f477b7fb
  3. 15 8月, 2013 1 次提交
    • G
      spi: limit default transfer speed to controller's max speed · 56ede94a
      Gabor Juhos 提交于
      Since the 'spi: Support transfer speed checking in the core'
      change, the SPI core validates the desired speed of a given
      transfer against the minimum and maximum speeds supported by
      the controller.
      
      If the speed of a transfer is not specified, the core uses
      the maximum speed of the actual SPI device. However if the
      maximum speed of the actual device is greater than the
      maximum speed of the controller, the core will reject the
      transfer due to the aforementioned change.
      
      Change the code to use the maximum speed of the controller
      by default if that is below the device's maximum speed.
      Signed-off-by: NGabor Juhos <juhosg@openwrt.org>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      56ede94a
  4. 15 7月, 2013 2 次提交
  5. 04 7月, 2013 1 次提交
  6. 04 6月, 2013 1 次提交
  7. 07 4月, 2013 2 次提交
  8. 02 4月, 2013 1 次提交
  9. 01 4月, 2013 2 次提交
  10. 13 2月, 2013 1 次提交
  11. 11 2月, 2013 1 次提交
  12. 08 2月, 2013 1 次提交
  13. 07 2月, 2013 1 次提交
  14. 05 2月, 2013 3 次提交
  15. 15 12月, 2012 1 次提交
  16. 11 12月, 2012 1 次提交
  17. 08 12月, 2012 1 次提交
  18. 07 12月, 2012 2 次提交
  19. 06 12月, 2012 1 次提交
    • M
      spi: Remove SPI_BUFSIZ restriction on spi_write_then_read() · b3a223ee
      Mark Brown 提交于
      In order to avoid constantly allocating and deallocating there is a fixed
      buffer which spi_write_then_read() uses for transfers, with an early error
      check to ensure that the transfer fits within the buffer. This limits the
      size of transfers to this size, currently max(32, SMP_CACHE_BYTES).
      
      Since we can dynamically allocate and in fact already have a fallback
      to do so when there is contention for the fixed buffer remove this
      restriction and instead dynamically allocate a suitably sized buffer if
      the transfer won't fit.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      b3a223ee
  20. 30 11月, 2012 2 次提交
  21. 22 11月, 2012 1 次提交
  22. 10 11月, 2012 2 次提交
  23. 21 5月, 2012 1 次提交
  24. 20 5月, 2012 1 次提交
  25. 11 5月, 2012 1 次提交
  26. 14 4月, 2012 1 次提交
  27. 15 3月, 2012 1 次提交
  28. 11 3月, 2012 1 次提交
  29. 10 3月, 2012 2 次提交
  30. 08 3月, 2012 1 次提交
    • L
      spi: create a message queueing infrastructure · ffbbdd21
      Linus Walleij 提交于
      This rips the message queue in the PL022 driver out and pushes
      it into (optional) common infrastructure. Drivers that want to
      use the message pumping thread will need to define the new
      per-messags transfer methods and leave the deprecated transfer()
      method as NULL.
      
      Most of the design is described in the documentation changes that
      are included in this patch.
      
      Since there is a queue that need to be stopped when the system
      is suspending/resuming, two new calls are implemented for the
      device drivers to call in their suspend()/resume() functions:
      spi_master_suspend() and spi_master_resume().
      
      ChangeLog v1->v2:
      - Remove Kconfig entry and do not make the queue support optional
        at all, instead be more agressive and have it as part of the
        compulsory infrastructure.
      - If the .transfer() method is implemented, delete print a small
        deprecation notice and do not start the transfer pump.
      - Fix a bitrotted comment.
      ChangeLog v2->v3:
      - Fix up a problematic sequence courtesy of Chris Blair.
      - Stop rather than destroy the queue on suspend() courtesy of
        Chris Blair.
      Signed-off-by: NChris Blair <chris.blair@stericsson.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Tested-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      ffbbdd21
  31. 14 12月, 2011 1 次提交