diff options
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/ams369fg06.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/backlight.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/corgi_lcd.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/hx8357.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/ili922x.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/ili9320.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/jornada720_lcd.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/l4f00242t03.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/lcd.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/lms283gf05.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/lms501kf03.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/ltv350qv.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/mp3309c.c | 1 | ||||
-rw-r--r-- | drivers/video/backlight/omap1_bl.c | 47 | ||||
-rw-r--r-- | drivers/video/backlight/otm3225a.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/platform_lcd.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/tdo24m.c | 2 |
17 files changed, 33 insertions, 47 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 522dd81110b8..57ec205d2bd2 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c @@ -427,7 +427,7 @@ static int ams369fg06_set_brightness(struct backlight_device *bd) return ret; } -static struct lcd_ops ams369fg06_lcd_ops = { +static const struct lcd_ops ams369fg06_lcd_ops = { .get_power = ams369fg06_get_power, .set_power = ams369fg06_set_power, }; diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 2bd4299206ae..366bad51fb6b 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -122,14 +122,12 @@ static int fb_notifier_callback(struct notifier_block *self, bd->fb_bl_on[node] = true; if (!bd->use_count++) { bd->props.state &= ~BL_CORE_FBBLANK; - bd->props.fb_blank = FB_BLANK_UNBLANK; backlight_update_status(bd); } } else if (fb_blank != FB_BLANK_UNBLANK && bd->fb_bl_on[node]) { bd->fb_bl_on[node] = false; if (!(--bd->use_count)) { bd->props.state |= BL_CORE_FBBLANK; - bd->props.fb_blank = fb_blank; backlight_update_status(bd); } } diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index dd765098ad98..aad1680c9075 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c @@ -380,7 +380,7 @@ static int corgi_lcd_get_power(struct lcd_device *ld) return lcd->power; } -static struct lcd_ops corgi_lcd_ops = { +static const struct lcd_ops corgi_lcd_ops = { .get_power = corgi_lcd_get_power, .set_power = corgi_lcd_set_power, .set_mode = corgi_lcd_set_mode, diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 339d9128fbde..cdd7b7686723 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -559,7 +559,7 @@ static int hx8357_get_power(struct lcd_device *lcdev) return lcd->state; } -static struct lcd_ops hx8357_ops = { +static const struct lcd_ops hx8357_ops = { .set_power = hx8357_set_power, .get_power = hx8357_get_power, }; diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c index c8e0e655dc86..7683e209ad6b 100644 --- a/drivers/video/backlight/ili922x.c +++ b/drivers/video/backlight/ili922x.c @@ -472,7 +472,7 @@ static int ili922x_get_power(struct lcd_device *ld) return ili->power; } -static struct lcd_ops ili922x_ops = { +static const struct lcd_ops ili922x_ops = { .get_power = ili922x_get_power, .set_power = ili922x_set_power, }; diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c index 2acd2708f8ca..3e318d1891b6 100644 --- a/drivers/video/backlight/ili9320.c +++ b/drivers/video/backlight/ili9320.c @@ -161,7 +161,7 @@ static int ili9320_get_power(struct lcd_device *ld) return lcd->power; } -static struct lcd_ops ili9320_ops = { +static const struct lcd_ops ili9320_ops = { .get_power = ili9320_get_power, .set_power = ili9320_set_power, }; diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c index 6796a7c2db25..5c64fa61e810 100644 --- a/drivers/video/backlight/jornada720_lcd.c +++ b/drivers/video/backlight/jornada720_lcd.c @@ -81,7 +81,7 @@ static int jornada_lcd_set_power(struct lcd_device *ld, int power) return 0; } -static struct lcd_ops jornada_lcd_props = { +static const struct lcd_ops jornada_lcd_props = { .get_contrast = jornada_lcd_get_contrast, .set_contrast = jornada_lcd_set_contrast, .get_power = jornada_lcd_get_power, diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index bd5137ee203b..dd0874f8c7ff 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -158,7 +158,7 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power) return 0; } -static struct lcd_ops l4f_ops = { +static const struct lcd_ops l4f_ops = { .set_power = l4f00242t03_lcd_power_set, .get_power = l4f00242t03_lcd_power_get, }; diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 77c5cb2a44e2..ba3e37b5b584 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -188,7 +188,7 @@ ATTRIBUTE_GROUPS(lcd_device); * or a pointer to the newly allocated device. */ struct lcd_device *lcd_device_register(const char *name, struct device *parent, - void *devdata, struct lcd_ops *ops) + void *devdata, const struct lcd_ops *ops) { struct lcd_device *new_ld; int rc; @@ -276,7 +276,7 @@ static int devm_lcd_device_match(struct device *dev, void *res, void *data) */ struct lcd_device *devm_lcd_device_register(struct device *dev, const char *name, struct device *parent, - void *devdata, struct lcd_ops *ops) + void *devdata, const struct lcd_ops *ops) { struct lcd_device **ptr, *lcd; diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index 36856962ed83..a65490e83d3d 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c @@ -139,7 +139,7 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power) return 0; } -static struct lcd_ops lms_ops = { +static const struct lcd_ops lms_ops = { .set_power = lms283gf05_power_set, .get_power = NULL, }; diff --git a/drivers/video/backlight/lms501kf03.c b/drivers/video/backlight/lms501kf03.c index 5c46df8022bf..8aebe0af3391 100644 --- a/drivers/video/backlight/lms501kf03.c +++ b/drivers/video/backlight/lms501kf03.c @@ -304,7 +304,7 @@ static int lms501kf03_set_power(struct lcd_device *ld, int power) return lms501kf03_power(lcd, power); } -static struct lcd_ops lms501kf03_lcd_ops = { +static const struct lcd_ops lms501kf03_lcd_ops = { .get_power = lms501kf03_get_power, .set_power = lms501kf03_set_power, }; diff --git a/drivers/video/backlight/ltv350qv.c b/drivers/video/backlight/ltv350qv.c index d54f501e4285..cdc4c087f230 100644 --- a/drivers/video/backlight/ltv350qv.c +++ b/drivers/video/backlight/ltv350qv.c @@ -217,7 +217,7 @@ static int ltv350qv_get_power(struct lcd_device *ld) return lcd->power; } -static struct lcd_ops ltv_ops = { +static const struct lcd_ops ltv_ops = { .get_power = ltv350qv_get_power, .set_power = ltv350qv_set_power, }; diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index c80a1481e742..7d73e85b8c14 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -363,7 +363,6 @@ static int mp3309c_probe(struct i2c_client *client) props.scale = BACKLIGHT_SCALE_LINEAR; props.type = BACKLIGHT_RAW; props.power = FB_BLANK_UNBLANK; - props.fb_blank = FB_BLANK_UNBLANK; chip->bl = devm_backlight_device_register(dev, "mp3309c", dev, chip, &mp3309c_bl_ops, &props); if (IS_ERR(chip->bl)) diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 69a49384b3de..e461e19231ae 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c @@ -9,7 +9,6 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> -#include <linux/fb.h> #include <linux/backlight.h> #include <linux/slab.h> #include <linux/platform_data/omap1_bl.h> @@ -20,7 +19,7 @@ #define OMAPBL_MAX_INTENSITY 0xff struct omap_backlight { - int powermode; + bool enabled; int current_intensity; struct device *dev; @@ -37,24 +36,14 @@ static inline void omapbl_send_enable(int enable) omap_writeb(enable, OMAP_PWL_CLK_ENABLE); } -static void omapbl_blank(struct omap_backlight *bl, int mode) +static void omapbl_enable(struct omap_backlight *bl, bool enable) { - if (bl->pdata->set_power) - bl->pdata->set_power(bl->dev, mode); - - switch (mode) { - case FB_BLANK_NORMAL: - case FB_BLANK_VSYNC_SUSPEND: - case FB_BLANK_HSYNC_SUSPEND: - case FB_BLANK_POWERDOWN: - omapbl_send_intensity(0); - omapbl_send_enable(0); - break; - - case FB_BLANK_UNBLANK: + if (enable) { omapbl_send_intensity(bl->current_intensity); omapbl_send_enable(1); - break; + } else { + omapbl_send_intensity(0); + omapbl_send_enable(0); } } @@ -64,7 +53,7 @@ static int omapbl_suspend(struct device *dev) struct backlight_device *bl_dev = dev_get_drvdata(dev); struct omap_backlight *bl = bl_get_data(bl_dev); - omapbl_blank(bl, FB_BLANK_POWERDOWN); + omapbl_enable(bl, false); return 0; } @@ -73,33 +62,34 @@ static int omapbl_resume(struct device *dev) struct backlight_device *bl_dev = dev_get_drvdata(dev); struct omap_backlight *bl = bl_get_data(bl_dev); - omapbl_blank(bl, bl->powermode); + omapbl_enable(bl, bl->enabled); return 0; } #endif -static int omapbl_set_power(struct backlight_device *dev, int state) +static void omapbl_set_enabled(struct backlight_device *dev, bool enable) { struct omap_backlight *bl = bl_get_data(dev); - omapbl_blank(bl, state); - bl->powermode = state; - - return 0; + omapbl_enable(bl, enable); + bl->enabled = enable; } static int omapbl_update_status(struct backlight_device *dev) { struct omap_backlight *bl = bl_get_data(dev); + bool enable; if (bl->current_intensity != dev->props.brightness) { - if (bl->powermode == FB_BLANK_UNBLANK) + if (bl->enabled) omapbl_send_intensity(dev->props.brightness); bl->current_intensity = dev->props.brightness; } - if (dev->props.fb_blank != bl->powermode) - omapbl_set_power(dev, dev->props.fb_blank); + enable = !backlight_is_blank(dev); + + if (enable != bl->enabled) + omapbl_set_enabled(dev, enable); return 0; } @@ -139,7 +129,7 @@ static int omapbl_probe(struct platform_device *pdev) if (IS_ERR(dev)) return PTR_ERR(dev); - bl->powermode = FB_BLANK_POWERDOWN; + bl->enabled = false; bl->current_intensity = 0; bl->pdata = pdata; @@ -149,7 +139,6 @@ static int omapbl_probe(struct platform_device *pdev) omap_cfg_reg(PWL); /* Conflicts with UART3 */ - dev->props.fb_blank = FB_BLANK_UNBLANK; dev->props.brightness = pdata->default_intensity; omapbl_update_status(dev); diff --git a/drivers/video/backlight/otm3225a.c b/drivers/video/backlight/otm3225a.c index 2472e2167aae..d7b09c10f908 100644 --- a/drivers/video/backlight/otm3225a.c +++ b/drivers/video/backlight/otm3225a.c @@ -205,7 +205,7 @@ static int otm3225a_get_power(struct lcd_device *ld) return dd->power; } -static struct lcd_ops otm3225a_ops = { +static const struct lcd_ops otm3225a_ops = { .set_power = otm3225a_set_power, .get_power = otm3225a_get_power, }; diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index dc37494baf42..76872f5c34c5 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c @@ -62,7 +62,7 @@ static int platform_lcd_match(struct lcd_device *lcd, struct fb_info *info) return plcd->us->parent == info->device; } -static struct lcd_ops platform_lcd_ops = { +static const struct lcd_ops platform_lcd_ops = { .get_power = platform_lcd_get_power, .set_power = platform_lcd_set_power, .check_fb = platform_lcd_match, diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index fc6fbaf85594..c413b3c68e95 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c @@ -322,7 +322,7 @@ static int tdo24m_set_mode(struct lcd_device *ld, struct fb_videomode *m) return lcd->adj_mode(lcd, mode); } -static struct lcd_ops tdo24m_ops = { +static const struct lcd_ops tdo24m_ops = { .get_power = tdo24m_get_power, .set_power = tdo24m_set_power, .set_mode = tdo24m_set_mode, |