@@ -165,6 +165,33 @@ static const struct qcom_edp_swing_pre_emph_cfg dp_phy_swing_pre_emph_cfg_v8 = {
165165 .pre_emphasis_hbr3_hbr2 = & dp_pre_emp_hbr2_hbr3 ,
166166};
167167
168+ static const u8 dp_swing_hbr2_hbr3_v2 [4 ][4 ] = {
169+ { 0x27 , 0x2f , 0x36 , 0xff },
170+ { 0x31 , 0x3e , 0x3f , 0xff },
171+ { 0x3a , 0x3f , 0xff , 0xff },
172+ { 0xff , 0xff , 0xff , 0xff }
173+ };
174+
175+ static const u8 dp_pre_emp_hbr2_hbr3_v2 [4 ][4 ] = {
176+ { 0x20 , 0x2e , 0x35 , 0xff },
177+ { 0x20 , 0x2e , 0x35 , 0xff },
178+ { 0x20 , 0x2e , 0xff , 0xff },
179+ { 0xff , 0xff , 0xff , 0xff }
180+ };
181+
182+ static const struct qcom_edp_swing_pre_emph_cfg dp_phy_swing_pre_emph_cfg_v2 = {
183+ /*
184+ * NOTE: The HPG does not specify a separate swing_hbr_rbr table.
185+ * Reuse the HBR2/HBR3 table for now.
186+ *
187+ * TODO: Update this once the HPG explicitly defines RBR/HBR swing values.
188+ */
189+ .swing_hbr_rbr = & dp_swing_hbr2_hbr3_v2 ,
190+ .swing_hbr3_hbr2 = & dp_swing_hbr2_hbr3_v2 ,
191+ .pre_emphasis_hbr_rbr = & dp_pre_emp_hbr2_hbr3_v2 ,
192+ .pre_emphasis_hbr3_hbr2 = & dp_pre_emp_hbr2_hbr3_v2 ,
193+ };
194+
168195static const u8 edp_swing_hbr_rbr [4 ][4 ] = {
169196 { 0x07 , 0x0f , 0x16 , 0x1f },
170197 { 0x0d , 0x16 , 0x1e , 0xff },
@@ -208,6 +235,48 @@ static const u8 edp_phy_vco_div_cfg_v4[4] = {
208235 0x01 , 0x01 , 0x02 , 0x00 ,
209236};
210237
238+ static const u8 edp_pre_emp_hbr_rbr_v2 [4 ][4 ] = {
239+ { 0x05 , 0x12 , 0x17 , 0x1d },
240+ { 0x05 , 0x11 , 0x18 , 0xff },
241+ { 0x06 , 0x11 , 0xff , 0xff },
242+ { 0x00 , 0xff , 0xff , 0xff }
243+ };
244+
245+ static const u8 edp_pre_emp_hbr2_hbr3_v2 [4 ][4 ] = {
246+ { 0x0c , 0x15 , 0x19 , 0x1e },
247+ { 0x08 , 0x15 , 0x19 , 0xff },
248+ { 0x0e , 0x14 , 0xff , 0xff },
249+ { 0x0d , 0xff , 0xff , 0xff }
250+ };
251+
252+ static const struct qcom_edp_swing_pre_emph_cfg edp_phy_swing_pre_emph_cfg_v2 = {
253+ .swing_hbr_rbr = & edp_swing_hbr_rbr ,
254+ .swing_hbr3_hbr2 = & edp_swing_hbr2_hbr3 ,
255+ .pre_emphasis_hbr_rbr = & edp_pre_emp_hbr_rbr_v2 ,
256+ .pre_emphasis_hbr3_hbr2 = & edp_pre_emp_hbr2_hbr3_v2 ,
257+ };
258+
259+ static const u8 edp_swing_hbr2_hbr3_v3 [4 ][4 ] = {
260+ { 0x06 , 0x11 , 0x16 , 0x1b },
261+ { 0x0b , 0x19 , 0x1f , 0xff },
262+ { 0x18 , 0x1f , 0xff , 0xff },
263+ { 0x1f , 0xff , 0xff , 0xff }
264+ };
265+
266+ static const u8 edp_pre_emp_hbr2_hbr3_v3 [4 ][4 ] = {
267+ { 0x0c , 0x15 , 0x19 , 0x1e },
268+ { 0x09 , 0x14 , 0x19 , 0xff },
269+ { 0x0f , 0x14 , 0xff , 0xff },
270+ { 0x0d , 0xff , 0xff , 0xff }
271+ };
272+
273+ static const struct qcom_edp_swing_pre_emph_cfg edp_phy_swing_pre_emph_cfg_v3 = {
274+ .swing_hbr_rbr = & edp_swing_hbr_rbr ,
275+ .swing_hbr3_hbr2 = & edp_swing_hbr2_hbr3_v3 ,
276+ .pre_emphasis_hbr_rbr = & edp_pre_emp_hbr_rbr ,
277+ .pre_emphasis_hbr3_hbr2 = & edp_pre_emp_hbr2_hbr3_v3 ,
278+ };
279+
211280static const u8 edp_phy_aux_cfg_v5 [DP_AUX_CFG_SIZE ] = {
212281 0x00 , 0x13 , 0xa4 , 0x00 , 0x0a , 0x26 , 0x0a , 0x03 , 0x37 , 0x03 , 0x02 , 0x02 , 0x00 ,
213282};
@@ -298,9 +367,6 @@ static int qcom_edp_set_voltages(struct qcom_edp *edp, const struct phy_configur
298367 else
299368 cfg = edp -> cfg -> dp_swing_pre_emph_cfg ;
300369
301- if (!cfg )
302- return 0 ;
303-
304370 for (i = 0 ; i < dp_opts -> lanes ; i ++ ) {
305371 v_level = max (v_level , dp_opts -> voltage [i ]);
306372 p_level = max (p_level , dp_opts -> pre [i ]);
@@ -568,6 +634,16 @@ static const struct qcom_edp_phy_cfg sa8775p_dp_phy_cfg = {
568634static const struct qcom_edp_phy_cfg sc7280_dp_phy_cfg = {
569635 .aux_cfg = edp_phy_aux_cfg_v4 ,
570636 .vco_div_cfg = edp_phy_vco_div_cfg_v4 ,
637+ .dp_swing_pre_emph_cfg = & dp_phy_swing_pre_emph_cfg ,
638+ .edp_swing_pre_emph_cfg = & edp_phy_swing_pre_emph_cfg_v3 ,
639+ .ver_ops = & qcom_edp_phy_ops_v4 ,
640+ };
641+
642+ static const struct qcom_edp_phy_cfg sc8180x_dp_phy_cfg = {
643+ .aux_cfg = edp_phy_aux_cfg_v4 ,
644+ .vco_div_cfg = edp_phy_vco_div_cfg_v4 ,
645+ .dp_swing_pre_emph_cfg = & dp_phy_swing_pre_emph_cfg_v2 ,
646+ .edp_swing_pre_emph_cfg = & edp_phy_swing_pre_emph_cfg_v2 ,
571647 .ver_ops = & qcom_edp_phy_ops_v4 ,
572648};
573649
@@ -1348,7 +1424,7 @@ static const struct of_device_id qcom_edp_phy_match_table[] = {
13481424 { .compatible = "qcom,glymur-dp-phy" , .data = & glymur_phy_cfg , },
13491425 { .compatible = "qcom,sa8775p-edp-phy" , .data = & sa8775p_dp_phy_cfg , },
13501426 { .compatible = "qcom,sc7280-edp-phy" , .data = & sc7280_dp_phy_cfg , },
1351- { .compatible = "qcom,sc8180x-edp-phy" , .data = & sc7280_dp_phy_cfg , },
1427+ { .compatible = "qcom,sc8180x-edp-phy" , .data = & sc8180x_dp_phy_cfg , },
13521428 { .compatible = "qcom,sc8280xp-dp-phy" , .data = & sc8280xp_dp_phy_cfg , },
13531429 { .compatible = "qcom,sc8280xp-edp-phy" , .data = & sc8280xp_edp_phy_cfg , },
13541430 { .compatible = "qcom,x1e80100-dp-phy" , .data = & x1e80100_phy_cfg , },
0 commit comments