Skip to content

Commit 0c9501f

Browse files
mripardLee Jones
authored andcommitted
backlight: pwm_bl: Handle gpio that can sleep
Some backlight GPIOs might be connected to some i2c based expanders whose access might sleep. Since it's not in any critical path, use the cansleep variant of the GPIO API. Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 3587910 commit 0c9501f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/video/backlight/pwm_bl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)
5555
dev_err(pb->dev, "failed to enable power supply\n");
5656

5757
if (pb->enable_gpio)
58-
gpiod_set_value(pb->enable_gpio, 1);
58+
gpiod_set_value_cansleep(pb->enable_gpio, 1);
5959

6060
pwm_enable(pb->pwm);
6161
pb->enabled = true;
@@ -70,7 +70,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb)
7070
pwm_disable(pb->pwm);
7171

7272
if (pb->enable_gpio)
73-
gpiod_set_value(pb->enable_gpio, 0);
73+
gpiod_set_value_cansleep(pb->enable_gpio, 0);
7474

7575
regulator_disable(pb->power_supply);
7676
pb->enabled = false;

0 commit comments

Comments
 (0)