linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: pwm_bl: use gpiod_set_value_cansleep to fix warnings
@ 2016-05-14  9:59 Steven Jackson
  2016-05-14 10:44 ` Steven Jackson
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Jackson @ 2016-05-14  9:59 UTC (permalink / raw)
  To: linux-pwm, thierry.reding, jingoohan1

This is the same issue and fix as 1581b088fc91cbb974ad2b98431a8ecabb48
(backlight: corgi_lcd: use gpio_set_value_cansleep() to avoid WARN_ON).

PWM backlights which use a SPI/I2C IO expander to control power will see
warnings when disabling and enabling the backlight, we should use
_cansleep variants of gpio set/get whenever the context can sleep.

Other backlight drivers such as corgi_bl.c and gpio_backlight.c are
using _cansleep variants in the same contexts.

Signed-off-by: Steven Jackson <sj@oscode.net>
---
  drivers/video/backlight/pwm_bl.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c 
b/drivers/video/backlight/pwm_bl.c
index 64f9e1b..1df5420 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -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_clansleep(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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] backlight: pwm_bl: use gpiod_set_value_cansleep to fix warnings
  2016-05-14  9:59 [PATCH] backlight: pwm_bl: use gpiod_set_value_cansleep to fix warnings Steven Jackson
@ 2016-05-14 10:44 ` Steven Jackson
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Jackson @ 2016-05-14 10:44 UTC (permalink / raw)
  To: linux-pwm

Steven Jackson <sj <at> oscode.net> writes:

> +		gpiod_set_value_clansleep(pb->enable_gpio, 1);

Apologies for submitting this stupid typo. There is a v2 patch which fixes
it. The change has been tested on a custom board with an i.MX6.

Regards,
Steven

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-14 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-14  9:59 [PATCH] backlight: pwm_bl: use gpiod_set_value_cansleep to fix warnings Steven Jackson
2016-05-14 10:44 ` Steven Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).