aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2017-01-02 10:14:15 -0500
committerNeil Armstrong <narmstrong@baylibre.com>2017-01-04 06:09:25 -0500
commit0c931a290cc0377c99a8cd970a49e736dbb23e0e (patch)
treef6693728492790193c38cf1e76e416b239ed2640
parentdcafc45dcb6d8bb6d159ed0a903bd0f3de597fac (diff)
drm/meson: Fix CVBS initialization when HDMI is configured by bootloader
When the HDMI output is configured by the bootloader, there is mismatch is the pipeline configuration and the Vsync interrupt fails to trigger. This commit disables the HDMI blocks in the probe phase. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
-rw-r--r--drivers/gpu/drm/meson/meson_venc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c
index d836b2274531..f7c870172220 100644
--- a/drivers/gpu/drm/meson/meson_venc.c
+++ b/drivers/gpu/drm/meson/meson_venc.c
@@ -38,6 +38,11 @@
38 * - TV Panel encoding via ENCT 38 * - TV Panel encoding via ENCT
39 */ 39 */
40 40
41/* HHI Registers */
42#define HHI_VDAC_CNTL0 0x2F4 /* 0xbd offset in data sheet */
43#define HHI_VDAC_CNTL1 0x2F8 /* 0xbe offset in data sheet */
44#define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */
45
41struct meson_cvbs_enci_mode meson_cvbs_enci_pal = { 46struct meson_cvbs_enci_mode meson_cvbs_enci_pal = {
42 .mode_tag = MESON_VENC_MODE_CVBS_PAL, 47 .mode_tag = MESON_VENC_MODE_CVBS_PAL,
43 .hso_begin = 3, 48 .hso_begin = 3,
@@ -242,6 +247,20 @@ void meson_venc_disable_vsync(struct meson_drm *priv)
242 247
243void meson_venc_init(struct meson_drm *priv) 248void meson_venc_init(struct meson_drm *priv)
244{ 249{
250 /* Disable CVBS VDAC */
251 regmap_write(priv->hhi, HHI_VDAC_CNTL0, 0);
252 regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8);
253
254 /* Power Down Dacs */
255 writel_relaxed(0xff, priv->io_base + _REG(VENC_VDAC_SETTING));
256
257 /* Disable HDMI PHY */
258 regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0);
259
260 /* Disable HDMI */
261 writel_bits_relaxed(0x3, 0,
262 priv->io_base + _REG(VPU_HDMI_SETTING));
263
245 /* Disable all encoders */ 264 /* Disable all encoders */
246 writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_EN)); 265 writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_EN));
247 writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN)); 266 writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN));