diff options
author | Stanley.Miao <stanley.miao@windriver.com> | 2010-09-02 23:03:48 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-10-22 16:21:14 -0400 |
commit | 18016e35d448d35739f8640b51476709c07e95db (patch) | |
tree | f01f76bd471332308d6e7c22af6310386437d121 /drivers/video | |
parent | 41814cfc01b059df33011d929837558c22f3c0e0 (diff) |
OMAP: DSS2: don't power off a panel twice
If we blank the panel by
echo 1 > /sys/devices/platform/omapfb/graphics/fb0/blank
Then, we reboot the sytem, the kernel will crash at
drivers/video/omap2/dss/core.c:323
This is because the panel is closed twice. Now check the state of a dssdev
to forbid a panel is power on or power off twice.
Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video')
6 files changed, 36 insertions, 0 deletions
diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c index 07fbb8a733bb..e77310653207 100644 --- a/drivers/video/omap2/displays/panel-acx565akm.c +++ b/drivers/video/omap2/displays/panel-acx565akm.c | |||
@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev) | |||
587 | 587 | ||
588 | dev_dbg(&dssdev->dev, "%s\n", __func__); | 588 | dev_dbg(&dssdev->dev, "%s\n", __func__); |
589 | 589 | ||
590 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
591 | return 0; | ||
592 | |||
590 | mutex_lock(&md->mutex); | 593 | mutex_lock(&md->mutex); |
591 | 594 | ||
592 | r = omapdss_sdi_display_enable(dssdev); | 595 | r = omapdss_sdi_display_enable(dssdev); |
@@ -644,6 +647,9 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev) | |||
644 | 647 | ||
645 | dev_dbg(&dssdev->dev, "%s\n", __func__); | 648 | dev_dbg(&dssdev->dev, "%s\n", __func__); |
646 | 649 | ||
650 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
651 | return; | ||
652 | |||
647 | mutex_lock(&md->mutex); | 653 | mutex_lock(&md->mutex); |
648 | 654 | ||
649 | if (!md->enabled) { | 655 | if (!md->enabled) { |
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c index 300eff5de1b4..395a68de3990 100644 --- a/drivers/video/omap2/displays/panel-generic.c +++ b/drivers/video/omap2/displays/panel-generic.c | |||
@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device *dssdev) | |||
39 | { | 39 | { |
40 | int r; | 40 | int r; |
41 | 41 | ||
42 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
43 | return 0; | ||
44 | |||
42 | r = omapdss_dpi_display_enable(dssdev); | 45 | r = omapdss_dpi_display_enable(dssdev); |
43 | if (r) | 46 | if (r) |
44 | goto err0; | 47 | goto err0; |
@@ -58,6 +61,9 @@ err0: | |||
58 | 61 | ||
59 | static void generic_panel_power_off(struct omap_dss_device *dssdev) | 62 | static void generic_panel_power_off(struct omap_dss_device *dssdev) |
60 | { | 63 | { |
64 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
65 | return; | ||
66 | |||
61 | if (dssdev->platform_disable) | 67 | if (dssdev->platform_disable) |
62 | dssdev->platform_disable(dssdev); | 68 | dssdev->platform_disable(dssdev); |
63 | 69 | ||
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c index 10267461991c..0c6896cea2d0 100644 --- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c +++ b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c | |||
@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev) | |||
43 | { | 43 | { |
44 | int r; | 44 | int r; |
45 | 45 | ||
46 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
47 | return 0; | ||
48 | |||
46 | r = omapdss_dpi_display_enable(dssdev); | 49 | r = omapdss_dpi_display_enable(dssdev); |
47 | if (r) | 50 | if (r) |
48 | goto err0; | 51 | goto err0; |
@@ -65,6 +68,9 @@ err0: | |||
65 | 68 | ||
66 | static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev) | 69 | static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev) |
67 | { | 70 | { |
71 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
72 | return; | ||
73 | |||
68 | if (dssdev->platform_disable) | 74 | if (dssdev->platform_disable) |
69 | dssdev->platform_disable(dssdev); | 75 | dssdev->platform_disable(dssdev); |
70 | 76 | ||
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c index 7d9eb2b1f5af..9a138f650e05 100644 --- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c | |||
@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev) | |||
135 | { | 135 | { |
136 | int r = 0; | 136 | int r = 0; |
137 | 137 | ||
138 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
139 | return 0; | ||
140 | |||
138 | r = omapdss_dpi_display_enable(dssdev); | 141 | r = omapdss_dpi_display_enable(dssdev); |
139 | if (r) | 142 | if (r) |
140 | goto err0; | 143 | goto err0; |
@@ -157,6 +160,9 @@ err0: | |||
157 | 160 | ||
158 | static void sharp_ls_power_off(struct omap_dss_device *dssdev) | 161 | static void sharp_ls_power_off(struct omap_dss_device *dssdev) |
159 | { | 162 | { |
163 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
164 | return; | ||
165 | |||
160 | if (dssdev->platform_disable) | 166 | if (dssdev->platform_disable) |
161 | dssdev->platform_disable(dssdev); | 167 | dssdev->platform_disable(dssdev); |
162 | 168 | ||
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c index e320e67d06f3..526e906c8a6c 100644 --- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c +++ b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c | |||
@@ -46,6 +46,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev) | |||
46 | { | 46 | { |
47 | int r; | 47 | int r; |
48 | 48 | ||
49 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
50 | return 0; | ||
51 | |||
49 | r = omapdss_dpi_display_enable(dssdev); | 52 | r = omapdss_dpi_display_enable(dssdev); |
50 | if (r) | 53 | if (r) |
51 | goto err0; | 54 | goto err0; |
@@ -65,6 +68,9 @@ err0: | |||
65 | 68 | ||
66 | static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev) | 69 | static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev) |
67 | { | 70 | { |
71 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
72 | return; | ||
73 | |||
68 | if (dssdev->platform_disable) | 74 | if (dssdev->platform_disable) |
69 | dssdev->platform_disable(dssdev); | 75 | dssdev->platform_disable(dssdev); |
70 | 76 | ||
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index e866e76b13d0..dbe9d43b4850 100644 --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c | |||
@@ -269,6 +269,9 @@ static int tpo_td043_power_on(struct omap_dss_device *dssdev) | |||
269 | int nreset_gpio = dssdev->reset_gpio; | 269 | int nreset_gpio = dssdev->reset_gpio; |
270 | int r; | 270 | int r; |
271 | 271 | ||
272 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) | ||
273 | return 0; | ||
274 | |||
272 | r = omapdss_dpi_display_enable(dssdev); | 275 | r = omapdss_dpi_display_enable(dssdev); |
273 | if (r) | 276 | if (r) |
274 | goto err0; | 277 | goto err0; |
@@ -308,6 +311,9 @@ static void tpo_td043_power_off(struct omap_dss_device *dssdev) | |||
308 | struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); | 311 | struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); |
309 | int nreset_gpio = dssdev->reset_gpio; | 312 | int nreset_gpio = dssdev->reset_gpio; |
310 | 313 | ||
314 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
315 | return; | ||
316 | |||
311 | tpo_td043_write(tpo_td043->spi, 3, | 317 | tpo_td043_write(tpo_td043->spi, 3, |
312 | TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM); | 318 | TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM); |
313 | 319 | ||