summaryrefslogtreecommitdiffstats
path: root/drivers/staging/imx-drm/imx-tve.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-11-03 15:52:16 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-02-24 12:04:08 +0000
commitf2d66aad1aade34df678177c5ccb58feaea72156 (patch)
tree6cece0b40fea6e3ee06595bb929fe8af5cde72b3 /drivers/staging/imx-drm/imx-tve.c
parentbaa68c4bfd9f85ada2d7bb3416f76561a84f1a0e (diff)
downloadop-kernel-dev-f2d66aad1aade34df678177c5ccb58feaea72156.zip
op-kernel-dev-f2d66aad1aade34df678177c5ccb58feaea72156.tar.gz
imx-drm: simplify setup of panel format
The encoder format passed into imx_drm_crtc_panel_format*() is the encoder format used for DRM in most cases; the HDMI encoder sets this to none, but this is incorrect, it should be TMDS. Since this is the case, we can pass the drm_encoder structure directly into this function and use the supplied fields there to configure the CRTC. Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/staging/imx-drm/imx-tve.c')
-rw-r--r--drivers/staging/imx-drm/imx-tve.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/staging/imx-drm/imx-tve.c b/drivers/staging/imx-drm/imx-tve.c
index 2d4e097..77131e5 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -310,13 +310,11 @@ static void imx_tve_encoder_prepare(struct drm_encoder *encoder)
switch (tve->mode) {
case TVE_MODE_VGA:
- imx_drm_crtc_panel_format_pins(encoder->crtc,
- DRM_MODE_ENCODER_DAC, IPU_PIX_FMT_GBR24,
+ imx_drm_panel_format_pins(encoder, IPU_PIX_FMT_GBR24,
tve->hsync_pin, tve->vsync_pin);
break;
case TVE_MODE_TVOUT:
- imx_drm_crtc_panel_format(encoder->crtc, DRM_MODE_ENCODER_TVDAC,
- V4L2_PIX_FMT_YUV444);
+ imx_drm_panel_format(encoder, V4L2_PIX_FMT_YUV444);
break;
}
}
@@ -510,12 +508,16 @@ static int tve_clk_init(struct imx_tve *tve, void __iomem *base)
static int imx_tve_register(struct imx_tve *tve)
{
+ int encoder_type;
int ret;
+ encoder_type = tve->mode == TVE_MODE_VGA ?
+ DRM_MODE_ENCODER_DAC : DRM_MODE_ENCODER_TVDAC;
+
tve->connector.funcs = &imx_tve_connector_funcs;
tve->encoder.funcs = &imx_tve_encoder_funcs;
- tve->encoder.encoder_type = DRM_MODE_ENCODER_NONE;
+ tve->encoder.encoder_type = encoder_type;
tve->connector.connector_type = DRM_MODE_CONNECTOR_VGA;
drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs);
OpenPOWER on IntegriCloud