@@ -488,6 +488,9 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
else
reg |= SUN4I_TCON0_LVDS_IF_DATA_POL_NORMAL;
+ if (tcon->lvds_dual_link)
+ reg |= SUN4I_TCON0_LVDS_IF_DUAL_LINK;
+
if (sun4i_tcon_get_pixel_depth(encoder) == 24)
reg |= SUN4I_TCON0_LVDS_IF_BITWIDTH_24BITS;
else
@@ -1219,6 +1222,9 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
} else {
can_lvds = true;
}
+
+ tcon->lvds_dual_link = of_property_read_bool(dev->of_node,
+ "allwinner,lvds-dual-link");
} else {
can_lvds = false;
}
@@ -98,6 +98,7 @@
#define SUN4I_TCON0_LVDS_IF_REG 0x84
#define SUN4I_TCON0_LVDS_IF_EN BIT(31)
+#define SUN4I_TCON0_LVDS_IF_DUAL_LINK BIT(30)
#define SUN4I_TCON0_LVDS_IF_BITWIDTH_MASK BIT(26)
#define SUN4I_TCON0_LVDS_IF_BITWIDTH_18BITS (1 << 26)
#define SUN4I_TCON0_LVDS_IF_BITWIDTH_24BITS (0 << 26)
@@ -263,6 +264,9 @@ struct sun4i_tcon {
/* Associated crtc */
struct sun4i_crtc *crtc;
+ /* Is the LVDS link a dual-channel link? */
+ bool lvds_dual_link;
+
int id;
/* TCON list management */
Some LVDS encoders in the Allwinner SoCs can output on a dual-link. Let's add a DT property to toggle it. Signed-off-by: Maxime Ripard <maxime@cerno.tech> --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 6 ++++++ drivers/gpu/drm/sun4i/sun4i_tcon.h | 4 ++++ 2 files changed, 10 insertions(+)