]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: of: Restrict enable-gpio quirk to regulator-gpio
authorThierry Reding <treding@nvidia.com>
Wed, 20 Feb 2019 10:52:14 +0000 (11:52 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 21 Feb 2019 12:08:42 +0000 (13:08 +0100)
commit67e18c73ede79942ba3b6f3d2e8990ec2f6adc02
treee0be735401e5a429d31eb27ecf60c79bc7a8582a
parent3fa234e2dcd47b04b62d12698c370d2a67a72b08
gpio: of: Restrict enable-gpio quirk to regulator-gpio

Commit 2532ea05f401 ("gpio: of: Apply regulator-gpio quirk only to
enable-gpios") breaks the device tree ABI specified in the device tree
bindings for fixed regulators (compatible "regulator-fixed"). According
to these bindings the polarity of the GPIO is exclusively controlled by
the presence or absence of the enable-active-high property. As such the
polarity quirk implemented in of_gpio_flags_quirks() must be applied to
the GPIO specified for fixed regulators.

However, commit 2532ea05f401 ("gpio: of: Apply regulator-gpio quirk only
to enable-gpios") restricted the quirk to the enable-gpios property for
fixed regulators as well, whereas according to the commit message itself
it should only apply to "regulator-gpio" compatible device tree nodes.

Fix this by actually implementing what the offending commit intended,
which is to ensure that the quirk is applied to the GPIO specified by
the "enable-gpio" property for the "regulator-gpio" bindings only.

This fixes a regression on Jetson TX1 where the fixed regulator for the
HDMI +5V pin relies on the flags quirk for the proper polarity.

Fixes: 2532ea05f401 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib-of.c