diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2014-03-17 23:48:15 -0400 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2014-03-25 13:13:15 +0100 |
commit | 2953da1589477c9aec85431339d28a8303d47945 (patch) | |
tree | f1831e2b0c33bcb2493ddca468b0912a4d7fa62f /drivers/gpu/drm/radeon/atombios_dp.c | |
parent | f3381dfc9745bcd8b6be676ec4f68c52e71d24f1 (diff) | |
download | lwn-2953da1589477c9aec85431339d28a8303d47945.tar.gz lwn-2953da1589477c9aec85431339d28a8303d47945.zip |
drm/radeon/dp: move sink power control to a separate function
This will be used elsewhere.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_dp.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_dp.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index c79ba8a886bd..88d399c3f4fd 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c @@ -603,6 +603,26 @@ bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector) return true; } +void radeon_dp_set_rx_power_state(struct drm_connector *connector, + u8 power_state) +{ + struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *dig_connector; + + if (!radeon_connector->con_priv) + return; + + dig_connector = radeon_connector->con_priv; + + /* power up/down the sink */ + if (dig_connector->dpcd[0] >= 0x11) { + radeon_write_dpcd_reg(radeon_connector, + DP_SET_POWER, power_state); + usleep_range(1000, 2000); + } +} + + struct radeon_dp_link_train_info { struct radeon_device *rdev; struct drm_encoder *encoder; @@ -673,11 +693,7 @@ static int radeon_dp_link_train_init(struct radeon_dp_link_train_info *dp_info) u8 tmp; /* power up the sink */ - if (dp_info->dpcd[0] >= 0x11) { - radeon_write_dpcd_reg(dp_info->radeon_connector, - DP_SET_POWER, DP_SET_POWER_D0); - usleep_range(1000, 2000); - } + radeon_dp_set_rx_power_state(dp_info->connector, DP_SET_POWER_D0); /* possibly enable downspread on the sink */ if (dp_info->dpcd[3] & 0x1) |