Skip to content

Commit

Permalink
backlight: pwm_bl: Handle gpio that can sleep
Browse files Browse the repository at this point in the history
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 <maxime.ripard@free-electrons.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
mripard authored and Lee Jones committed Oct 6, 2016
1 parent 3587910 commit 0c9501f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)
dev_err(pb->dev, "failed to enable power supply\n");

if (pb->enable_gpio)
gpiod_set_value(pb->enable_gpio, 1);
gpiod_set_value_cansleep(pb->enable_gpio, 1);

pwm_enable(pb->pwm);
pb->enabled = true;
Expand All @@ -70,7 +70,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb)
pwm_disable(pb->pwm);

if (pb->enable_gpio)
gpiod_set_value(pb->enable_gpio, 0);
gpiod_set_value_cansleep(pb->enable_gpio, 0);

regulator_disable(pb->power_supply);
pb->enabled = false;
Expand Down

0 comments on commit 0c9501f

Please sign in to comment.