1. 18 7月, 2014 2 次提交
    • N
      spi: s3c64xx: use the generic SPI "cs-gpios" property · 306972ce
      Naveen Krishna Chatradhi 提交于
      The s3c64xx SPI driver uses a custom DT binding to specify
      the GPIO used to drive the chip select (CS) line instead of
      using the generic "cs-gpios" property already defined in:
      Documentation/devicetree/bindings/spi/spi-bus.txt.
      
      It's unfortunate that drivers are not using standard bindings
      and creating custom ones instead but in most cases this can't
      be changed without breaking Device Tree backward compatibility.
      
      But in the case of this driver, its DT binding has been broken
      for more than a year. Since after commit (dated June, 21 2013):
      
      3146beec ("spi: s3c64xx: Added provision for dedicated cs pin")
      
      DT backward compatibility was broken and nobody noticed until
      now when the commit was reverted. So it seems to be safe to
      change the binding to use the standard SPI "cs-gpios" property
      instead of using a custom one just for this driver.
      
      This patch also allows boards that don't use a GPIO pin for the
      CS to work with the driver since the SPI core will take care of
      setting spi->cs_gpio to -ENOENT if a board wants to use the built
      in CS instead of a GPIO as explained in the SPI bus DT binding:
      Documentation/devicetree/bindings/spi/spi-bus.txt.
      
      For non-DT platforms, spi->cs_gpio will be set to -ENOENT as well
      unless they specify a GPIO pin in their platform data. So both
      native and GPIO chip select is also supported for legacy boards.
      
      The above use case was what motivated commit 3146beec which broke
      the DT binding backward compatibility in the first place.
      Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      [javier.martinez@collabora.co.uk: split changes and improve commit message]
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      306972ce
    • J
      spi: s3c64xx: Revert "spi: s3c64xx: Added provision for dedicated cs pin" · e2689b94
      Javier Martinez Canillas 提交于
      This reverts commit 3146beec.
      
      This commit resulted in a DT backward compatibility breakage.
      
      Some devices use the native chip select (CS) instead of a GPIO
      pin to drive the CS line. But the SPI driver made it mandatory
      to specify a GPIO pin in the SPI device node controller-data.
      So, using the built-in CS was not possible with the driver.
      
      Commit 3146beec tried to fix that by adding a "cs-gpio" property
      which could be defined in the SPI device node to make the driver
      request the GPIO from the controller-data node.
      
      Unfortunately that changed the old DT binding semantics since
      now it's mandatory to have the "cs-gpio" property defined in
      the SPI device node in order to use a GPIO pin to drive the CS.
      
      As an example, a SPI device was defined before the commit with:
      
      spi@12d20000 {
          slave-node@0 {
              controller-data {
                   cs-gpio = <&gpb1 2 0>;
              }
         }
      }
      
      and after the commit, the following DTS snippet must be used:
      
      spi@12d20000 {
          cs-gpio;
          slave-node@0 {
              controller-data {
                   cs-gpio = <&gpb1 2 0>;
              }
         }
      }
      
      So, after commit 3146beec the driver does not look for the GPIO
      by default and it only looks for it if the top level "cs-gpio"
      property is defined while the default used to be the opposite.
      To always request the GPIO defined in the controller-data node.
      
      This means that old FDT that of course didn't have this added
      "cs-gpio" DT property in the SPI node broke after this change.
      
      The offending commit can't be reverted cleanly since more than
      a year have passed and other changes were made in the meantime
      but this patch partially reverts the driver to it's original
      state so old FDT can work again.
      
      This patch will break Device Trees that were relying on the new
      behavior of course but the patch should be reverted because:
      
      a) There aren't DTS in mainline that use this new property.
      b) They were relying on a behavior that broke DT compatibility.
      c) The new binding is awkard, needing two properties with the
         same name (cs-gpio) on different nodes is confusing at least.
      d) The new property was not added to the DT binding doc:
         Documentation/devicetree/bindings/spi/spi-samsung.txt
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      e2689b94
  2. 30 4月, 2014 1 次提交
  3. 15 4月, 2014 1 次提交
  4. 25 2月, 2014 1 次提交
  5. 07 2月, 2014 3 次提交
  6. 05 2月, 2014 1 次提交
    • M
      spi: Make core DMA mapping functions generate scatterlists · 6ad45a27
      Mark Brown 提交于
      We cannot unconditionally use dma_map_single() to map data for use with
      SPI since transfers may exceed a page and virtual addresses may not be
      provided with physically contiguous pages. Further, addresses allocated
      using vmalloc() need to be mapped differently to other addresses.
      
      Currently only the MXS driver handles all this, a few drivers do handle
      the possibility that buffers may not be physically contiguous which is
      the main potential problem but many don't even do that. Factoring this
      out into the core will make it easier for drivers to do a good job so if
      the driver is using the core DMA code then generate a scatterlist
      instead of mapping to a single address so do that.
      
      This code is mainly based on a combination of the existing code in the MXS
      and PXA2xx drivers. In future we should be able to extend it to allow the
      core to concatenate adjacent transfers if they are compatible, improving
      performance.
      
      Currently for simplicity clients are not allowed to use the scatterlist
      when they do DMA mapping, in the future the existing single address
      mappings will be replaced with use of the scatterlist most likely as
      part of pre-verifying transfers.
      
      This change makes it mandatory to use scatterlists when using the core DMA
      mapping so update the s3c64xx driver to do this when used with dmaengine.
      Doing so makes the code more ugly but it is expected that the old s3c-dma
      code can be removed very soon.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      6ad45a27
  7. 04 2月, 2014 2 次提交
  8. 13 1月, 2014 1 次提交
  9. 02 1月, 2014 1 次提交
  10. 15 11月, 2013 1 次提交
  11. 22 10月, 2013 2 次提交
    • K
      spi/s3c64xx: Fix doubled clock disable on suspend · 9d7fd21a
      Krzysztof Kozlowski 提交于
      Fix doubled clock disable and unprepare during PM suspend which triggered
      the warnings:
      
      WARNING: at drivers/clk/clk.c:800 clk_disable+0x18/0x24()
      Modules linked in:
      CPU: 0 PID: 1745 Comm: sh Not tainted 3.10.14-01211-ge2549bb-dirty #62
      [<c0015980>] (unwind_backtrace+0x0/0x138) from [<c0012a44>] (show_stack+0x10/0x14)
      [<c0012a44>] (show_stack+0x10/0x14) from [<c0022818>] (warn_slowpath_common+0x4c/0x68)
      [<c0022818>] (warn_slowpath_common+0x4c/0x68) from [<c0022850>] (warn_slowpath_null+0x1c/0x24)
      [<c0022850>] (warn_slowpath_null+0x1c/0x24) from [<c036e274>] (clk_disable+0x18/0x24)
      [<c036e274>] (clk_disable+0x18/0x24) from [<c02d5f78>] (s3c64xx_spi_suspend+0x28/0x54)
      [<c02d5f78>] (s3c64xx_spi_suspend+0x28/0x54) from [<c02b3a54>] (platform_pm_suspend+0x2c/0x5c)
      [<c02b3a54>] (platform_pm_suspend+0x2c/0x5c) from [<c02b8a30>] (dpm_run_callback+0x44/0x7c)
      [<c02b8a30>] (dpm_run_callback+0x44/0x7c) from [<c02b8b70>] (__device_suspend+0x108/0x300)
      [<c02b8b70>] (__device_suspend+0x108/0x300) from [<c02ba4e0>] (dpm_suspend+0x54/0x208)
      [<c02ba4e0>] (dpm_suspend+0x54/0x208) from [<c0066bcc>] (suspend_devices_and_enter+0x98/0x458)
      [<c0066bcc>] (suspend_devices_and_enter+0x98/0x458) from [<c0067150>] (pm_suspend+0x1c4/0x25c)
      [<c0067150>] (pm_suspend+0x1c4/0x25c) from [<c0066044>] (state_store+0x6c/0xbc)
      [<c0066044>] (state_store+0x6c/0xbc) from [<c0203290>] (kobj_attr_store+0x14/0x20)
      [<c0203290>] (kobj_attr_store+0x14/0x20) from [<c0157530>] (sysfs_write_file+0xfc/0x164)
      [<c0157530>] (sysfs_write_file+0xfc/0x164) from [<c00fd6b0>] (vfs_write+0xbc/0x1bc)
      [<c00fd6b0>] (vfs_write+0xbc/0x1bc) from [<c00fdaf0>] (SyS_write+0x40/0x68)
      [<c00fdaf0>] (SyS_write+0x40/0x68) from [<c000ea80>] (ret_fast_syscall+0x0/0x3c)
      
      The clocks may be already disabled before suspending. Check PM runtime
      suspend status and disable clocks only if device is not suspended.
      During resume do not enable the clocks if device is runtime suspended.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      9d7fd21a
    • K
      spi/s3c64xx: Do not ignore return value of spi_master_resume/suspend · 347de6ba
      Krzysztof Kozlowski 提交于
      During PM resume and suspend do not ignore the return value of
      spi_master_suspend() or spi_master_resume(). Instead pass it further.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      347de6ba
  12. 18 10月, 2013 2 次提交
  13. 12 10月, 2013 2 次提交
  14. 08 10月, 2013 1 次提交
  15. 30 9月, 2013 6 次提交
  16. 27 9月, 2013 1 次提交
  17. 23 9月, 2013 1 次提交
  18. 18 9月, 2013 1 次提交
  19. 17 9月, 2013 1 次提交
  20. 29 8月, 2013 1 次提交
  21. 14 8月, 2013 1 次提交
  22. 11 8月, 2013 3 次提交
  23. 30 7月, 2013 1 次提交
  24. 24 7月, 2013 3 次提交