diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2012-04-23 06:35:49 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-05-08 05:46:32 -0400 |
commit | 66265a2e8e867a9c5ce63e5f883cf751b35b66d5 (patch) | |
tree | 87f66e177cebef39844231801f37efd15dba04c5 /drivers | |
parent | ce80a2d1890063ff2d3b5beb6edac85a2f6c86c4 (diff) |
drm/exynos: use threaded irq for hdmi hotplug
We can use irq thread instead of workqueue
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 e6a5e0035609..5b04af145fa7 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -64,8 +64,6 @@ struct hdmi_context { | |||
64 | struct resource *regs_res; | 64 | struct resource *regs_res; |
65 | void __iomem *regs; | 65 | void __iomem *regs; |
66 | unsigned int irq; | 66 | unsigned int irq; |
67 | struct workqueue_struct *wq; | ||
68 | struct work_struct hotplug_work; | ||
69 | 67 | ||
70 | struct i2c_client *ddc_port; | 68 | struct i2c_client *ddc_port; |
71 | struct i2c_client *hdmiphy_port; | 69 | struct i2c_client *hdmiphy_port; |
@@ -2003,20 +2001,7 @@ static struct exynos_hdmi_ops hdmi_ops = { | |||
2003 | .disable = hdmi_disable, | 2001 | .disable = hdmi_disable, |
2004 | }; | 2002 | }; |
2005 | 2003 | ||
2006 | /* | 2004 | static irqreturn_t hdmi_irq_thread(int irq, void *arg) |
2007 | * Handle hotplug events outside the interrupt handler proper. | ||
2008 | */ | ||
2009 | static void hdmi_hotplug_func(struct work_struct *work) | ||
2010 | { | ||
2011 | struct hdmi_context *hdata = | ||
2012 | container_of(work, struct hdmi_context, hotplug_work); | ||
2013 | struct exynos_drm_hdmi_context *ctx = | ||
2014 | (struct exynos_drm_hdmi_context *)hdata->parent_ctx; | ||
2015 | |||
2016 | drm_helper_hpd_irq_event(ctx->drm_dev); | ||
2017 | } | ||
2018 | |||
2019 | static irqreturn_t hdmi_irq_handler(int irq, void *arg) | ||
2020 | { | 2005 | { |
2021 | struct exynos_drm_hdmi_context *ctx = arg; | 2006 | struct exynos_drm_hdmi_context *ctx = arg; |
2022 | struct hdmi_context *hdata = ctx->ctx; | 2007 | struct hdmi_context *hdata = ctx->ctx; |
@@ -2036,7 +2021,7 @@ static irqreturn_t hdmi_irq_handler(int irq, void *arg) | |||
2036 | } | 2021 | } |
2037 | 2022 | ||
2038 | if (ctx->drm_dev && hdata->hpd_handle) | 2023 | if (ctx->drm_dev && hdata->hpd_handle) |
2039 | queue_work(hdata->wq, &hdata->hotplug_work); | 2024 | drm_helper_hpd_irq_event(ctx->drm_dev); |
2040 | 2025 | ||
2041 | return IRQ_HANDLED; | 2026 | return IRQ_HANDLED; |
2042 | } | 2027 | } |
@@ -2300,22 +2285,12 @@ static int __devinit hdmi_probe(struct platform_device *pdev) | |||
2300 | goto err_hdmiphy; | 2285 | goto err_hdmiphy; |
2301 | } | 2286 | } |
2302 | 2287 | ||
2303 | /* create workqueue and hotplug work */ | ||
2304 | hdata->wq = alloc_workqueue("exynos-drm-hdmi", | ||
2305 | WQ_UNBOUND | WQ_NON_REENTRANT, 1); | ||
2306 | if (hdata->wq == NULL) { | ||
2307 | DRM_ERROR("Failed to create workqueue.\n"); | ||
2308 | ret = -ENOMEM; | ||
2309 | goto err_hdmiphy; | ||
2310 | } | ||
2311 | INIT_WORK(&hdata->hotplug_work, hdmi_hotplug_func); | ||
2312 | |||
2313 | /* register hpd interrupt */ | 2288 | /* register hpd interrupt */ |
2314 | ret = request_irq(hdata->irq, hdmi_irq_handler, 0, "drm_hdmi", | 2289 | ret = request_threaded_irq(hdata->irq, NULL, hdmi_irq_thread, |
2315 | drm_hdmi_ctx); | 2290 | IRQF_ONESHOT, "drm_hdmi", drm_hdmi_ctx); |
2316 | if (ret) { | 2291 | if (ret) { |
2317 | DRM_ERROR("request interrupt failed.\n"); | 2292 | DRM_ERROR("request interrupt failed.\n"); |
2318 | goto err_workqueue; | 2293 | goto err_hdmiphy; |
2319 | } | 2294 | } |
2320 | 2295 | ||
2321 | /* register specific callbacks to common hdmi. */ | 2296 | /* register specific callbacks to common hdmi. */ |
@@ -2325,8 +2300,6 @@ static int __devinit hdmi_probe(struct platform_device *pdev) | |||
2325 | 2300 | ||
2326 | return 0; | 2301 | return 0; |
2327 | 2302 | ||
2328 | err_workqueue: | ||
2329 | destroy_workqueue(hdata->wq); | ||
2330 | err_hdmiphy: | 2303 | err_hdmiphy: |
2331 | i2c_del_driver(&hdmiphy_driver); | 2304 | i2c_del_driver(&hdmiphy_driver); |
2332 | err_ddc: | 2305 | err_ddc: |
@@ -2356,9 +2329,6 @@ static int __devexit hdmi_remove(struct platform_device *pdev) | |||
2356 | disable_irq(hdata->irq); | 2329 | disable_irq(hdata->irq); |
2357 | free_irq(hdata->irq, hdata); | 2330 | free_irq(hdata->irq, hdata); |
2358 | 2331 | ||
2359 | cancel_work_sync(&hdata->hotplug_work); | ||
2360 | destroy_workqueue(hdata->wq); | ||
2361 | |||
2362 | hdmi_resources_cleanup(hdata); | 2332 | hdmi_resources_cleanup(hdata); |
2363 | 2333 | ||
2364 | iounmap(hdata->regs); | 2334 | iounmap(hdata->regs); |