OMAP: DSS2: don't power off a panel twice
authorStanley.Miao <stanley.miao@windriver.com>
Fri, 3 Sep 2010 03:03:48 +0000 (05:03 +0200)
committerTomi Valkeinen <tomi.valkeinen@nokia.com>
Fri, 22 Oct 2010 20:21:14 +0000 (23:21 +0300)
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>
drivers/video/omap2/displays/panel-acx565akm.c
drivers/video/omap2/displays/panel-generic.c
drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
drivers/video/omap2/displays/panel-toppoly-tdo35s.c
drivers/video/omap2/displays/panel-tpo-td043mtea1.c

index 07fbb8a733bb5ecd46c569e56d5ebe0c99714e61..e77310653207c1c8202c0bbabddc692c6df4f2b6 100644 (file)
@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
 
        dev_dbg(&dssdev->dev, "%s\n", __func__);
 
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+
        mutex_lock(&md->mutex);
 
        r = omapdss_sdi_display_enable(dssdev);
@@ -644,6 +647,9 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev)
 
        dev_dbg(&dssdev->dev, "%s\n", __func__);
 
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
+
        mutex_lock(&md->mutex);
 
        if (!md->enabled) {
index 300eff5de1b4830490e6a5f36d48adf8b63a5b1e..395a68de399048f90b388b64416531695a07e223 100644 (file)
@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device *dssdev)
 {
        int r;
 
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
                goto err0;
@@ -58,6 +61,9 @@ err0:
 
 static void generic_panel_power_off(struct omap_dss_device *dssdev)
 {
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
+
        if (dssdev->platform_disable)
                dssdev->platform_disable(dssdev);
 
index 10267461991cde20a8a282099f89efe50df7adc3..0c6896cea2d0a2d01e593209b201d4d3a44555a5 100644 (file)
@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
 {
        int r;
 
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
                goto err0;
@@ -65,6 +68,9 @@ err0:
 
 static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
 {
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
+
        if (dssdev->platform_disable)
                dssdev->platform_disable(dssdev);
 
index 7d9eb2b1f5af39c8ad9433435c5ed3bb0315ffd6..9a138f650e0567e9e9f60118648fcd39543e06f6 100644 (file)
@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
 {
        int r = 0;
 
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
                goto err0;
@@ -157,6 +160,9 @@ err0:
 
 static void sharp_ls_power_off(struct omap_dss_device *dssdev)
 {
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
+
        if (dssdev->platform_disable)
                dssdev->platform_disable(dssdev);
 
index e320e67d06f3e80cec9bd8f5008d7eb7a07b3b9c..526e906c8a6c65ab4670308ff109a01a69473899 100644 (file)
@@ -46,6 +46,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
 {
        int r;
 
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
                goto err0;
@@ -65,6 +68,9 @@ err0:
 
 static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
 {
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
+
        if (dssdev->platform_disable)
                dssdev->platform_disable(dssdev);
 
index e866e76b13d02bfc746656c33d1167d94d7d84fb..dbe9d43b4850d80c7218719528ce3c57c473b944 100644 (file)
@@ -269,6 +269,9 @@ static int tpo_td043_power_on(struct omap_dss_device *dssdev)
        int nreset_gpio = dssdev->reset_gpio;
        int r;
 
+       if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+               return 0;
+
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
                goto err0;
@@ -308,6 +311,9 @@ static void tpo_td043_power_off(struct omap_dss_device *dssdev)
        struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev);
        int nreset_gpio = dssdev->reset_gpio;
 
+       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
+               return;
+
        tpo_td043_write(tpo_td043->spi, 3,
                        TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM);