]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitcfc32ef4214486528e3aa178824c333b768aad77
treef55b031e90ed59b7939d40f7a898103de043ab4d
parentaf951ff898adb49cdbba6e0781fa83b87cbc91ba
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