summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/clps711x-fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbdev/clps711x-fb.c')
-rw-r--r--drivers/video/fbdev/clps711x-fb.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
index 0d0ba617b4aa..5e61a349a4ab 100644
--- a/drivers/video/fbdev/clps711x-fb.c
+++ b/drivers/video/fbdev/clps711x-fb.c
@@ -162,22 +162,15 @@ static const struct fb_ops clps711x_fb_ops = {
.fb_blank = clps711x_fb_blank,
};
-static int clps711x_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi)
-{
- struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
-
- return (!fi || fi->par == cfb) ? 1 : 0;
-}
-
static int clps711x_lcd_get_power(struct lcd_device *lcddev)
{
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
if (!IS_ERR_OR_NULL(cfb->lcd_pwr))
if (!regulator_is_enabled(cfb->lcd_pwr))
- return FB_BLANK_NORMAL;
+ return LCD_POWER_REDUCED;
- return FB_BLANK_UNBLANK;
+ return LCD_POWER_ON;
}
static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
@@ -185,7 +178,7 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
if (!IS_ERR_OR_NULL(cfb->lcd_pwr)) {
- if (blank == FB_BLANK_UNBLANK) {
+ if (blank == LCD_POWER_ON) {
if (!regulator_is_enabled(cfb->lcd_pwr))
return regulator_enable(cfb->lcd_pwr);
} else {
@@ -198,7 +191,6 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
}
static const struct lcd_ops clps711x_lcd_ops = {
- .check_fb = clps711x_lcd_check_fb,
.get_power = clps711x_lcd_get_power,
.set_power = clps711x_lcd_set_power,
};
@@ -325,16 +317,21 @@ static int clps711x_fb_probe(struct platform_device *pdev)
if (ret)
goto out_fb_dealloc_cmap;
+ lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
+ &clps711x_lcd_ops);
+ if (IS_ERR(lcd)) {
+ ret = PTR_ERR(lcd);
+ goto out_fb_dealloc_cmap;
+ }
+
+ info->lcd_dev = lcd;
+
ret = register_framebuffer(info);
if (ret)
goto out_fb_dealloc_cmap;
- lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
- &clps711x_lcd_ops);
- if (!IS_ERR(lcd))
- return 0;
+ return 0;
- ret = PTR_ERR(lcd);
unregister_framebuffer(info);
out_fb_dealloc_cmap: