backlight: pwm_bl: Handle gpio that can sleep
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 31 Aug 2016 08:18:12 +0000 (10:18 +0200)
committerLee Jones <lee.jones@linaro.org>
Thu, 6 Oct 2016 08:27:26 +0000 (09:27 +0100)
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>
drivers/video/backlight/pwm_bl.c

index b2b366bb0f9784294a287ea220777cb9cc5a9e19..12614006211ecb89c527172af675ebcd97b34bcd 100644 (file)
@@ -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;
@@ -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;