mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
drm/rockchip/rk618: hdmi: check hpd before set power mode
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> Change-Id: If7d8365009576fcf5ce2df833efdf5b7d138b5e7
This commit is contained in:
@@ -935,18 +935,20 @@ static int rk618_hdmi_setup(struct rk618_hdmi *hdmi,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool rk618_hdmi_hpd_detect(struct rk618_hdmi *hdmi)
|
||||
{
|
||||
return !!(hdmi_readb(hdmi, HDMI_STATUS) & m_HOTPLUG);
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
rk618_hdmi_connector_detect(struct drm_connector *connector, bool force)
|
||||
{
|
||||
struct rk618_hdmi *hdmi = connector_to_hdmi(connector);
|
||||
int status;
|
||||
bool status;
|
||||
|
||||
status = hdmi_readb(hdmi, HDMI_STATUS) & m_HOTPLUG;
|
||||
status = rk618_hdmi_hpd_detect(hdmi);
|
||||
#ifdef CONFIG_SWITCH
|
||||
if (status)
|
||||
switch_set_state(&hdmi->switchdev, 1);
|
||||
else
|
||||
switch_set_state(&hdmi->switchdev, 0);
|
||||
switch_set_state(&hdmi->switchdev, status);
|
||||
#endif
|
||||
|
||||
return status ? connector_status_connected :
|
||||
@@ -963,7 +965,7 @@ static int rk618_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
if (!hdmi->ddc)
|
||||
return 0;
|
||||
|
||||
if ((hdmi_readb(hdmi, HDMI_STATUS) & m_HOTPLUG))
|
||||
if (rk618_hdmi_hpd_detect(hdmi))
|
||||
edid = drm_get_edid(connector, hdmi->ddc);
|
||||
|
||||
if (edid) {
|
||||
@@ -1044,6 +1046,11 @@ static void rk618_hdmi_bridge_enable(struct drm_bridge *bridge)
|
||||
|
||||
clk_prepare_enable(hdmi->clock);
|
||||
|
||||
if (!rk618_hdmi_hpd_detect(hdmi)) {
|
||||
rk618_hdmi_set_pwr_mode(hdmi, LOWER_PWR);
|
||||
return;
|
||||
}
|
||||
|
||||
rk618_hdmi_setup(hdmi, &hdmi->previous_mode);
|
||||
rk618_hdmi_set_polarity(hdmi, hdmi->hdmi_data.vic);
|
||||
rk618_hdmi_set_pwr_mode(hdmi, NORMAL);
|
||||
|
||||
Reference in New Issue
Block a user