Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: gpio_backlight: Drop output GPIO direction check for initial power state

So, let's drop output GPIO direction check and only check GPIO value to set
the initial power state.

Fixes: 706dc68102bc ("backlight: gpio: Explicitly set the direction of the GPIO")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20230721093342.1532531-1-victor.liu@nxp.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Ying Liu and committed by
Lee Jones
fe1328b5 5145531b

+1 -2
+1 -2
drivers/video/backlight/gpio_backlight.c
··· 87 87 /* Not booted with device tree or no phandle link to the node */ 88 88 bl->props.power = def_value ? FB_BLANK_UNBLANK 89 89 : FB_BLANK_POWERDOWN; 90 - else if (gpiod_get_direction(gbl->gpiod) == 0 && 91 - gpiod_get_value_cansleep(gbl->gpiod) == 0) 90 + else if (gpiod_get_value_cansleep(gbl->gpiod) == 0) 92 91 bl->props.power = FB_BLANK_POWERDOWN; 93 92 else 94 93 bl->props.power = FB_BLANK_UNBLANK;