diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2016-05-04 05:43:16 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-10 04:42:12 -0400 |
commit | 46ffe1097bc05d6ca8c5b293cbfe167d17447af1 (patch) | |
tree | 012e776a76e7aeaecf201bcc77b9bdcc8ea740e8 /drivers/video | |
parent | 9b4639bb6a637770fec6b95bb5d9f751e403e8cb (diff) |
video: fbdev: imxfb: fix semantic of .get_power and .set_power
.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>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/imxfb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index 76b6a7784b06..6d402c1a0f2b 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c | |||
@@ -758,10 +758,11 @@ static int imxfb_lcd_get_power(struct lcd_device *lcddev) | |||
758 | { | 758 | { |
759 | struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); | 759 | struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); |
760 | 760 | ||
761 | if (!IS_ERR(fbi->lcd_pwr)) | 761 | if (!IS_ERR(fbi->lcd_pwr) && |
762 | return regulator_is_enabled(fbi->lcd_pwr); | 762 | !regulator_is_enabled(fbi->lcd_pwr)) |
763 | return FB_BLANK_POWERDOWN; | ||
763 | 764 | ||
764 | return 1; | 765 | return FB_BLANK_UNBLANK; |
765 | } | 766 | } |
766 | 767 | ||
767 | static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power) | 768 | static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power) |
@@ -769,7 +770,7 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power) | |||
769 | struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); | 770 | struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev); |
770 | 771 | ||
771 | if (!IS_ERR(fbi->lcd_pwr)) { | 772 | if (!IS_ERR(fbi->lcd_pwr)) { |
772 | if (power) | 773 | if (power == FB_BLANK_UNBLANK) |
773 | return regulator_enable(fbi->lcd_pwr); | 774 | return regulator_enable(fbi->lcd_pwr); |
774 | else | 775 | else |
775 | return regulator_disable(fbi->lcd_pwr); | 776 | return regulator_disable(fbi->lcd_pwr); |