linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/meson: Fix CVBS initialization
@ 2017-01-04  9:55 Neil Armstrong
  2017-01-04  9:55 ` [PATCH 1/2] drm/meson: Fix CVBS initialization when HDMI is configured by bootloader Neil Armstrong
  2017-01-04  9:55 ` [PATCH 2/2] drm/meson: Fix CVBS VDAC disable Neil Armstrong
  0 siblings, 2 replies; 3+ messages in thread
From: Neil Armstrong @ 2017-01-04  9:55 UTC (permalink / raw)
  To: airlied, daniel
  Cc: Neil Armstrong, dri-devel, linux-amlogic, linux-arm-kernel, linux-kernel

This serie fixes the CVBS initialization when HDMI is already configured
by the bootloader and fixes the CVBS vdac disable register values.

Neil Armstrong (2):
  drm/meson: Fix CVBS initialization when HDMI is configured by
    bootloader
  drm/meson: Fix CVBS VDAC disable

 drivers/gpu/drm/meson/meson_venc.c      | 19 +++++++++++++++++++
 drivers/gpu/drm/meson/meson_venc_cvbs.c |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] drm/meson: Fix CVBS initialization when HDMI is configured by bootloader
  2017-01-04  9:55 [PATCH 0/2] drm/meson: Fix CVBS initialization Neil Armstrong
@ 2017-01-04  9:55 ` Neil Armstrong
  2017-01-04  9:55 ` [PATCH 2/2] drm/meson: Fix CVBS VDAC disable Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2017-01-04  9:55 UTC (permalink / raw)
  To: airlied, daniel
  Cc: Neil Armstrong, dri-devel, linux-amlogic, linux-arm-kernel, linux-kernel

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>
---
 drivers/gpu/drm/meson/meson_venc.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c
index d836b22..f7c87017 100644
--- a/drivers/gpu/drm/meson/meson_venc.c
+++ b/drivers/gpu/drm/meson/meson_venc.c
@@ -38,6 +38,11 @@
  * - TV Panel encoding via ENCT
  */
 
+/* HHI Registers */
+#define HHI_VDAC_CNTL0		0x2F4 /* 0xbd offset in data sheet */
+#define HHI_VDAC_CNTL1		0x2F8 /* 0xbe offset in data sheet */
+#define HHI_HDMI_PHY_CNTL0	0x3a0 /* 0xe8 offset in data sheet */
+
 struct meson_cvbs_enci_mode meson_cvbs_enci_pal = {
 	.mode_tag = MESON_VENC_MODE_CVBS_PAL,
 	.hso_begin = 3,
@@ -242,6 +247,20 @@ void meson_venc_disable_vsync(struct meson_drm *priv)
 
 void meson_venc_init(struct meson_drm *priv)
 {
+	/* Disable CVBS VDAC */
+	regmap_write(priv->hhi, HHI_VDAC_CNTL0, 0);
+	regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8);
+
+	/* Power Down Dacs */
+	writel_relaxed(0xff, priv->io_base + _REG(VENC_VDAC_SETTING));
+
+	/* Disable HDMI PHY */
+	regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, 0);
+
+	/* Disable HDMI */
+	writel_bits_relaxed(0x3, 0,
+			    priv->io_base + _REG(VPU_HDMI_SETTING));
+
 	/* Disable all encoders */
 	writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_EN));
 	writel_relaxed(0, priv->io_base + _REG(ENCP_VIDEO_EN));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm/meson: Fix CVBS VDAC disable
  2017-01-04  9:55 [PATCH 0/2] drm/meson: Fix CVBS initialization Neil Armstrong
  2017-01-04  9:55 ` [PATCH 1/2] drm/meson: Fix CVBS initialization when HDMI is configured by bootloader Neil Armstrong
@ 2017-01-04  9:55 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2017-01-04  9:55 UTC (permalink / raw)
  To: airlied, daniel
  Cc: Neil Armstrong, dri-devel, linux-amlogic, linux-arm-kernel, linux-kernel

This commit fixes the VDAC disabling register write values.

Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/meson/meson_venc_cvbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/meson/meson_venc_cvbs.c b/drivers/gpu/drm/meson/meson_venc_cvbs.c
index c809c08..a2bcc70 100644
--- a/drivers/gpu/drm/meson/meson_venc_cvbs.c
+++ b/drivers/gpu/drm/meson/meson_venc_cvbs.c
@@ -167,7 +167,7 @@ static void meson_venc_cvbs_encoder_disable(struct drm_encoder *encoder)
 
 	/* Disable CVBS VDAC */
 	regmap_write(priv->hhi, HHI_VDAC_CNTL0, 0);
-	regmap_write(priv->hhi, HHI_VDAC_CNTL1, 0);
+	regmap_write(priv->hhi, HHI_VDAC_CNTL1, 8);
 }
 
 static void meson_venc_cvbs_encoder_enable(struct drm_encoder *encoder)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-04  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04  9:55 [PATCH 0/2] drm/meson: Fix CVBS initialization Neil Armstrong
2017-01-04  9:55 ` [PATCH 1/2] drm/meson: Fix CVBS initialization when HDMI is configured by bootloader Neil Armstrong
2017-01-04  9:55 ` [PATCH 2/2] drm/meson: Fix CVBS VDAC disable Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).