Skip to content

Commit

Permalink
video: fbdev: imxfb: fix semantic of .get_power and .set_power
Browse files Browse the repository at this point in the history
.set_power gets passed an FB_BLANK_XXX value, not a bool. So 0 signals
on; and >1 means off. The same applies for return values of .get_power.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Uwe Kleine-König authored and Tomi Valkeinen committed May 10, 2016
1 parent 9b4639b commit 46ffe10
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/video/fbdev/imxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,18 +758,19 @@ static int imxfb_lcd_get_power(struct lcd_device *lcddev)
{
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);

if (!IS_ERR(fbi->lcd_pwr))
return regulator_is_enabled(fbi->lcd_pwr);
if (!IS_ERR(fbi->lcd_pwr) &&
!regulator_is_enabled(fbi->lcd_pwr))
return FB_BLANK_POWERDOWN;

return 1;
return FB_BLANK_UNBLANK;
}

static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power)
{
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);

if (!IS_ERR(fbi->lcd_pwr)) {
if (power)
if (power == FB_BLANK_UNBLANK)
return regulator_enable(fbi->lcd_pwr);
else
return regulator_disable(fbi->lcd_pwr);
Expand Down

0 comments on commit 46ffe10

Please sign in to comment.