@@ -114,6 +114,30 @@ static void sun4i_tcon_channel_set_status(struct sun4i_tcon *tcon, int channel,
114
114
}
115
115
}
116
116
117
+ static void sun4i_tcon_setup_lvds_phy (struct sun4i_tcon * tcon ,
118
+ const struct drm_encoder * encoder )
119
+ {
120
+ regmap_write (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
121
+ SUN4I_TCON0_LVDS_ANA0_CK_EN |
122
+ SUN4I_TCON0_LVDS_ANA0_REG_V |
123
+ SUN4I_TCON0_LVDS_ANA0_REG_C |
124
+ SUN4I_TCON0_LVDS_ANA0_EN_MB |
125
+ SUN4I_TCON0_LVDS_ANA0_PD |
126
+ SUN4I_TCON0_LVDS_ANA0_DCHS );
127
+
128
+ udelay (2 ); /* delay at least 1200 ns */
129
+ regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA1_REG ,
130
+ SUN4I_TCON0_LVDS_ANA1_INIT ,
131
+ SUN4I_TCON0_LVDS_ANA1_INIT );
132
+ udelay (1 ); /* delay at least 120 ns */
133
+ regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA1_REG ,
134
+ SUN4I_TCON0_LVDS_ANA1_UPDATE ,
135
+ SUN4I_TCON0_LVDS_ANA1_UPDATE );
136
+ regmap_update_bits (tcon -> regs , SUN4I_TCON0_LVDS_ANA0_REG ,
137
+ SUN4I_TCON0_LVDS_ANA0_EN_MB ,
138
+ SUN4I_TCON0_LVDS_ANA0_EN_MB );
139
+ }
140
+
117
141
static void sun6i_tcon_setup_lvds_phy (struct sun4i_tcon * tcon ,
118
142
const struct drm_encoder * encoder )
119
143
{
@@ -1454,6 +1478,16 @@ static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
1454
1478
.dclk_min_div = 1 ,
1455
1479
};
1456
1480
1481
+ static const struct sun4i_tcon_quirks sun7i_a20_tcon0_quirks = {
1482
+ .supports_lvds = true,
1483
+ .has_channel_0 = true,
1484
+ .has_channel_1 = true,
1485
+ .dclk_min_div = 4 ,
1486
+ /* Same display pipeline structure as A10 */
1487
+ .set_mux = sun4i_a10_tcon_set_mux ,
1488
+ .setup_lvds_phy = sun4i_tcon_setup_lvds_phy ,
1489
+ };
1490
+
1457
1491
static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
1458
1492
.has_channel_0 = true,
1459
1493
.has_channel_1 = true,
@@ -1508,7 +1542,7 @@ const struct of_device_id sun4i_tcon_of_table[] = {
1508
1542
{ .compatible = "allwinner,sun6i-a31-tcon" , .data = & sun6i_a31_quirks },
1509
1543
{ .compatible = "allwinner,sun6i-a31s-tcon" , .data = & sun6i_a31s_quirks },
1510
1544
{ .compatible = "allwinner,sun7i-a20-tcon" , .data = & sun7i_a20_quirks },
1511
- { .compatible = "allwinner,sun7i-a20-tcon0" , .data = & sun7i_a20_quirks },
1545
+ { .compatible = "allwinner,sun7i-a20-tcon0" , .data = & sun7i_a20_tcon0_quirks },
1512
1546
{ .compatible = "allwinner,sun7i-a20-tcon1" , .data = & sun7i_a20_quirks },
1513
1547
{ .compatible = "allwinner,sun8i-a23-tcon" , .data = & sun8i_a33_quirks },
1514
1548
{ .compatible = "allwinner,sun8i-a33-tcon" , .data = & sun8i_a33_quirks },
0 commit comments