Lines Matching +full:lane +full:- +full:count

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
6 #define pr_fmt(fmt) "[drm-dp] %s: " fmt, __func__
55 if (link->revision < 0x11) in dp_aux_link_power_up()
82 if (link->revision < 0x11) in dp_aux_link_power_down()
106 if (drm_dp_dpcd_readb(link->aux, addr, &data) < 0) { in dp_link_get_period()
108 ret = -EINVAL; in dp_link_get_period()
112 /* Period - Bits 3:0 */ in dp_link_get_period()
116 ret = -EINVAL; in dp_link_get_period()
128 struct dp_link_test_audio *req = &link->dp_link.test_audio; in dp_link_parse_audio_channel_period()
131 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
134 req->test_audio_period_ch_1 = ret; in dp_link_parse_audio_channel_period()
135 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_1 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
138 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
141 req->test_audio_period_ch_2 = ret; in dp_link_parse_audio_channel_period()
142 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_2 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
146 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
149 req->test_audio_period_ch_3 = ret; in dp_link_parse_audio_channel_period()
150 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_3 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
153 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
156 req->test_audio_period_ch_4 = ret; in dp_link_parse_audio_channel_period()
157 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_4 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
160 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
163 req->test_audio_period_ch_5 = ret; in dp_link_parse_audio_channel_period()
164 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_5 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
167 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
170 req->test_audio_period_ch_6 = ret; in dp_link_parse_audio_channel_period()
171 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_6 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
174 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
177 req->test_audio_period_ch_7 = ret; in dp_link_parse_audio_channel_period()
178 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_7 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
181 if (ret == -EINVAL) in dp_link_parse_audio_channel_period()
184 req->test_audio_period_ch_8 = ret; in dp_link_parse_audio_channel_period()
185 drm_dbg_dp(link->drm_dev, "test_audio_period_ch_8 = 0x%x\n", ret); in dp_link_parse_audio_channel_period()
197 rlen = drm_dp_dpcd_readb(link->aux, in dp_link_parse_audio_pattern_type()
204 /* Audio Pattern Type - Bits 7:0 */ in dp_link_parse_audio_pattern_type()
207 ret = -EINVAL; in dp_link_parse_audio_pattern_type()
211 link->dp_link.test_audio.test_audio_pattern_type = data; in dp_link_parse_audio_pattern_type()
212 drm_dbg_dp(link->drm_dev, "audio pattern type = 0x%x\n", data); in dp_link_parse_audio_pattern_type()
227 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_AUDIO_MODE, &data); in dp_link_parse_audio_mode()
233 /* Sampling Rate - Bits 3:0 */ in dp_link_parse_audio_mode()
238 ret = -EINVAL; in dp_link_parse_audio_mode()
242 /* Channel Count - Bits 7:4 */ in dp_link_parse_audio_mode()
247 ret = -EINVAL; in dp_link_parse_audio_mode()
251 link->dp_link.test_audio.test_audio_sampling_rate = sampling_rate; in dp_link_parse_audio_mode()
252 link->dp_link.test_audio.test_audio_channel_count = channel_count; in dp_link_parse_audio_mode()
253 drm_dbg_dp(link->drm_dev, in dp_link_parse_audio_mode()
292 * dp_link_is_bit_depth_valid() - validates the bit depth requested
317 return -EINVAL; in dp_link_parse_timing_params1()
320 rlen = drm_dp_dpcd_read(link->aux, addr, bp, len); in dp_link_parse_timing_params1()
323 return -EINVAL; in dp_link_parse_timing_params1()
339 return -EINVAL; in dp_link_parse_timing_params2()
342 rlen = drm_dp_dpcd_read(link->aux, addr, bp, len); in dp_link_parse_timing_params2()
345 return -EINVAL; in dp_link_parse_timing_params2()
361 rlen = drm_dp_dpcd_read(link->aux, addr, &bp, len); in dp_link_parse_timing_params3()
364 return -EINVAL; in dp_link_parse_timing_params3()
372 * dp_link_parse_video_pattern_params() - parses video pattern parameters from DPCD
384 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_PATTERN, &bp); in dp_link_parse_video_pattern_params()
393 ret = -EINVAL; in dp_link_parse_video_pattern_params()
397 link->dp_link.test_video.test_video_pattern = bp; in dp_link_parse_video_pattern_params()
400 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_MISC0, &bp); in dp_link_parse_video_pattern_params()
407 link->dp_link.test_video.test_dyn_range = in dp_link_parse_video_pattern_params()
414 ret = -EINVAL; in dp_link_parse_video_pattern_params()
418 link->dp_link.test_video.test_bit_depth = bp; in dp_link_parse_video_pattern_params()
422 &link->dp_link.test_video.test_h_total); in dp_link_parse_video_pattern_params()
429 &link->dp_link.test_video.test_v_total); in dp_link_parse_video_pattern_params()
436 &link->dp_link.test_video.test_h_start); in dp_link_parse_video_pattern_params()
443 &link->dp_link.test_video.test_v_start); in dp_link_parse_video_pattern_params()
450 &link->dp_link.test_video.test_hsync_pol, in dp_link_parse_video_pattern_params()
451 &link->dp_link.test_video.test_hsync_width); in dp_link_parse_video_pattern_params()
458 &link->dp_link.test_video.test_vsync_pol, in dp_link_parse_video_pattern_params()
459 &link->dp_link.test_video.test_vsync_width); in dp_link_parse_video_pattern_params()
466 &link->dp_link.test_video.test_h_width); in dp_link_parse_video_pattern_params()
473 &link->dp_link.test_video.test_v_height); in dp_link_parse_video_pattern_params()
480 &link->dp_link.test_video.test_rr_d); in dp_link_parse_video_pattern_params()
481 link->dp_link.test_video.test_rr_d &= DP_TEST_REFRESH_DENOMINATOR; in dp_link_parse_video_pattern_params()
488 &link->dp_link.test_video.test_rr_n); in dp_link_parse_video_pattern_params()
494 drm_dbg_dp(link->drm_dev, in dp_link_parse_video_pattern_params()
508 link->dp_link.test_video.test_video_pattern, in dp_link_parse_video_pattern_params()
509 link->dp_link.test_video.test_dyn_range, in dp_link_parse_video_pattern_params()
510 link->dp_link.test_video.test_bit_depth, in dp_link_parse_video_pattern_params()
511 link->dp_link.test_video.test_h_total, in dp_link_parse_video_pattern_params()
512 link->dp_link.test_video.test_v_total, in dp_link_parse_video_pattern_params()
513 link->dp_link.test_video.test_h_start, in dp_link_parse_video_pattern_params()
514 link->dp_link.test_video.test_v_start, in dp_link_parse_video_pattern_params()
515 link->dp_link.test_video.test_hsync_pol, in dp_link_parse_video_pattern_params()
516 link->dp_link.test_video.test_hsync_width, in dp_link_parse_video_pattern_params()
517 link->dp_link.test_video.test_vsync_pol, in dp_link_parse_video_pattern_params()
518 link->dp_link.test_video.test_vsync_width, in dp_link_parse_video_pattern_params()
519 link->dp_link.test_video.test_h_width, in dp_link_parse_video_pattern_params()
520 link->dp_link.test_video.test_v_height, in dp_link_parse_video_pattern_params()
521 link->dp_link.test_video.test_rr_d, in dp_link_parse_video_pattern_params()
522 link->dp_link.test_video.test_rr_n); in dp_link_parse_video_pattern_params()
528 * dp_link_parse_link_training_params() - parses link training parameters from
532 * Returns 0 if it successfully parses the link rate (Byte 0x219) and lane
533 * count (Byte 0x220), and if these values parse are valid.
540 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_LINK_RATE, &bp); in dp_link_parse_link_training_params()
548 return -EINVAL; in dp_link_parse_link_training_params()
551 link->request.test_link_rate = bp; in dp_link_parse_link_training_params()
552 drm_dbg_dp(link->drm_dev, "link rate = 0x%x\n", in dp_link_parse_link_training_params()
553 link->request.test_link_rate); in dp_link_parse_link_training_params()
555 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_LANE_COUNT, &bp); in dp_link_parse_link_training_params()
557 DRM_ERROR("failed to read lane count. rlen=%zd\n", rlen); in dp_link_parse_link_training_params()
563 DRM_ERROR("invalid lane count = 0x%x\n", bp); in dp_link_parse_link_training_params()
564 return -EINVAL; in dp_link_parse_link_training_params()
567 link->request.test_lane_count = bp; in dp_link_parse_link_training_params()
568 drm_dbg_dp(link->drm_dev, "lane count = 0x%x\n", in dp_link_parse_link_training_params()
569 link->request.test_lane_count); in dp_link_parse_link_training_params()
574 * dp_link_parse_phy_test_params() - parses the phy link parameters
585 rlen = drm_dp_dpcd_readb(link->aux, DP_PHY_TEST_PATTERN, in dp_link_parse_phy_test_params()
592 link->dp_link.phy_params.phy_test_pattern_sel = data & 0x07; in dp_link_parse_phy_test_params()
594 drm_dbg_dp(link->drm_dev, "phy_test_pattern_sel = 0x%x\n", data); in dp_link_parse_phy_test_params()
606 return -EINVAL; in dp_link_parse_phy_test_params()
611 * dp_link_is_video_audio_test_requested() - checks for audio/video link request
627 * dp_link_parse_request() - parses link request parameters from sink
643 rlen = drm_dp_dpcd_readb(link->aux, in dp_link_parse_request()
650 drm_dbg_dp(link->drm_dev, "device service irq vector = 0x%x\n", data); in dp_link_parse_request()
653 drm_dbg_dp(link->drm_dev, "no test requested\n"); in dp_link_parse_request()
661 rlen = drm_dp_dpcd_readb(link->aux, DP_TEST_REQUEST, &data); in dp_link_parse_request()
668 drm_dbg_dp(link->drm_dev, "link 0x%x not supported\n", data); in dp_link_parse_request()
672 drm_dbg_dp(link->drm_dev, "Test:(0x%x) requested\n", data); in dp_link_parse_request()
673 link->request.test_requested = data; in dp_link_parse_request()
674 if (link->request.test_requested == DP_TEST_LINK_PHY_TEST_PATTERN) { in dp_link_parse_request()
683 if (link->request.test_requested == DP_TEST_LINK_TRAINING) { in dp_link_parse_request()
690 link->request.test_requested)) { in dp_link_parse_request()
703 link->dp_link.test_response = DP_TEST_NAK; in dp_link_parse_request()
705 if (link->request.test_requested != DP_TEST_LINK_EDID_READ) in dp_link_parse_request()
706 link->dp_link.test_response = DP_TEST_ACK; in dp_link_parse_request()
708 link->dp_link.test_response = in dp_link_parse_request()
719 link->prev_sink_count = link->dp_link.sink_count; in dp_link_parse_sink_status_field()
720 len = drm_dp_read_sink_count(link->aux); in dp_link_parse_sink_status_field()
722 DRM_ERROR("DP parse sink count failed\n"); in dp_link_parse_sink_status_field()
725 link->dp_link.sink_count = len; in dp_link_parse_sink_status_field()
727 len = drm_dp_dpcd_read_link_status(link->aux, in dp_link_parse_sink_status_field()
728 link->link_status); in dp_link_parse_sink_status_field()
738 * dp_link_process_link_training_request() - processes new training requests
742 * the sink. In particular, it will update the requested lane count and link
746 * otherwise it will return -EINVAL.
750 if (link->request.test_requested != DP_TEST_LINK_TRAINING) in dp_link_process_link_training_request()
751 return -EINVAL; in dp_link_process_link_training_request()
753 drm_dbg_dp(link->drm_dev, in dp_link_process_link_training_request()
754 "Test:0x%x link rate = 0x%x, lane count = 0x%x\n", in dp_link_process_link_training_request()
756 link->request.test_link_rate, in dp_link_process_link_training_request()
757 link->request.test_lane_count); in dp_link_process_link_training_request()
759 link->dp_link.link_params.num_lanes = link->request.test_lane_count; in dp_link_process_link_training_request()
760 link->dp_link.link_params.rate = in dp_link_process_link_training_request()
761 drm_dp_bw_code_to_link_rate(link->request.test_link_rate); in dp_link_process_link_training_request()
778 ret = drm_dp_dpcd_writeb(link->aux, DP_TEST_RESPONSE, in dp_link_send_test_response()
779 dp_link->test_response); in dp_link_send_test_response()
792 return -EINVAL; in dp_link_psm_config()
797 mutex_lock(&link->psm_mutex); in dp_link_psm_config()
799 ret = dp_aux_link_power_down(link->aux, link_info); in dp_link_psm_config()
801 ret = dp_aux_link_power_up(link->aux, link_info); in dp_link_psm_config()
807 mutex_unlock(&link->psm_mutex); in dp_link_psm_config()
823 ret = drm_dp_dpcd_writeb(link->aux, DP_TEST_EDID_CHECKSUM, in dp_link_send_edid_checksum()
830 drm_dbg_dp(link->drm_dev, "vx: 0=%d, 1=%d, 2=%d, 3=%d\n", in dp_link_parse_vx_px()
831 drm_dp_get_adjust_request_voltage(link->link_status, 0), in dp_link_parse_vx_px()
832 drm_dp_get_adjust_request_voltage(link->link_status, 1), in dp_link_parse_vx_px()
833 drm_dp_get_adjust_request_voltage(link->link_status, 2), in dp_link_parse_vx_px()
834 drm_dp_get_adjust_request_voltage(link->link_status, 3)); in dp_link_parse_vx_px()
836 drm_dbg_dp(link->drm_dev, "px: 0=%d, 1=%d, 2=%d, 3=%d\n", in dp_link_parse_vx_px()
837 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 0), in dp_link_parse_vx_px()
838 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 1), in dp_link_parse_vx_px()
839 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 2), in dp_link_parse_vx_px()
840 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 3)); in dp_link_parse_vx_px()
843 * Update the voltage and pre-emphasis levels as per DPCD request in dp_link_parse_vx_px()
846 drm_dbg_dp(link->drm_dev, in dp_link_parse_vx_px()
848 link->dp_link.phy_params.v_level, in dp_link_parse_vx_px()
849 link->dp_link.phy_params.p_level); in dp_link_parse_vx_px()
850 link->dp_link.phy_params.v_level = in dp_link_parse_vx_px()
851 drm_dp_get_adjust_request_voltage(link->link_status, 0); in dp_link_parse_vx_px()
852 link->dp_link.phy_params.p_level = in dp_link_parse_vx_px()
853 drm_dp_get_adjust_request_pre_emphasis(link->link_status, 0); in dp_link_parse_vx_px()
855 link->dp_link.phy_params.p_level >>= DP_TRAIN_PRE_EMPHASIS_SHIFT; in dp_link_parse_vx_px()
857 drm_dbg_dp(link->drm_dev, in dp_link_parse_vx_px()
859 link->dp_link.phy_params.v_level, in dp_link_parse_vx_px()
860 link->dp_link.phy_params.p_level); in dp_link_parse_vx_px()
864 * dp_link_process_phy_test_pattern_request() - process new phy link requests
869 * processed, otherwise it will return -EINVAL.
874 if (!(link->request.test_requested & DP_TEST_LINK_PHY_TEST_PATTERN)) { in dp_link_process_phy_test_pattern_request()
875 drm_dbg_dp(link->drm_dev, "no phy test\n"); in dp_link_process_phy_test_pattern_request()
876 return -EINVAL; in dp_link_process_phy_test_pattern_request()
879 if (!is_link_rate_valid(link->request.test_link_rate) || in dp_link_process_phy_test_pattern_request()
880 !is_lane_count_valid(link->request.test_lane_count)) { in dp_link_process_phy_test_pattern_request()
881 DRM_ERROR("Invalid: link rate = 0x%x,lane count = 0x%x\n", in dp_link_process_phy_test_pattern_request()
882 link->request.test_link_rate, in dp_link_process_phy_test_pattern_request()
883 link->request.test_lane_count); in dp_link_process_phy_test_pattern_request()
884 return -EINVAL; in dp_link_process_phy_test_pattern_request()
887 drm_dbg_dp(link->drm_dev, in dp_link_process_phy_test_pattern_request()
888 "Current: rate = 0x%x, lane count = 0x%x\n", in dp_link_process_phy_test_pattern_request()
889 link->dp_link.link_params.rate, in dp_link_process_phy_test_pattern_request()
890 link->dp_link.link_params.num_lanes); in dp_link_process_phy_test_pattern_request()
892 drm_dbg_dp(link->drm_dev, in dp_link_process_phy_test_pattern_request()
893 "Requested: rate = 0x%x, lane count = 0x%x\n", in dp_link_process_phy_test_pattern_request()
894 link->request.test_link_rate, in dp_link_process_phy_test_pattern_request()
895 link->request.test_lane_count); in dp_link_process_phy_test_pattern_request()
897 link->dp_link.link_params.num_lanes = link->request.test_lane_count; in dp_link_process_phy_test_pattern_request()
898 link->dp_link.link_params.rate = in dp_link_process_phy_test_pattern_request()
899 drm_dp_bw_code_to_link_rate(link->request.test_link_rate); in dp_link_process_phy_test_pattern_request()
910 drm_dp_dpcd_read(link->aux, DP_PSR_ERROR_STATUS, &status, 1); in dp_link_read_psr_error_status()
928 drm_dp_dpcd_read(link->aux, DP_PSR_ESI, &status, 1); in dp_link_psr_capability_changed()
931 drm_dbg_dp(link->drm_dev, "PSR Capability Change\n"); in dp_link_psr_capability_changed()
940 return link_status[r - DP_LANE0_1_STATUS]; in get_link_status()
944 * dp_link_process_link_status_update() - processes link status updates
952 * otherwise it will return -EINVAL.
956 bool channel_eq_done = drm_dp_channel_eq_ok(link->link_status, in dp_link_process_link_status_update()
957 link->dp_link.link_params.num_lanes); in dp_link_process_link_status_update()
959 bool clock_recovery_done = drm_dp_clock_recovery_ok(link->link_status, in dp_link_process_link_status_update()
960 link->dp_link.link_params.num_lanes); in dp_link_process_link_status_update()
962 drm_dbg_dp(link->drm_dev, in dp_link_process_link_status_update()
967 return -EINVAL; in dp_link_process_link_status_update()
973 * dp_link_process_ds_port_status_change() - process port status changes
981 * processed, otherwise it will return -EINVAL.
985 if (get_link_status(link->link_status, DP_LANE_ALIGN_STATUS_UPDATED) & in dp_link_process_ds_port_status_change()
989 if (link->prev_sink_count == link->dp_link.sink_count) in dp_link_process_ds_port_status_change()
990 return -EINVAL; in dp_link_process_ds_port_status_change()
994 link->prev_sink_count = link->dp_link.sink_count; in dp_link_process_ds_port_status_change()
1001 return (link->request.test_requested & DP_TEST_LINK_VIDEO_PATTERN) in dp_link_is_video_pattern_requested()
1002 && !(link->request.test_requested & in dp_link_is_video_pattern_requested()
1008 return (link->request.test_requested & DP_TEST_LINK_AUDIO_PATTERN); in dp_link_is_audio_pattern_requested()
1013 link->request = (const struct dp_link_request){ 0 }; in dp_link_reset_data()
1014 link->dp_link.test_video = (const struct dp_link_test_video){ 0 }; in dp_link_reset_data()
1015 link->dp_link.test_video.test_bit_depth = DP_TEST_BIT_DEPTH_UNKNOWN; in dp_link_reset_data()
1016 link->dp_link.test_audio = (const struct dp_link_test_audio){ 0 }; in dp_link_reset_data()
1017 link->dp_link.phy_params.phy_test_pattern_sel = 0; in dp_link_reset_data()
1018 link->dp_link.sink_request = 0; in dp_link_reset_data()
1019 link->dp_link.test_response = 0; in dp_link_reset_data()
1023 * dp_link_process_request() - handle HPD IRQ transition to HIGH
1037 return -EINVAL; in dp_link_process_request()
1048 if (link->request.test_requested == DP_TEST_LINK_EDID_READ) { in dp_link_process_request()
1049 dp_link->sink_request |= DP_TEST_LINK_EDID_READ; in dp_link_process_request()
1051 dp_link->sink_request |= DS_PORT_STATUS_CHANGED; in dp_link_process_request()
1053 dp_link->sink_request |= DP_TEST_LINK_TRAINING; in dp_link_process_request()
1055 dp_link->sink_request |= DP_TEST_LINK_PHY_TEST_PATTERN; in dp_link_process_request()
1059 drm_dbg_dp(link->drm_dev, "PSR Capability changed\n"); in dp_link_process_request()
1063 dp_link->sink_request |= DP_LINK_STATUS_UPDATED; in dp_link_process_request()
1067 dp_link->sink_request |= DP_TEST_LINK_VIDEO_PATTERN; in dp_link_process_request()
1070 dp_link->sink_request |= DP_TEST_LINK_AUDIO_PATTERN; in dp_link_process_request()
1071 ret = -EINVAL; in dp_link_process_request()
1076 drm_dbg_dp(link->drm_dev, "sink request=%#x\n", in dp_link_process_request()
1077 dp_link->sink_request); in dp_link_process_request()
1088 return -EINVAL; in dp_link_get_colorimetry_config()
1098 if (link->dp_link.test_video.test_dyn_range & in dp_link_get_colorimetry_config()
1115 return -EINVAL; in dp_link_adjust_levels()
1121 for (i = 0; i < dp_link->link_params.num_lanes; i++) { in dp_link_adjust_levels()
1125 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1126 "lane=%d req_vol_swing=%d req_pre_emphasis=%d\n", in dp_link_adjust_levels()
1134 dp_link->phy_params.v_level = v_max >> DP_TRAIN_VOLTAGE_SWING_SHIFT; in dp_link_adjust_levels()
1135 dp_link->phy_params.p_level = p_max >> DP_TRAIN_PRE_EMPHASIS_SHIFT; in dp_link_adjust_levels()
1138 * Adjust the voltage swing and pre-emphasis level combination to within in dp_link_adjust_levels()
1141 if (dp_link->phy_params.v_level > DP_TRAIN_LEVEL_MAX) { in dp_link_adjust_levels()
1142 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1144 dp_link->phy_params.v_level, in dp_link_adjust_levels()
1146 dp_link->phy_params.v_level = DP_TRAIN_LEVEL_MAX; in dp_link_adjust_levels()
1149 if (dp_link->phy_params.p_level > DP_TRAIN_LEVEL_MAX) { in dp_link_adjust_levels()
1150 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1152 dp_link->phy_params.p_level, in dp_link_adjust_levels()
1154 dp_link->phy_params.p_level = DP_TRAIN_LEVEL_MAX; in dp_link_adjust_levels()
1157 max_p_level = DP_TRAIN_LEVEL_MAX - dp_link->phy_params.v_level; in dp_link_adjust_levels()
1158 if (dp_link->phy_params.p_level > max_p_level) { in dp_link_adjust_levels()
1159 drm_dbg_dp(link->drm_dev, in dp_link_adjust_levels()
1161 dp_link->phy_params.p_level, in dp_link_adjust_levels()
1163 dp_link->phy_params.p_level = max_p_level; in dp_link_adjust_levels()
1166 drm_dbg_dp(link->drm_dev, "adjusted: v_level=%d, p_level=%d\n", in dp_link_adjust_levels()
1167 dp_link->phy_params.v_level, dp_link->phy_params.p_level); in dp_link_adjust_levels()
1174 dp_link->phy_params.v_level = 0; in dp_link_reset_phy_params_vx_px()
1175 dp_link->phy_params.p_level = 0; in dp_link_reset_phy_params_vx_px()
1201 drm_dbg_dp(link->drm_dev, "bpp=%d not supported, use bpc=8\n", in dp_link_get_test_bits_depth()
1219 return ERR_PTR(-EINVAL); in dp_link_get()
1224 return ERR_PTR(-ENOMEM); in dp_link_get()
1226 link->aux = aux; in dp_link_get()
1228 mutex_init(&link->psm_mutex); in dp_link_get()
1229 dp_link = &link->dp_link; in dp_link_get()