spi: s3c64xx: use the generic SPI "cs-gpios" property
authorNaveen Krishna Chatradhi <ch.naveen@samsung.com>
Wed, 16 Jul 2014 15:19:08 +0000 (17:19 +0200)
committerMark Brown <broonie@linaro.org>
Thu, 17 Jul 2014 18:37:49 +0000 (19:37 +0100)
commit306972cedfdedc662dd8e32a6397d0e29f2ac90e
tree06770f2712026f63843054f208dc720e5c41b1cc
parente2689b946a42acaad9ba94bf3a0bf4caa6509b9e
spi: s3c64xx: use the generic SPI "cs-gpios" property

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):

3146bee ("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 3146bee which broke
the DT binding backward compatibility in the first place.

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
[javier.martinez@collabora.co.uk: split changes and improve commit message]
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-s3c64xx.c
This page took 0.02473 seconds and 5 git commands to generate.