mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
drm/rockchip: dw-dp: Check hpd status before power down link
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> Change-Id: I3a05b3520d71ef5f0429a2c33933db62f3a2fffc
This commit is contained in:
@@ -419,6 +419,18 @@ static bool dw_dp_bandwidth_ok(struct dw_dp *dp,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool dw_dp_detect(struct dw_dp *dp)
|
||||
{
|
||||
u32 value;
|
||||
|
||||
if (dp->hpd_gpio)
|
||||
return gpiod_get_value_cansleep(dp->hpd_gpio);
|
||||
|
||||
regmap_read(dp->regmap, DPTX_HPD_STATUS, &value);
|
||||
|
||||
return !!(value & HPD_STATUS);
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
dw_dp_connector_detect(struct drm_connector *connector, bool force)
|
||||
{
|
||||
@@ -1707,7 +1719,8 @@ static bool dw_dp_needs_link_retrain(struct dw_dp *dp)
|
||||
|
||||
static void dw_dp_link_disable(struct dw_dp *dp)
|
||||
{
|
||||
dw_dp_link_power_down(dp);
|
||||
if (dw_dp_detect(dp))
|
||||
dw_dp_link_power_down(dp);
|
||||
|
||||
dw_dp_phy_xmit_enable(dp, 0);
|
||||
|
||||
@@ -1776,18 +1789,6 @@ static void dw_dp_bridge_atomic_disable(struct drm_bridge *bridge,
|
||||
video->stream_on = false;
|
||||
}
|
||||
|
||||
static bool dw_dp_detect(struct dw_dp *dp)
|
||||
{
|
||||
u32 value;
|
||||
|
||||
if (dp->hpd_gpio)
|
||||
return gpiod_get_value_cansleep(dp->hpd_gpio);
|
||||
|
||||
regmap_read(dp->regmap, DPTX_HPD_STATUS, &value);
|
||||
|
||||
return !!(value & HPD_STATUS);
|
||||
}
|
||||
|
||||
static enum drm_connector_status dw_dp_bridge_detect(struct drm_bridge *bridge)
|
||||
{
|
||||
struct dw_dp *dp = bridge_to_dp(bridge);
|
||||
|
||||
Reference in New Issue
Block a user