@@ -114,46 +114,47 @@ static void sun4i_tcon_channel_set_status(struct sun4i_tcon *tcon, int channel,
114
114
}
115
115
}
116
116
117
+ static void sun6i_tcon_setup_lvds_phy (struct sun4i_tcon * tcon ,
118
+ const struct drm_encoder * encoder )
119
+ {
120
+ u8 val ;
121
+
122
+ regmap_write (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
123
+ SUN6I_TCON0_LVDS_ANA0_C (2 ) |
124
+ SUN6I_TCON0_LVDS_ANA0_V (3 ) |
125
+ SUN6I_TCON0_LVDS_ANA0_PD (2 ) |
126
+ SUN6I_TCON0_LVDS_ANA0_EN_LDO );
127
+ udelay (2 );
128
+
129
+ regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
130
+ SUN6I_TCON0_LVDS_ANA0_EN_MB ,
131
+ SUN6I_TCON0_LVDS_ANA0_EN_MB );
132
+ udelay (2 );
133
+
134
+ regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
135
+ SUN6I_TCON0_LVDS_ANA0_EN_DRVC ,
136
+ SUN6I_TCON0_LVDS_ANA0_EN_DRVC );
137
+
138
+ if (sun4i_tcon_get_pixel_depth (encoder ) == 18 )
139
+ val = 7 ;
140
+ else
141
+ val = 0xf ;
142
+
143
+ regmap_write_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
144
+ SUN6I_TCON0_LVDS_ANA0_EN_DRVD (0xf ),
145
+ SUN6I_TCON0_LVDS_ANA0_EN_DRVD (val ));
146
+ }
147
+
117
148
static void sun4i_tcon_lvds_set_status (struct sun4i_tcon * tcon ,
118
149
const struct drm_encoder * encoder ,
119
150
bool enabled )
120
151
{
121
152
if (enabled ) {
122
- u8 val ;
123
-
124
153
regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_IF_REG ,
125
154
SUN4I_TCON0_LVDS_IF_EN ,
126
155
SUN4I_TCON0_LVDS_IF_EN );
127
-
128
- /*
129
- * As their name suggest, these values only apply to the A31
130
- * and later SoCs. We'll have to rework this when merging
131
- * support for the older SoCs.
132
- */
133
- regmap_write (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
134
- SUN6I_TCON0_LVDS_ANA0_C (2 ) |
135
- SUN6I_TCON0_LVDS_ANA0_V (3 ) |
136
- SUN6I_TCON0_LVDS_ANA0_PD (2 ) |
137
- SUN6I_TCON0_LVDS_ANA0_EN_LDO );
138
- udelay (2 );
139
-
140
- regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
141
- SUN6I_TCON0_LVDS_ANA0_EN_MB ,
142
- SUN6I_TCON0_LVDS_ANA0_EN_MB );
143
- udelay (2 );
144
-
145
- regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
146
- SUN6I_TCON0_LVDS_ANA0_EN_DRVC ,
147
- SUN6I_TCON0_LVDS_ANA0_EN_DRVC );
148
-
149
- if (sun4i_tcon_get_pixel_depth (encoder ) == 18 )
150
- val = 7 ;
151
- else
152
- val = 0xf ;
153
-
154
- regmap_write_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
155
- SUN6I_TCON0_LVDS_ANA0_EN_DRVD (0xf ),
156
- SUN6I_TCON0_LVDS_ANA0_EN_DRVD (val ));
156
+ if (tcon -> quirks -> setup_lvds_phy )
157
+ tcon -> quirks -> setup_lvds_phy (tcon , encoder );
157
158
} else {
158
159
regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_IF_REG ,
159
160
SUN4I_TCON0_LVDS_IF_EN , 0 );
@@ -1465,12 +1466,14 @@ static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
1465
1466
.has_channel_0 = true,
1466
1467
.has_lvds_alt = true,
1467
1468
.dclk_min_div = 1 ,
1469
+ .setup_lvds_phy = sun6i_tcon_setup_lvds_phy ,
1468
1470
};
1469
1471
1470
1472
static const struct sun4i_tcon_quirks sun8i_a83t_lcd_quirks = {
1471
1473
.supports_lvds = true,
1472
1474
.has_channel_0 = true,
1473
1475
.dclk_min_div = 1 ,
1476
+ .setup_lvds_phy = sun6i_tcon_setup_lvds_phy ,
1474
1477
};
1475
1478
1476
1479
static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
0 commit comments