Skip to content

Commit 52ac749

Browse files
Andy Yanmmind
authored andcommitted
drm/rockchip: inno_hdmi: Move ddc/i2c configuration and HOTPLUG unmute to inno_hdmi_init_hw
Putting these scattered initialization code together is helpful for the following migration to the DRM bridge driver mode. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250512124615.2848731-6-andyshrk@163.com
1 parent 5513748 commit 52ac749

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

drivers/gpu/drm/rockchip/inno_hdmi.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,21 @@ static void inno_hdmi_init_hw(struct inno_hdmi *hdmi)
620620
hdmi_modb(hdmi, HDMI_SYS_CTRL, msk, val);
621621

622622
inno_hdmi_standby(hdmi);
623+
624+
/*
625+
* When the controller isn't configured to an accurate
626+
* video timing and there is no reference clock available,
627+
* then the TMDS clock source would be switched to PCLK_HDMI,
628+
* so we need to init the TMDS rate to PCLK rate, and
629+
* reconfigure the DDC clock.
630+
*/
631+
if (hdmi->refclk)
632+
inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->refclk));
633+
else
634+
inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk));
635+
636+
/* Unmute hotplug interrupt */
637+
hdmi_modb(hdmi, HDMI_STATUS, m_MASK_INT_HOTPLUG, v_MASK_INT_HOTPLUG(1));
623638
}
624639

625640
static int inno_hdmi_disable_frame(struct drm_connector *connector,
@@ -1299,27 +1314,12 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
12991314
goto err_disable_clk;
13001315
}
13011316

1302-
/*
1303-
* When the controller isn't configured to an accurate
1304-
* video timing and there is no reference clock available,
1305-
* then the TMDS clock source would be switched to PCLK_HDMI,
1306-
* so we need to init the TMDS rate to PCLK rate, and
1307-
* reconfigure the DDC clock.
1308-
*/
1309-
if (hdmi->refclk)
1310-
inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->refclk));
1311-
else
1312-
inno_hdmi_i2c_init(hdmi, clk_get_rate(hdmi->pclk));
1313-
13141317
ret = inno_hdmi_register(drm, hdmi);
13151318
if (ret)
13161319
goto err_put_adapter;
13171320

13181321
dev_set_drvdata(dev, hdmi);
13191322

1320-
/* Unmute hotplug interrupt */
1321-
hdmi_modb(hdmi, HDMI_STATUS, m_MASK_INT_HOTPLUG, v_MASK_INT_HOTPLUG(1));
1322-
13231323
ret = devm_request_threaded_irq(dev, irq, inno_hdmi_hardirq,
13241324
inno_hdmi_irq, IRQF_SHARED,
13251325
dev_name(dev), hdmi);

0 commit comments

Comments
 (0)