Skip to content

Commit ba8d4f2

Browse files
jannaumarcan
authored andcommitted
drm: apple: Fix DPTX hotplug handling
- Do not trigger an hotplug event from disconnect. DCP/iomfb notices that itself. - Check HPD status before disconnecting DPTX in the crtc disable path. - disconnect on suspend to allow an orderly re-connect on resume Signed-off-by: Janne Grunau <[email protected]>
1 parent 128a7d4 commit ba8d4f2

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

  • drivers/gpu/drm/apple

drivers/gpu/drm/apple/dcp.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,9 @@ static int dcp_dptx_connect(struct apple_dcp *dcp, u32 port)
293293

294294
static int dcp_dptx_disconnect(struct apple_dcp *dcp, u32 port)
295295
{
296-
struct apple_connector *connector = dcp->connector;
297296
dev_info(dcp->dev, "%s(port=%d)\n", __func__, port);
298297

299298
mutex_lock(&dcp->hpd_mutex);
300-
301-
if (connector && connector->connected) {
302-
dcp->valid_mode = false;
303-
schedule_work(&connector->hotplug_wq);
304-
}
305-
306299
if (dcp->dptxport[port].enabled && dcp->dptxport[port].connected) {
307300
dptxport_release_display(dcp->dptxport[port].service);
308301
dcp->dptxport[port].connected = false;
@@ -480,9 +473,11 @@ void dcp_poweroff(struct platform_device *pdev)
480473
break;
481474
}
482475

483-
if (dcp->phy)
484-
dcp_dptx_disconnect(dcp, 0);
485-
476+
if (dcp->hdmi_hpd) {
477+
bool connected = gpiod_get_value_cansleep(dcp->hdmi_hpd);
478+
if (!connected)
479+
dcp_dptx_disconnect(dcp, 0);
480+
}
486481
}
487482
EXPORT_SYMBOL(dcp_poweroff);
488483

@@ -1021,8 +1016,10 @@ static int dcp_platform_suspend(struct device *dev)
10211016
{
10221017
struct apple_dcp *dcp = dev_get_drvdata(dev);
10231018

1024-
if (dcp->hdmi_hpd_irq)
1019+
if (dcp->hdmi_hpd_irq) {
10251020
disable_irq(dcp->hdmi_hpd_irq);
1021+
dcp_dptx_disconnect(dcp, 0);
1022+
}
10261023
/*
10271024
* Set the device as a wakeup device, which forces its power
10281025
* domains to stay on. We need this as we do not support full

0 commit comments

Comments
 (0)