OSDN Git Service

gpio: of: Support SPI nonstandard GPIO properties
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 27 Dec 2017 15:37:44 +0000 (16:37 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 8 Jan 2018 16:29:25 +0000 (17:29 +0100)
commitc85823390215e52d68d3826df92a447ed31e5c80
treef55b031e90ed59b7939d40f7a898103de043ab4d
parent24e78079bf2250874e33da2e7cfbb6db72d3caf4
gpio: of: Support SPI nonstandard GPIO properties

Before it was clearly established that all GPIO properties in the
device tree shall be named "foo-gpios" (with the deprecated variant
"foo-gpio" for single lines) we unfortunately merged a few bindings
which named the lines "gpio-foo" instead.

This is most prominent in the GPIO SPI driver in Linux which names
the lines "gpio-sck", "gpio-mosi" and "gpio-miso".

As we want to switch the GPIO SPI driver to using descriptors, we
need devm_gpiod_get() to return something reasonable when looking
up these in the device tree.

Put in a special #ifdef:ed kludge to do this special lookup only
for the SPI case and gets compiled out if we're not enabling SPI.
If we have more oddly defined legacy GPIOs like this, they can be
handled in a similar manner.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-of.c