From patchwork Tue Apr 19 09:22:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 717581 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3J9N93i020245 for ; Tue, 19 Apr 2011 09:23:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754552Ab1DSJXI (ORCPT ); Tue, 19 Apr 2011 05:23:08 -0400 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]:47741 "EHLO na3sys009aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754512Ab1DSJXG (ORCPT ); Tue, 19 Apr 2011 05:23:06 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKTa1UeOjTtoa3ukINg1QdA5A4L4eTpGJN@postini.com; Tue, 19 Apr 2011 02:23:05 PDT Received: by ewy4 with SMTP id 4so1638057ewy.19 for ; Tue, 19 Apr 2011 02:23:02 -0700 (PDT) Received: by 10.14.123.143 with SMTP id v15mr2035349eeh.218.1303204982125; Tue, 19 Apr 2011 02:23:02 -0700 (PDT) Received: from deskari (a62-248-131-233.elisa-laajakaista.fi [62.248.131.233]) by mx.google.com with ESMTPS id m55sm4672311eei.8.2011.04.19.02.23.00 (version=SSLv3 cipher=OTHER); Tue, 19 Apr 2011 02:23:00 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 15/19] OMAP: DSS2: Taal: Clean up ESD queueing Date: Tue, 19 Apr 2011 12:22:18 +0300 Message-Id: <1303204942-25450-16-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1303204942-25450-1-git-send-email-tomi.valkeinen@ti.com> References: <1303204942-25450-1-git-send-email-tomi.valkeinen@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 09:23:09 +0000 (UTC) Separate the code which queues/cancels ESD work into their own functions. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/displays/panel-taal.c | 36 ++++++++++++++++++---------- 1 files changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index cdb28a8..2787a51 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -420,6 +420,22 @@ static int taal_set_update_window(struct taal_data *td, return r; } +static void taal_queue_esd_work(struct omap_dss_device *dssdev) +{ + struct taal_data *td = dev_get_drvdata(&dssdev->dev); + + if (td->esd_interval > 0) + queue_delayed_work(td->esd_wq, &td->esd_work, + msecs_to_jiffies(td->esd_interval)); +} + +static void taal_cancel_esd_work(struct omap_dss_device *dssdev) +{ + struct taal_data *td = dev_get_drvdata(&dssdev->dev); + + cancel_delayed_work(&td->esd_work); +} + static int taal_bl_update_status(struct backlight_device *dev) { struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev); @@ -841,7 +857,7 @@ static void __exit taal_remove(struct omap_dss_device *dssdev) taal_bl_update_status(bldev); backlight_device_unregister(bldev); - cancel_delayed_work(&td->esd_work); + taal_cancel_esd_work(dssdev); destroy_workqueue(td->esd_wq); /* reset, to be sure that the panel is in a valid state */ @@ -983,9 +999,7 @@ static int taal_enable(struct omap_dss_device *dssdev) if (r) goto err; - if (td->esd_interval > 0) - queue_delayed_work(td->esd_wq, &td->esd_work, - msecs_to_jiffies(td->esd_interval)); + taal_queue_esd_work(dssdev); dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; @@ -1006,7 +1020,7 @@ static void taal_disable(struct omap_dss_device *dssdev) mutex_lock(&td->lock); - cancel_delayed_work(&td->esd_work); + taal_cancel_esd_work(dssdev); dsi_bus_lock(); @@ -1034,7 +1048,7 @@ static int taal_suspend(struct omap_dss_device *dssdev) goto err; } - cancel_delayed_work(&td->esd_work); + taal_cancel_esd_work(dssdev); dsi_bus_lock(); @@ -1076,9 +1090,7 @@ static int taal_resume(struct omap_dss_device *dssdev) dssdev->state = OMAP_DSS_DISPLAY_DISABLED; } else { dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; - if (td->esd_interval > 0) - queue_delayed_work(td->esd_wq, &td->esd_work, - msecs_to_jiffies(td->esd_interval)); + taal_queue_esd_work(dssdev); } mutex_unlock(&td->lock); @@ -1521,8 +1533,7 @@ static void taal_esd_work(struct work_struct *work) dsi_bus_unlock(); - queue_delayed_work(td->esd_wq, &td->esd_work, - msecs_to_jiffies(td->esd_interval)); + taal_queue_esd_work(dssdev); mutex_unlock(&td->lock); return; @@ -1535,8 +1546,7 @@ err: dsi_bus_unlock(); - queue_delayed_work(td->esd_wq, &td->esd_work, - msecs_to_jiffies(td->esd_interval)); + taal_queue_esd_work(dssdev); mutex_unlock(&td->lock); }