aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/atmel_lcdfb.c2
-rw-r--r--drivers/video/aty/aty128fb.c2
-rw-r--r--drivers/video/aty/atyfb_base.c2
-rw-r--r--drivers/video/aty/radeon_backlight.c2
-rw-r--r--drivers/video/backlight/88pm860x_bl.c2
-rw-r--r--drivers/video/backlight/l4f00242t03.c106
-rw-r--r--drivers/video/backlight/max8925_bl.c2
-rw-r--r--drivers/video/console/vgacon.c3
-rw-r--r--drivers/video/nvidia/nv_backlight.c2
-rw-r--r--drivers/video/omap2/displays/panel-taal.c2
-rw-r--r--drivers/video/riva/fbdev.c2
-rw-r--r--drivers/video/sh_mobile_hdmi.c1
-rw-r--r--drivers/video/sstfb.c2
13 files changed, 94 insertions, 36 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 8dce25126330..bac163450216 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -111,7 +111,7 @@ static int atmel_bl_get_brightness(struct backlight_device *bl)
111 return lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); 111 return lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
112} 112}
113 113
114static struct backlight_ops atmel_lcdc_bl_ops = { 114static const struct backlight_ops atmel_lcdc_bl_ops = {
115 .update_status = atmel_bl_update_status, 115 .update_status = atmel_bl_update_status,
116 .get_brightness = atmel_bl_get_brightness, 116 .get_brightness = atmel_bl_get_brightness,
117}; 117};
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 34a0851bcbfa..dd9de2e80580 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1786,7 +1786,7 @@ static int aty128_bl_get_brightness(struct backlight_device *bd)
1786 return bd->props.brightness; 1786 return bd->props.brightness;
1787} 1787}
1788 1788
1789static struct backlight_ops aty128_bl_data = { 1789static const struct backlight_ops aty128_bl_data = {
1790 .get_brightness = aty128_bl_get_brightness, 1790 .get_brightness = aty128_bl_get_brightness,
1791 .update_status = aty128_bl_update_status, 1791 .update_status = aty128_bl_update_status,
1792}; 1792};
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 5a3ce3ad1ec8..767ab4fb1a05 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2221,7 +2221,7 @@ static int aty_bl_get_brightness(struct backlight_device *bd)
2221 return bd->props.brightness; 2221 return bd->props.brightness;
2222} 2222}
2223 2223
2224static struct backlight_ops aty_bl_data = { 2224static const struct backlight_ops aty_bl_data = {
2225 .get_brightness = aty_bl_get_brightness, 2225 .get_brightness = aty_bl_get_brightness,
2226 .update_status = aty_bl_update_status, 2226 .update_status = aty_bl_update_status,
2227}; 2227};
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c
index 256966e9667d..9b811ddbce83 100644
--- a/drivers/video/aty/radeon_backlight.c
+++ b/drivers/video/aty/radeon_backlight.c
@@ -128,7 +128,7 @@ static int radeon_bl_get_brightness(struct backlight_device *bd)
128 return bd->props.brightness; 128 return bd->props.brightness;
129} 129}
130 130
131static struct backlight_ops radeon_bl_data = { 131static const struct backlight_ops radeon_bl_data = {
132 .get_brightness = radeon_bl_get_brightness, 132 .get_brightness = radeon_bl_get_brightness,
133 .update_status = radeon_bl_update_status, 133 .update_status = radeon_bl_update_status,
134}; 134};
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c
index 38ffc3fbcbe4..c789c46e38af 100644
--- a/drivers/video/backlight/88pm860x_bl.c
+++ b/drivers/video/backlight/88pm860x_bl.c
@@ -155,7 +155,7 @@ out:
155 return -EINVAL; 155 return -EINVAL;
156} 156}
157 157
158static struct backlight_ops pm860x_backlight_ops = { 158static const struct backlight_ops pm860x_backlight_ops = {
159 .options = BL_CORE_SUSPENDRESUME, 159 .options = BL_CORE_SUSPENDRESUME,
160 .update_status = pm860x_backlight_update_status, 160 .update_status = pm860x_backlight_update_status,
161 .get_brightness = pm860x_backlight_get_brightness, 161 .get_brightness = pm860x_backlight_get_brightness,
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index c67801e57aaf..98ad3e5f7c85 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -25,7 +25,7 @@
25struct l4f00242t03_priv { 25struct l4f00242t03_priv {
26 struct spi_device *spi; 26 struct spi_device *spi;
27 struct lcd_device *ld; 27 struct lcd_device *ld;
28 int lcd_on:1; 28 int lcd_state;
29 struct regulator *io_reg; 29 struct regulator *io_reg;
30 struct regulator *core_reg; 30 struct regulator *core_reg;
31}; 31};
@@ -62,11 +62,36 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)
62 regulator_enable(priv->core_reg); 62 regulator_enable(priv->core_reg);
63 } 63 }
64 64
65 l4f00242t03_reset(pdata->reset_gpio);
66
65 gpio_set_value(pdata->data_enable_gpio, 1); 67 gpio_set_value(pdata->data_enable_gpio, 1);
66 msleep(60); 68 msleep(60);
67 spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16)); 69 spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16));
68} 70}
69 71
72static void l4f00242t03_lcd_powerdown(struct spi_device *spi)
73{
74 struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
75 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev);
76
77 dev_dbg(&spi->dev, "Powering down LCD\n");
78
79 gpio_set_value(pdata->data_enable_gpio, 0);
80
81 if (priv->io_reg)
82 regulator_disable(priv->io_reg);
83
84 if (priv->core_reg)
85 regulator_disable(priv->core_reg);
86}
87
88static int l4f00242t03_lcd_power_get(struct lcd_device *ld)
89{
90 struct l4f00242t03_priv *priv = lcd_get_data(ld);
91
92 return priv->lcd_state;
93}
94
70static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power) 95static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
71{ 96{
72 struct l4f00242t03_priv *priv = lcd_get_data(ld); 97 struct l4f00242t03_priv *priv = lcd_get_data(ld);
@@ -79,35 +104,54 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
79 const u16 disoff = 0x28; 104 const u16 disoff = 0x28;
80 105
81 if (power <= FB_BLANK_NORMAL) { 106 if (power <= FB_BLANK_NORMAL) {
82 if (priv->lcd_on) 107 if (priv->lcd_state <= FB_BLANK_NORMAL) {
83 return 0; 108 /* Do nothing, the LCD is running */
84 109 } else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
85 dev_dbg(&spi->dev, "turning on LCD\n"); 110 dev_dbg(&spi->dev, "Resuming LCD\n");
86 111
87 spi_write(spi, (const u8 *)&slpout, sizeof(u16)); 112 spi_write(spi, (const u8 *)&slpout, sizeof(u16));
88 msleep(60); 113 msleep(60);
89 spi_write(spi, (const u8 *)&dison, sizeof(u16)); 114 spi_write(spi, (const u8 *)&dison, sizeof(u16));
90 115 } else {
91 priv->lcd_on = 1; 116 /* priv->lcd_state == FB_BLANK_POWERDOWN */
117 l4f00242t03_lcd_init(spi);
118 priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
119 l4f00242t03_lcd_power_set(priv->ld, power);
120 }
121 } else if (power < FB_BLANK_POWERDOWN) {
122 if (priv->lcd_state <= FB_BLANK_NORMAL) {
123 /* Send the display in standby */
124 dev_dbg(&spi->dev, "Standby the LCD\n");
125
126 spi_write(spi, (const u8 *)&disoff, sizeof(u16));
127 msleep(60);
128 spi_write(spi, (const u8 *)&slpin, sizeof(u16));
129 } else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
130 /* Do nothing, the LCD is already in standby */
131 } else {
132 /* priv->lcd_state == FB_BLANK_POWERDOWN */
133 l4f00242t03_lcd_init(spi);
134 priv->lcd_state = FB_BLANK_UNBLANK;
135 l4f00242t03_lcd_power_set(ld, power);
136 }
92 } else { 137 } else {
93 if (!priv->lcd_on) 138 /* power == FB_BLANK_POWERDOWN */
94 return 0; 139 if (priv->lcd_state != FB_BLANK_POWERDOWN) {
95 140 /* Clear the screen before shutting down */
96 dev_dbg(&spi->dev, "turning off LCD\n"); 141 spi_write(spi, (const u8 *)&disoff, sizeof(u16));
97 142 msleep(60);
98 spi_write(spi, (const u8 *)&disoff, sizeof(u16)); 143 l4f00242t03_lcd_powerdown(spi);
99 msleep(60); 144 }
100 spi_write(spi, (const u8 *)&slpin, sizeof(u16));
101
102 priv->lcd_on = 0;
103 } 145 }
104 146
147 priv->lcd_state = power;
148
105 return 0; 149 return 0;
106} 150}
107 151
108static struct lcd_ops l4f_ops = { 152static struct lcd_ops l4f_ops = {
109 .set_power = l4f00242t03_lcd_power_set, 153 .set_power = l4f00242t03_lcd_power_set,
110 .get_power = NULL, 154 .get_power = l4f00242t03_lcd_power_get,
111}; 155};
112 156
113static int __devinit l4f00242t03_probe(struct spi_device *spi) 157static int __devinit l4f00242t03_probe(struct spi_device *spi)
@@ -185,9 +229,9 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
185 } 229 }
186 230
187 /* Init the LCD */ 231 /* Init the LCD */
188 l4f00242t03_reset(pdata->reset_gpio);
189 l4f00242t03_lcd_init(spi); 232 l4f00242t03_lcd_init(spi);
190 l4f00242t03_lcd_power_set(priv->ld, 1); 233 priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
234 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
191 235
192 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n"); 236 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
193 237
@@ -214,9 +258,11 @@ static int __devexit l4f00242t03_remove(struct spi_device *spi)
214 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 258 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev);
215 struct l4f00242t03_pdata *pdata = priv->spi->dev.platform_data; 259 struct l4f00242t03_pdata *pdata = priv->spi->dev.platform_data;
216 260
217 l4f00242t03_lcd_power_set(priv->ld, 0); 261 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
218 lcd_device_unregister(priv->ld); 262 lcd_device_unregister(priv->ld);
219 263
264 dev_set_drvdata(&spi->dev, NULL);
265
220 gpio_free(pdata->data_enable_gpio); 266 gpio_free(pdata->data_enable_gpio);
221 gpio_free(pdata->reset_gpio); 267 gpio_free(pdata->reset_gpio);
222 268
@@ -230,6 +276,15 @@ static int __devexit l4f00242t03_remove(struct spi_device *spi)
230 return 0; 276 return 0;
231} 277}
232 278
279static void l4f00242t03_shutdown(struct spi_device *spi)
280{
281 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev);
282
283 if (priv)
284 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
285
286}
287
233static struct spi_driver l4f00242t03_driver = { 288static struct spi_driver l4f00242t03_driver = {
234 .driver = { 289 .driver = {
235 .name = "l4f00242t03", 290 .name = "l4f00242t03",
@@ -237,6 +292,7 @@ static struct spi_driver l4f00242t03_driver = {
237 }, 292 },
238 .probe = l4f00242t03_probe, 293 .probe = l4f00242t03_probe,
239 .remove = __devexit_p(l4f00242t03_remove), 294 .remove = __devexit_p(l4f00242t03_remove),
295 .shutdown = l4f00242t03_shutdown,
240}; 296};
241 297
242static __init int l4f00242t03_init(void) 298static __init int l4f00242t03_init(void)
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c
index b2b2c7ba1f63..209acc105cbc 100644
--- a/drivers/video/backlight/max8925_bl.c
+++ b/drivers/video/backlight/max8925_bl.c
@@ -92,7 +92,7 @@ static int max8925_backlight_get_brightness(struct backlight_device *bl)
92 return ret; 92 return ret;
93} 93}
94 94
95static struct backlight_ops max8925_backlight_ops = { 95static const struct backlight_ops max8925_backlight_ops = {
96 .options = BL_CORE_SUSPENDRESUME, 96 .options = BL_CORE_SUSPENDRESUME,
97 .update_status = max8925_backlight_update_status, 97 .update_status = max8925_backlight_update_status,
98 .get_brightness = max8925_backlight_get_brightness, 98 .get_brightness = max8925_backlight_get_brightness,
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 915448ec75bf..c97491b8b39b 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -375,7 +375,8 @@ static const char *vgacon_startup(void)
375 u16 saved1, saved2; 375 u16 saved1, saved2;
376 volatile u16 *p; 376 volatile u16 *p;
377 377
378 if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB) { 378 if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB ||
379 screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) {
379 no_vga: 380 no_vga:
380#ifdef CONFIG_DUMMY_CONSOLE 381#ifdef CONFIG_DUMMY_CONSOLE
381 conswitchp = &dummy_con; 382 conswitchp = &dummy_con;
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index 2fb552a6f32c..6aac6d1b937b 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -87,7 +87,7 @@ static int nvidia_bl_get_brightness(struct backlight_device *bd)
87 return bd->props.brightness; 87 return bd->props.brightness;
88} 88}
89 89
90static struct backlight_ops nvidia_bl_ops = { 90static const struct backlight_ops nvidia_bl_ops = {
91 .get_brightness = nvidia_bl_get_brightness, 91 .get_brightness = nvidia_bl_get_brightness,
92 .update_status = nvidia_bl_update_status, 92 .update_status = nvidia_bl_update_status,
93}; 93};
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index e1c765d11419..61026f96ad20 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -465,7 +465,7 @@ static int taal_bl_get_intensity(struct backlight_device *dev)
465 return 0; 465 return 0;
466} 466}
467 467
468static struct backlight_ops taal_bl_ops = { 468static const struct backlight_ops taal_bl_ops = {
469 .get_brightness = taal_bl_get_intensity, 469 .get_brightness = taal_bl_get_intensity,
470 .update_status = taal_bl_update_status, 470 .update_status = taal_bl_update_status,
471}; 471};
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 618f36bec10d..da388186d617 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -331,7 +331,7 @@ static int riva_bl_get_brightness(struct backlight_device *bd)
331 return bd->props.brightness; 331 return bd->props.brightness;
332} 332}
333 333
334static struct backlight_ops riva_bl_ops = { 334static const struct backlight_ops riva_bl_ops = {
335 .get_brightness = riva_bl_get_brightness, 335 .get_brightness = riva_bl_get_brightness,
336 .update_status = riva_bl_update_status, 336 .update_status = riva_bl_update_status,
337}; 337};
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index e3eb77dfbf22..74d9f546a2e8 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -22,6 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <sound/soc.h>
25#include <sound/soc-dapm.h> 26#include <sound/soc-dapm.h>
26#include <sound/initval.h> 27#include <sound/initval.h>
27 28
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index dee64c3b1e67..2ab704118c44 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -536,7 +536,7 @@ static int sstfb_set_par(struct fb_info *info)
536 fbiinit2 = sst_read(FBIINIT2); 536 fbiinit2 = sst_read(FBIINIT2);
537 fbiinit3 = sst_read(FBIINIT3); 537 fbiinit3 = sst_read(FBIINIT3);
538 538
539 /* everything is reset. we enable fbiinit2/3 remap : dac acces ok */ 539 /* everything is reset. we enable fbiinit2/3 remap : dac access ok */
540 pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, 540 pci_write_config_dword(sst_dev, PCI_INIT_ENABLE,
541 PCI_EN_INIT_WR | PCI_REMAP_DAC ); 541 PCI_EN_INIT_WR | PCI_REMAP_DAC );
542 542