]> git.baikalelectronics.ru Git - kernel.git/commit
backlight: pwm_bl: Fix GPIO out for unimplemented .get_direction()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 4 Apr 2017 10:54:35 +0000 (12:54 +0200)
committerDaniel Thompson <daniel.thompson@linaro.org>
Wed, 19 Apr 2017 18:59:44 +0000 (19:59 +0100)
commit65101274e6f1baf601985b467cccf15a91eafce0
tree09b6d7d6dd83d7c746c2984c63d9afbaefe6922c
parent4a46f7ef1255fece6f2525bf6b6c51a29186e498
backlight: pwm_bl: Fix GPIO out for unimplemented .get_direction()

Commit a96802e1938f0784 ("backlight: pwm_bl: Move the checks for initial
power state to a separate function") not just moved some code, but made
slight changes in semantics.

If a gpiochip doesn't implement the optional .get_direction() callback,
gpiod_get_direction always returns -EINVAL, which is never equal to
GPIOF_DIR_IN, leading to the GPIO not being configured for output.

To avoid this, invert the test and check for not GPIOF_DIR_OUT instead,
like the original code did.

This restores the display on r8a7740/armadillo.

Fixes: a96802e1938f0784 ("backlight: pwm_bl: Move the checks for initial power state to a separate function")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
drivers/video/backlight/pwm_bl.c