@@ -128,49 +128,13 @@ intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable)
128
128
return drm_dp_dpcd_write (& intel_dp -> aux , DP_PHY_REPEATER_MODE , & val , 1 ) == 1 ;
129
129
}
130
130
131
- /**
132
- * intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode
133
- * @intel_dp: Intel DP struct
134
- *
135
- * Read the LTTPR common and DPRX capabilities and switch to non-transparent
136
- * link training mode if any is detected and read the PHY capabilities for all
137
- * detected LTTPRs. In case of an LTTPR detection error or if the number of
138
- * LTTPRs is more than is supported (8), fall back to the no-LTTPR,
139
- * transparent mode link training mode.
140
- *
141
- * Returns:
142
- * >0 if LTTPRs were detected and the non-transparent LT mode was set. The
143
- * DPRX capabilities are read out.
144
- * 0 if no LTTPRs or more than 8 LTTPRs were detected or in case of a
145
- * detection failure and the transparent LT mode was set. The DPRX
146
- * capabilities are read out.
147
- * <0 Reading out the DPRX capabilities failed.
148
- */
149
- int intel_dp_init_lttpr_and_dprx_caps (struct intel_dp * intel_dp )
131
+ static int intel_dp_init_lttpr (struct intel_dp * intel_dp )
150
132
{
151
133
int lttpr_count ;
152
- bool ret ;
153
134
int i ;
154
135
155
- ret = intel_dp_read_lttpr_common_caps (intel_dp );
156
-
157
- /* The DPTX shall read the DPRX caps after LTTPR detection. */
158
- if (drm_dp_read_dpcd_caps (& intel_dp -> aux , intel_dp -> dpcd )) {
159
- intel_dp_reset_lttpr_common_caps (intel_dp );
160
- return - EIO ;
161
- }
162
-
163
- if (!ret )
164
- return 0 ;
165
-
166
- /*
167
- * The 0xF0000-0xF02FF range is only valid if the DPCD revision is
168
- * at least 1.4.
169
- */
170
- if (intel_dp -> dpcd [DP_DPCD_REV ] < 0x14 ) {
171
- intel_dp_reset_lttpr_common_caps (intel_dp );
136
+ if (!intel_dp_read_lttpr_common_caps (intel_dp ))
172
137
return 0 ;
173
- }
174
138
175
139
lttpr_count = drm_dp_lttpr_count (intel_dp -> lttpr_common_caps );
176
140
/*
@@ -211,6 +175,37 @@ int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
211
175
212
176
return lttpr_count ;
213
177
}
178
+
179
+ /**
180
+ * intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode
181
+ * @intel_dp: Intel DP struct
182
+ *
183
+ * Read the LTTPR common and DPRX capabilities and switch to non-transparent
184
+ * link training mode if any is detected and read the PHY capabilities for all
185
+ * detected LTTPRs. In case of an LTTPR detection error or if the number of
186
+ * LTTPRs is more than is supported (8), fall back to the no-LTTPR,
187
+ * transparent mode link training mode.
188
+ *
189
+ * Returns:
190
+ * >0 if LTTPRs were detected and the non-transparent LT mode was set. The
191
+ * DPRX capabilities are read out.
192
+ * 0 if no LTTPRs or more than 8 LTTPRs were detected or in case of a
193
+ * detection failure and the transparent LT mode was set. The DPRX
194
+ * capabilities are read out.
195
+ * <0 Reading out the DPRX capabilities failed.
196
+ */
197
+ int intel_dp_init_lttpr_and_dprx_caps (struct intel_dp * intel_dp )
198
+ {
199
+ int lttpr_count = intel_dp_init_lttpr (intel_dp );
200
+
201
+ /* The DPTX shall read the DPRX caps after LTTPR detection. */
202
+ if (drm_dp_read_dpcd_caps (& intel_dp -> aux , intel_dp -> dpcd )) {
203
+ intel_dp_reset_lttpr_common_caps (intel_dp );
204
+ return - EIO ;
205
+ }
206
+
207
+ return lttpr_count ;
208
+ }
214
209
EXPORT_SYMBOL (intel_dp_init_lttpr_and_dprx_caps );
215
210
216
211
static u8 dp_voltage_max (u8 preemph )
0 commit comments