Commit 18016e35 authored by Stanley.Miao's avatar Stanley.Miao Committed by Tomi Valkeinen

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: default avatarStanley.Miao <stanley.miao@windriver.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent 41814cfc
...@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev) ...@@ -587,6 +587,9 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(&dssdev->dev, "%s\n", __func__);
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0;
mutex_lock(&md->mutex); mutex_lock(&md->mutex);
r = omapdss_sdi_display_enable(dssdev); r = omapdss_sdi_display_enable(dssdev);
...@@ -644,6 +647,9 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev) ...@@ -644,6 +647,9 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev)
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(&dssdev->dev, "%s\n", __func__);
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
mutex_lock(&md->mutex); mutex_lock(&md->mutex);
if (!md->enabled) { if (!md->enabled) {
......
...@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device *dssdev) ...@@ -39,6 +39,9 @@ static int generic_panel_power_on(struct omap_dss_device *dssdev)
{ {
int r; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0;
r = omapdss_dpi_display_enable(dssdev); r = omapdss_dpi_display_enable(dssdev);
if (r) if (r)
goto err0; goto err0;
...@@ -58,6 +61,9 @@ static int generic_panel_power_on(struct omap_dss_device *dssdev) ...@@ -58,6 +61,9 @@ static int generic_panel_power_on(struct omap_dss_device *dssdev)
static void generic_panel_power_off(struct omap_dss_device *dssdev) static void generic_panel_power_off(struct omap_dss_device *dssdev)
{ {
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
if (dssdev->platform_disable) if (dssdev->platform_disable)
dssdev->platform_disable(dssdev); dssdev->platform_disable(dssdev);
......
...@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev) ...@@ -43,6 +43,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
{ {
int r; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0;
r = omapdss_dpi_display_enable(dssdev); r = omapdss_dpi_display_enable(dssdev);
if (r) if (r)
goto err0; goto err0;
...@@ -65,6 +68,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev) ...@@ -65,6 +68,9 @@ static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev)
static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev) static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev)
{ {
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
if (dssdev->platform_disable) if (dssdev->platform_disable)
dssdev->platform_disable(dssdev); dssdev->platform_disable(dssdev);
......
...@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev) ...@@ -135,6 +135,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
{ {
int r = 0; int r = 0;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0;
r = omapdss_dpi_display_enable(dssdev); r = omapdss_dpi_display_enable(dssdev);
if (r) if (r)
goto err0; goto err0;
...@@ -157,6 +160,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev) ...@@ -157,6 +160,9 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
static void sharp_ls_power_off(struct omap_dss_device *dssdev) static void sharp_ls_power_off(struct omap_dss_device *dssdev)
{ {
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
if (dssdev->platform_disable) if (dssdev->platform_disable)
dssdev->platform_disable(dssdev); dssdev->platform_disable(dssdev);
......
...@@ -46,6 +46,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev) ...@@ -46,6 +46,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
{ {
int r; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0;
r = omapdss_dpi_display_enable(dssdev); r = omapdss_dpi_display_enable(dssdev);
if (r) if (r)
goto err0; goto err0;
...@@ -65,6 +68,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev) ...@@ -65,6 +68,9 @@ static int toppoly_tdo_panel_power_on(struct omap_dss_device *dssdev)
static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev) static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev)
{ {
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
if (dssdev->platform_disable) if (dssdev->platform_disable)
dssdev->platform_disable(dssdev); dssdev->platform_disable(dssdev);
......
...@@ -269,6 +269,9 @@ static int tpo_td043_power_on(struct omap_dss_device *dssdev) ...@@ -269,6 +269,9 @@ static int tpo_td043_power_on(struct omap_dss_device *dssdev)
int nreset_gpio = dssdev->reset_gpio; int nreset_gpio = dssdev->reset_gpio;
int r; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0;
r = omapdss_dpi_display_enable(dssdev); r = omapdss_dpi_display_enable(dssdev);
if (r) if (r)
goto err0; goto err0;
...@@ -308,6 +311,9 @@ static void tpo_td043_power_off(struct omap_dss_device *dssdev) ...@@ -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); struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev);
int nreset_gpio = dssdev->reset_gpio; int nreset_gpio = dssdev->reset_gpio;
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return;
tpo_td043_write(tpo_td043->spi, 3, tpo_td043_write(tpo_td043->spi, 3,
TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM); TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment