Messages in this thread Patch in this message | | | Subject | [PATCH] backlight: l4f00242t03: Prevent unbalanced calls to regulator enable/disable | From | Alberto Panizzo <> | Date | Mon, 29 Nov 2010 16:36:11 +0100 |
| |
Otherwise a double call to: $ echo 4 > /sys/class/lcd/l4f00242t03/lcd_power Will, the first power down the lcd and regulators correctly and the second produce an unbalanced call to regulator disable.
Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com> ---
This patch follow the one this mail is answering. Thanks for reviewing.
Best regards, Alberto!
drivers/video/backlight/l4f00242t03.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index c04aa90..98ad3e5 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -136,10 +136,12 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power) } } else { /* power == FB_BLANK_POWERDOWN */ - /* Clear the screen before shutting down */ - spi_write(spi, (const u8 *)&disoff, sizeof(u16)); - msleep(60); - l4f00242t03_lcd_powerdown(spi); + if (priv->lcd_state != FB_BLANK_POWERDOWN) { + /* Clear the screen before shutting down */ + spi_write(spi, (const u8 *)&disoff, sizeof(u16)); + msleep(60); + l4f00242t03_lcd_powerdown(spi); + } } priv->lcd_state = power; -- 1.6.3.3
| |