Commit fe1328b5 authored by Ying Liu's avatar Ying Liu Committed by Lee Jones
Browse files

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: 706dc681 ("backlight: gpio: Explicitly set the direction of the GPIO")
Signed-off-by: default avatarLiu Ying <victor.liu@nxp.com>
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20230721093342.1532531-1-victor.liu@nxp.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 5145531b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -87,8 +87,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
		/* Not booted with device tree or no phandle link to the node */
		bl->props.power = def_value ? FB_BLANK_UNBLANK
					    : FB_BLANK_POWERDOWN;
	else if (gpiod_get_direction(gbl->gpiod) == 0 &&
		 gpiod_get_value_cansleep(gbl->gpiod) == 0)
	else if (gpiod_get_value_cansleep(gbl->gpiod) == 0)
		bl->props.power = FB_BLANK_POWERDOWN;
	else
		bl->props.power = FB_BLANK_UNBLANK;