]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: rockchip: enable clock when reading pin direction register
authorBrian Norris <briannorris@chromium.org>
Tue, 12 Dec 2017 17:43:43 +0000 (09:43 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 20 Dec 2017 08:00:13 +0000 (09:00 +0100)
commitacba4f36b84fca952a909884d87034136ccb0527
treec1f1cbf8003c7eb1ab843b7e467b5f254758d65a
parent23e04e70e2f9b9f5cebef522020465f074969efa
pinctrl: rockchip: enable clock when reading pin direction register

We generally leave the GPIO clock disabled, unless an interrupt is
requested or we're accessing IO registers. We forgot to do this for the
->get_direction() callback, which means we can sometimes [1] get
incorrect results [2] from, e.g., /sys/kernel/debug/gpio.

Enable the clock, so we get the right results!

[1] Sometimes, because many systems have 1 or mor interrupt requested on
each GPIO bank, so they always leave their clock on.

[2] Incorrect, meaning the register returns 0, and so we interpret that
as "input".

Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-rockchip.c