From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joonyoung Shim Subject: [PATCH 3/5] drm/exynos: use threaded irq for hdmi hotplug Date: Mon, 23 Apr 2012 19:35:49 +0900 Message-ID: <1335177351-11358-4-git-send-email-jy0922.shim@samsung.com> References: <1335177351-11358-1-git-send-email-jy0922.shim@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id D7E129F659 for ; Mon, 23 Apr 2012 03:36:23 -0700 (PDT) Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M2X008WCHERFVR0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 23 Apr 2012 19:35:47 +0900 (KST) Received: from localhost.localdomain ([165.213.219.123]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M2X00MJQHFM3L90@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 23 Apr 2012 19:35:46 +0900 (KST) In-reply-to: <1335177351-11358-1-git-send-email-jy0922.shim@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: inki.dae@samsung.com, kyungmin.park@samsung.com List-Id: dri-devel@lists.freedesktop.org We can use irq thread instead of workqueue Signed-off-by: Joonyoung Shim Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_hdmi.c | 40 ++++----------------------------- 1 files changed, 5 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index e6a5e00..5b04af1 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -64,8 +64,6 @@ struct hdmi_context { struct resource *regs_res; void __iomem *regs; unsigned int irq; - struct workqueue_struct *wq; - struct work_struct hotplug_work; struct i2c_client *ddc_port; struct i2c_client *hdmiphy_port; @@ -2003,20 +2001,7 @@ static struct exynos_hdmi_ops hdmi_ops = { .disable = hdmi_disable, }; -/* - * Handle hotplug events outside the interrupt handler proper. - */ -static void hdmi_hotplug_func(struct work_struct *work) -{ - struct hdmi_context *hdata = - container_of(work, struct hdmi_context, hotplug_work); - struct exynos_drm_hdmi_context *ctx = - (struct exynos_drm_hdmi_context *)hdata->parent_ctx; - - drm_helper_hpd_irq_event(ctx->drm_dev); -} - -static irqreturn_t hdmi_irq_handler(int irq, void *arg) +static irqreturn_t hdmi_irq_thread(int irq, void *arg) { struct exynos_drm_hdmi_context *ctx = arg; struct hdmi_context *hdata = ctx->ctx; @@ -2036,7 +2021,7 @@ static irqreturn_t hdmi_irq_handler(int irq, void *arg) } if (ctx->drm_dev && hdata->hpd_handle) - queue_work(hdata->wq, &hdata->hotplug_work); + drm_helper_hpd_irq_event(ctx->drm_dev); return IRQ_HANDLED; } @@ -2300,22 +2285,12 @@ static int __devinit hdmi_probe(struct platform_device *pdev) goto err_hdmiphy; } - /* create workqueue and hotplug work */ - hdata->wq = alloc_workqueue("exynos-drm-hdmi", - WQ_UNBOUND | WQ_NON_REENTRANT, 1); - if (hdata->wq == NULL) { - DRM_ERROR("Failed to create workqueue.\n"); - ret = -ENOMEM; - goto err_hdmiphy; - } - INIT_WORK(&hdata->hotplug_work, hdmi_hotplug_func); - /* register hpd interrupt */ - ret = request_irq(hdata->irq, hdmi_irq_handler, 0, "drm_hdmi", - drm_hdmi_ctx); + ret = request_threaded_irq(hdata->irq, NULL, hdmi_irq_thread, + IRQF_ONESHOT, "drm_hdmi", drm_hdmi_ctx); if (ret) { DRM_ERROR("request interrupt failed.\n"); - goto err_workqueue; + goto err_hdmiphy; } /* register specific callbacks to common hdmi. */ @@ -2325,8 +2300,6 @@ static int __devinit hdmi_probe(struct platform_device *pdev) return 0; -err_workqueue: - destroy_workqueue(hdata->wq); err_hdmiphy: i2c_del_driver(&hdmiphy_driver); err_ddc: @@ -2356,9 +2329,6 @@ static int __devexit hdmi_remove(struct platform_device *pdev) disable_irq(hdata->irq); free_irq(hdata->irq, hdata); - cancel_work_sync(&hdata->hotplug_work); - destroy_workqueue(hdata->wq); - hdmi_resources_cleanup(hdata); iounmap(hdata->regs); -- 1.7.5.4