mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-04 03:33:58 +08:00
OMAP: DSS2: Taal: Change ESD work management
Move ESD work queuing and cancelling out of taal_power_on/off() to avoid problems related to taal_esd_work() calling the power on/off functions. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
This commit is contained in:
parent
fed44b7af8
commit
4571a023f5
@ -654,7 +654,7 @@ static void taal_remove(struct omap_dss_device *dssdev)
|
|||||||
taal_bl_update_status(bldev);
|
taal_bl_update_status(bldev);
|
||||||
backlight_device_unregister(bldev);
|
backlight_device_unregister(bldev);
|
||||||
|
|
||||||
cancel_delayed_work_sync(&td->esd_work);
|
cancel_delayed_work(&td->esd_work);
|
||||||
destroy_workqueue(td->esd_wq);
|
destroy_workqueue(td->esd_wq);
|
||||||
|
|
||||||
/* reset, to be sure that the panel is in a valid state */
|
/* reset, to be sure that the panel is in a valid state */
|
||||||
@ -725,10 +725,6 @@ static int taal_power_on(struct omap_dss_device *dssdev)
|
|||||||
if (r)
|
if (r)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
#ifdef TAAL_USE_ESD_CHECK
|
|
||||||
queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
td->enabled = 1;
|
td->enabled = 1;
|
||||||
|
|
||||||
if (!td->intro_printed) {
|
if (!td->intro_printed) {
|
||||||
@ -758,8 +754,6 @@ static void taal_power_off(struct omap_dss_device *dssdev)
|
|||||||
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
|
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
cancel_delayed_work(&td->esd_work);
|
|
||||||
|
|
||||||
r = taal_dcs_write_0(DCS_DISPLAY_OFF);
|
r = taal_dcs_write_0(DCS_DISPLAY_OFF);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
r = taal_sleep_in(td);
|
r = taal_sleep_in(td);
|
||||||
@ -801,6 +795,10 @@ static int taal_enable(struct omap_dss_device *dssdev)
|
|||||||
if (r)
|
if (r)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
#ifdef TAAL_USE_ESD_CHECK
|
||||||
|
queue_delayed_work(td->esd_wq, &td->esd_work, TAAL_ESD_CHECK_PERIOD);
|
||||||
|
#endif
|
||||||
|
|
||||||
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
|
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
|
||||||
|
|
||||||
mutex_unlock(&td->lock);
|
mutex_unlock(&td->lock);
|
||||||
@ -820,6 +818,8 @@ static void taal_disable(struct omap_dss_device *dssdev)
|
|||||||
|
|
||||||
mutex_lock(&td->lock);
|
mutex_lock(&td->lock);
|
||||||
|
|
||||||
|
cancel_delayed_work(&td->esd_work);
|
||||||
|
|
||||||
dsi_bus_lock();
|
dsi_bus_lock();
|
||||||
|
|
||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
@ -846,6 +846,8 @@ static int taal_suspend(struct omap_dss_device *dssdev)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cancel_delayed_work(&td->esd_work);
|
||||||
|
|
||||||
dsi_bus_lock();
|
dsi_bus_lock();
|
||||||
|
|
||||||
taal_power_off(dssdev);
|
taal_power_off(dssdev);
|
||||||
@ -882,10 +884,15 @@ static int taal_resume(struct omap_dss_device *dssdev)
|
|||||||
|
|
||||||
dsi_bus_unlock();
|
dsi_bus_unlock();
|
||||||
|
|
||||||
if (r)
|
if (r) {
|
||||||
dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
|
dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
|
||||||
else
|
} else {
|
||||||
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
|
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
|
||||||
|
#ifdef TAAL_USE_ESD_CHECK
|
||||||
|
queue_delayed_work(td->esd_wq, &td->esd_work,
|
||||||
|
TAAL_ESD_CHECK_PERIOD);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
mutex_unlock(&td->lock);
|
mutex_unlock(&td->lock);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user