Skip to content
Commit 892c7788 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Daniel Thompson
Browse files

backlight: pwm_bl: Fix GPIO out for unimplemented .get_direction()

Commit 7613c922 ("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: 7613c922

 ("backlight: pwm_bl: Move the checks for initial power state to a separate function")
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
parent 4f7d029b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment