Skip to content

Commit

Permalink
drm/sun4i: Add support for H6 TCON TV
Browse files Browse the repository at this point in the history
H6 has one TCON TV which can be connected either on HDMI or TV.
Currently support for HDMI is added. set_mux callback might need
additional code for TV.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
  • Loading branch information
jernejsk committed Mar 28, 2018
1 parent 724df52 commit c3ea038
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/gpu/drm/sun4i/sun4i_tcon.c
Expand Up @@ -1154,12 +1154,30 @@ static int sun6i_tcon_set_mux(struct sun4i_tcon *tcon,
return 0;
}

static int sun50i_h6_tcon_tv_set_mux(struct sun4i_tcon *tcon,
const struct drm_encoder *encoder)
{
if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS)
sun8i_tcon_top_set_hdmi_src(tcon->tcon_top, 0);

sun8i_tcon_top_de_config(tcon->tcon_top, tcon->id,
tcon_type_tv, 0);

return 0;
}

static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
.has_channel_0 = true,
.has_channel_1 = true,
.set_mux = sun4i_a10_tcon_set_mux,
};

static const struct sun4i_tcon_quirks sun50i_h6_tv_0_quirks = {
.has_channel_1 = true,
.needs_tcon_top = true,
.set_mux = sun50i_h6_tcon_tv_set_mux,
};

static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
.has_channel_0 = true,
.has_channel_1 = true,
Expand Down Expand Up @@ -1208,6 +1226,7 @@ static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
/* sun4i_drv uses this list to check if a device node is a TCON */
const struct of_device_id sun4i_tcon_of_table[] = {
{ .compatible = "allwinner,sun4i-a10-tcon", .data = &sun4i_a10_quirks },
{ .compatible = "allwinner,sun50i-h6-tcon-tv", .data = &sun50i_h6_tv_0_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 },
Expand Down

0 comments on commit c3ea038

Please sign in to comment.