|
@@ -800,6 +800,30 @@ static int sun4i_tcon_remove(struct platform_device *pdev)
|
|
|
}
|
|
|
|
|
|
/* platform specific TCON muxing callbacks */
|
|
|
+static int sun4i_a10_tcon_set_mux(struct sun4i_tcon *tcon,
|
|
|
+ const struct drm_encoder *encoder)
|
|
|
+{
|
|
|
+ struct sun4i_tcon *tcon0 = sun4i_get_tcon0(encoder->dev);
|
|
|
+ u32 shift;
|
|
|
+
|
|
|
+ if (!tcon0)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ switch (encoder->encoder_type) {
|
|
|
+ case DRM_MODE_ENCODER_TMDS:
|
|
|
+ /* HDMI */
|
|
|
+ shift = 8;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ regmap_update_bits(tcon0->regs, SUN4I_TCON_MUX_CTRL_REG,
|
|
|
+ 0x3 << shift, tcon->id << shift);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int sun5i_a13_tcon_set_mux(struct sun4i_tcon *tcon,
|
|
|
const struct drm_encoder *encoder)
|
|
|
{
|
|
@@ -841,6 +865,11 @@ static int sun6i_tcon_set_mux(struct sun4i_tcon *tcon,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
|
|
|
+ .has_channel_1 = true,
|
|
|
+ .set_mux = sun4i_a10_tcon_set_mux,
|
|
|
+};
|
|
|
+
|
|
|
static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
|
|
|
.has_channel_1 = true,
|
|
|
.set_mux = sun5i_a13_tcon_set_mux,
|
|
@@ -866,6 +895,7 @@ static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
|
|
|
};
|
|
|
|
|
|
static const struct of_device_id sun4i_tcon_of_table[] = {
|
|
|
+ { .compatible = "allwinner,sun4i-a10-tcon", .data = &sun4i_a10_quirks },
|
|
|
{ .compatible = "allwinner,sun5i-a13-tcon", .data = &sun5i_a13_quirks },
|
|
|
{ .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks },
|
|
|
{ .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks },
|