1. 23 11月, 2016 3 次提交
  2. 18 11月, 2016 1 次提交
  3. 11 11月, 2016 1 次提交
  4. 30 10月, 2016 1 次提交
  5. 23 8月, 2016 2 次提交
  6. 16 8月, 2016 2 次提交
  7. 06 4月, 2016 1 次提交
  8. 23 3月, 2016 1 次提交
  9. 13 12月, 2015 1 次提交
    • B
      spi-fsl-dspi: Fix CTAR Register access · ef22d160
      Bhuvanchandra DV 提交于
      DSPI instances in Vybrid have a different amount of chip selects
      and CTARs (Clock and transfer Attributes Register). In case of
      DSPI1 we only have 2 CTAR registers and 4 CS. In present driver
      implementation CTAR offset is derived from CS instance which will
      lead to out of bound access if chip select instance is greater than
      CTAR register instance, hence use single CTAR0 register for all CS
      instances. Since we write the CTAR register anyway before each access,
      there is no value in using the additional CTAR registers. Also one
      should not program a value in CTAS for a CTAR register that is not
      present, hence configure CTAS to use CTAR0.
      Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com>
      Acked-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      ef22d160
  10. 18 9月, 2015 1 次提交
  11. 13 6月, 2015 1 次提交
  12. 10 6月, 2015 2 次提交
    • H
      spi: spi-fsl-dspi: Change the way of increasing spi_message->actual_length · c042af95
      Haikun Wang 提交于
      In current driver, we increase actual_length in the following way:
      message->actual_length += dspi_xxx_transfer()
      It has two defects.
      First, transmitting maybe in process when the function call finished and
      we don't know the transmitting result in this moment.
      Secondly, the last sentence in function before returning is accessing the
      SPI register and trigger the data transmitting. If we enable interrupt,
      interrupt may be generated before function return and we also have the same
      sentence "message->actual_length += dspi_xxx_transfer()"
      in the IRQ handler.
      And usually dspi_xxx_transfer will trigger a new IRQ.
      The original dspi_xxx_transfer call may return when no new IRQ generate.
      This may mess the variable spi_message->actual_length.
      Now we increase the variable in the IRQ handler and only when we get the
      TCF or EOQ interrupt
      And we get the transmitted data length from the SPI transfer counter
      instead of the function return value.
      Signed-off-by: NHaikun Wang <haikun.wang@freescale.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c042af95
    • H
      spi: spi-fsl-dspi: Enable TCF interrupt mode support · d1f4a38c
      Haikun Wang 提交于
      DSPI module has two optional interrupts when complete data transfer.
      One is EOQ interrupt, the other one is TCF interrupt.
      EOQ indicates a queue of data frame has been transmitted.
      TCF indicates a frame has been transmitted.
      This patch enable support TCF mode.
      Driver binds a correct interrupt mode to every compatible string.
      User should use the correct compatible string in the dts node.
      Signed-off-by: NHaikun Wang <haikun.wang@freescale.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      d1f4a38c
  13. 22 5月, 2015 1 次提交
    • H
      spi: spi-fsl-dspi: Bug fix incorrect CS de-assert · 9deef024
      Haikun Wang 提交于
      SPI chip select signal need to keep asserted between several
      spi_transfer in the same spi_message usually.
      But the driver will de-assert CS signal and the assert it between
      serval spi_transfer in the same spi_message under some condiations.
      This patch fix the bug.
      
      Here is an example:
      Assume you have two variables like the following,
      struct spi_transfer a;
      struct spi_transfer b;
      if you send a spi_message only includes 'a' first,
      and then you send a spi_message includes 'a' and 'b'
      but without resetting 'a'.
      Driver will de-assert CS and then assert CS between 'a' and 'b'.
      Signed-off-by: NHaikun Wang <haikun.wang@freescale.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      9deef024
  14. 24 4月, 2015 1 次提交
  15. 07 4月, 2015 2 次提交
  16. 31 3月, 2015 1 次提交
    • A
      spi: fsl-dspi: Fix clock rate scale values · 6fd63087
      Aaron Brice 提交于
      Previous algorithm had an outer loop with the values {2,3,5,7} and an
      inner loop with {2,4,6,8,16,32,...,32768}, and would pick the first
      value over the required scaling value (where the total scale was the two
      numbers multiplied).
      
      Since the inner loop went up to 32768 it would always pick a value of 2
      for PBR and a much higher than necessary value for BR.  The desired
      scale factor was being divided by two I believe to compensate for the
      much higher scale factors (the divide by two not specified in the
      reference manual).
      
      Updated to check all values and find the smallest scale factor possible
      without going over the desired clock rate.
      Signed-off-by: NAaron Brice <aaron.brice@datasoft.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      6fd63087
  17. 03 2月, 2015 1 次提交
  18. 29 1月, 2015 1 次提交
  19. 28 1月, 2015 1 次提交
  20. 04 11月, 2014 1 次提交
  21. 20 10月, 2014 1 次提交
  22. 30 9月, 2014 1 次提交
  23. 25 9月, 2014 1 次提交
  24. 18 8月, 2014 1 次提交
  25. 08 5月, 2014 1 次提交
  26. 28 3月, 2014 1 次提交
  27. 05 3月, 2014 2 次提交
  28. 16 2月, 2014 2 次提交
  29. 17 1月, 2014 1 次提交
  30. 10 1月, 2014 1 次提交
  31. 15 10月, 2013 1 次提交
  32. 07 10月, 2013 1 次提交
    • A
      spi: bitbang: Let spi_bitbang_start() take a reference to master · 702a4879
      Axel Lin 提交于
      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: NAxel Lin <axel.lin@ingics.com>
      Suggested-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Acked-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      702a4879