Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c9501f8 authored by Maxime Ripard's avatar Maxime Ripard Committed by Lee Jones
Browse files

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: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 35879103
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;