浏览代码

drm/bridge: cdns-mhdp: Use threaded IRQ instead of delayed_work

Drop delayed work used for HPD IRQ handling and use threaded IRQ instead.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Jyri Sarha 6 年之前
父节点
当前提交
262240391b
共有 2 个文件被更改,包括 3 次插入17 次删除
  1. 3 15
      drivers/gpu/drm/bridge/cdns-mhdp.c
  2. 0 2
      include/drm/bridge/cdns-mhdp-common.h

+ 3 - 15
drivers/gpu/drm/bridge/cdns-mhdp.c

@@ -105,15 +105,6 @@ static u8 eq_training_pattern_supported(struct cdns_mhdp_host host,
 	return fls(host.pattern_supp & sink.pattern_supp);
 }
 
-static void mhdp_hotplug_work_func(struct work_struct *work)
-{
-	struct cdns_mhdp_device *mhdp;
-
-	mhdp = container_of(work, struct cdns_mhdp_device,
-			    hotplug_work.work);
-	drm_kms_helper_hotplug_event(mhdp->bridge.base.dev);
-}
-
 static irqreturn_t mhdp_irq_handler(int irq, void *data)
 {
 	struct cdns_mhdp_device *mhdp = (struct cdns_mhdp_device *)data;
@@ -129,7 +120,7 @@ static irqreturn_t mhdp_irq_handler(int irq, void *data)
 	//dev_dbg(mhdp->dev, "MHDP IRQ apb %x, mbox %x, sw_ev %x/%x/%x/%x\n", apb_stat, mbox_stat, sw_ev0, sw_ev1, sw_ev2, sw_ev3);
 
 	if (sw_ev0 & CDNS_DPTX_HPD)
-		schedule_delayed_work(&mhdp->hotplug_work, 0);
+		drm_kms_helper_hotplug_event(mhdp->bridge.base.dev);
 
 	return IRQ_HANDLED;
 }
@@ -1321,8 +1312,8 @@ static int mhdp_probe(struct platform_device *pdev)
 	writel(~0, mhdp->regs + CDNS_APB_INT_MASK);
 
 	irq = platform_get_irq(pdev, 0);
-	ret = devm_request_irq(mhdp->dev, irq, mhdp_irq_handler, 0,
-			       "mhdp8546", mhdp);
+	ret = devm_request_threaded_irq(mhdp->dev, irq, NULL, mhdp_irq_handler,
+					IRQF_ONESHOT, "mhdp8546", mhdp);
 	if (ret) {
 		dev_err(&pdev->dev,
 			"cannot install IRQ %d\n", irq);
@@ -1403,8 +1394,6 @@ static int mhdp_probe(struct platform_device *pdev)
 	cdns_mhdp_reg_write(mhdp, CDNS_DPTX_CAR,
 			    resp | CDNS_VIF_CLK_EN | CDNS_VIF_CLK_RSTN);
 
-	INIT_DELAYED_WORK(&mhdp->hotplug_work, mhdp_hotplug_work_func);
-
 	mhdp->bridge.connector = &mhdp->connector;
 	mhdp->connector.bridge = &mhdp->bridge;
 	mhdp->bridge.mhdp = mhdp;
@@ -1422,7 +1411,6 @@ static int mhdp_remove(struct platform_device *pdev)
 	struct cdns_mhdp_device *mhdp = dev_get_drvdata(&pdev->dev);
 	int ret;
 
-	flush_delayed_work(&mhdp->hotplug_work);
 	platform_device_unregister(mhdp->audio_pdev);
 
 	drm_bridge_remove(&mhdp->bridge.base);

+ 0 - 2
include/drm/bridge/cdns-mhdp-common.h

@@ -564,8 +564,6 @@ struct cdns_mhdp_device {
 	struct drm_display_mode	mode;
 	unsigned int		fw_version;
 
-	struct delayed_work hotplug_work;
-
 	bool link_up;
 	bool plugged;