32
32
#define DP_PHY_PD_CTL 0x001c
33
33
#define DP_PHY_MODE 0x0020
34
34
35
- #define DP_PHY_AUX_CFG0 0x0024
36
- #define DP_PHY_AUX_CFG1 0x0028
37
- #define DP_PHY_AUX_CFG2 0x002C
38
- #define DP_PHY_AUX_CFG3 0x0030
39
- #define DP_PHY_AUX_CFG4 0x0034
40
- #define DP_PHY_AUX_CFG5 0x0038
41
- #define DP_PHY_AUX_CFG6 0x003C
42
- #define DP_PHY_AUX_CFG7 0x0040
43
- #define DP_PHY_AUX_CFG8 0x0044
44
- #define DP_PHY_AUX_CFG9 0x0048
35
+ #define DP_AUX_CFG_SIZE 10
36
+ #define DP_PHY_AUX_CFG (n ) (0x24 + (0x04 * (n)))
45
37
46
38
#define DP_PHY_AUX_INTERRUPT_MASK 0x0058
47
39
@@ -90,6 +82,7 @@ struct phy_ver_ops {
90
82
91
83
struct qcom_edp_phy_cfg {
92
84
bool is_edp ;
85
+ const u8 * aux_cfg ;
93
86
const struct qcom_edp_swing_pre_emph_cfg * swing_pre_emph_cfg ;
94
87
const struct phy_ver_ops * ver_ops ;
95
88
};
@@ -186,11 +179,15 @@ static const struct qcom_edp_swing_pre_emph_cfg edp_phy_swing_pre_emph_cfg = {
186
179
.pre_emphasis_hbr3_hbr2 = & edp_pre_emp_hbr2_hbr3 ,
187
180
};
188
181
182
+ static const u8 edp_phy_aux_cfg_v4 [10 ] = {
183
+ 0x00 , 0x13 , 0x24 , 0x00 , 0x0a , 0x26 , 0x0a , 0x03 , 0x37 , 0x03
184
+ };
185
+
189
186
static int qcom_edp_phy_init (struct phy * phy )
190
187
{
191
188
struct qcom_edp * edp = phy_get_drvdata (phy );
189
+ u8 aux_cfg [DP_AUX_CFG_SIZE ];
192
190
int ret ;
193
- u8 cfg8 ;
194
191
195
192
ret = regulator_bulk_enable (ARRAY_SIZE (edp -> supplies ), edp -> supplies );
196
193
if (ret )
@@ -200,6 +197,8 @@ static int qcom_edp_phy_init(struct phy *phy)
200
197
if (ret )
201
198
goto out_disable_supplies ;
202
199
200
+ memcpy (aux_cfg , edp -> cfg -> aux_cfg , sizeof (aux_cfg ));
201
+
203
202
writel (DP_PHY_PD_CTL_PWRDN | DP_PHY_PD_CTL_AUX_PWRDN |
204
203
DP_PHY_PD_CTL_PLL_PWRDN | DP_PHY_PD_CTL_DP_CLAMP_EN ,
205
204
edp -> edp + DP_PHY_PD_CTL );
@@ -222,22 +221,12 @@ static int qcom_edp_phy_init(struct phy *phy)
222
221
* even needed.
223
222
*/
224
223
if (edp -> cfg -> swing_pre_emph_cfg && !edp -> is_edp )
225
- cfg8 = 0xb7 ;
226
- else
227
- cfg8 = 0x37 ;
224
+ aux_cfg [8 ] = 0xb7 ;
228
225
229
226
writel (0xfc , edp -> edp + DP_PHY_MODE );
230
227
231
- writel (0x00 , edp -> edp + DP_PHY_AUX_CFG0 );
232
- writel (0x13 , edp -> edp + DP_PHY_AUX_CFG1 );
233
- writel (0x24 , edp -> edp + DP_PHY_AUX_CFG2 );
234
- writel (0x00 , edp -> edp + DP_PHY_AUX_CFG3 );
235
- writel (0x0a , edp -> edp + DP_PHY_AUX_CFG4 );
236
- writel (0x26 , edp -> edp + DP_PHY_AUX_CFG5 );
237
- writel (0x0a , edp -> edp + DP_PHY_AUX_CFG6 );
238
- writel (0x03 , edp -> edp + DP_PHY_AUX_CFG7 );
239
- writel (cfg8 , edp -> edp + DP_PHY_AUX_CFG8 );
240
- writel (0x03 , edp -> edp + DP_PHY_AUX_CFG9 );
228
+ for (int i = 0 ; i < DP_AUX_CFG_SIZE ; i ++ )
229
+ writel (aux_cfg [i ], edp -> edp + DP_PHY_AUX_CFG (i ));
241
230
242
231
writel (PHY_AUX_STOP_ERR_MASK | PHY_AUX_DEC_ERR_MASK |
243
232
PHY_AUX_SYNC_ERR_MASK | PHY_AUX_ALIGN_ERR_MASK |
@@ -519,16 +508,19 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v4 = {
519
508
};
520
509
521
510
static const struct qcom_edp_phy_cfg sc7280_dp_phy_cfg = {
511
+ .aux_cfg = edp_phy_aux_cfg_v4 ,
522
512
.ver_ops = & qcom_edp_phy_ops_v4 ,
523
513
};
524
514
525
515
static const struct qcom_edp_phy_cfg sc8280xp_dp_phy_cfg = {
516
+ .aux_cfg = edp_phy_aux_cfg_v4 ,
526
517
.swing_pre_emph_cfg = & dp_phy_swing_pre_emph_cfg ,
527
518
.ver_ops = & qcom_edp_phy_ops_v4 ,
528
519
};
529
520
530
521
static const struct qcom_edp_phy_cfg sc8280xp_edp_phy_cfg = {
531
522
.is_edp = true,
523
+ .aux_cfg = edp_phy_aux_cfg_v4 ,
532
524
.swing_pre_emph_cfg = & edp_phy_swing_pre_emph_cfg ,
533
525
.ver_ops = & qcom_edp_phy_ops_v4 ,
534
526
};
@@ -707,6 +699,7 @@ static const struct phy_ver_ops qcom_edp_phy_ops_v6 = {
707
699
};
708
700
709
701
static struct qcom_edp_phy_cfg x1e80100_phy_cfg = {
702
+ .aux_cfg = edp_phy_aux_cfg_v4 ,
710
703
.swing_pre_emph_cfg = & dp_phy_swing_pre_emph_cfg ,
711
704
.ver_ops = & qcom_edp_phy_ops_v6 ,
712
705
};
0 commit comments