All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
@ 2022-09-22 12:43 ` Philippe Schenker
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Jernej Skrabec, Jonas Karlman, Robert Foss, linux-kernel,
	Daniel Vetter, Neil Armstrong, Laurent Pinchart, Andrzej Hajda,
	David Airlie, Philippe Schenker

From: Philippe Schenker <philippe.schenker@toradex.com>

This patch-set fixes the lt8912b driver that currently does not take
care whether or not the attached display has postiive or negative syncs
and or reports on EDID if it needs HDMI mode or DVI.

This series addresses also an issue where the LVDS startup sequence was
written to the wrong I2C address (the lt8912 has three). This caused
writing into reserved registers and causing an unstable HDMI picture
that manifests itself only sometimes and depending on the monitor with a
flickering and a repeating of going black and coming up again. While at
it move also some sensible comments to the sequence.


Francesco Dolcini (2):
  drm/bridge: lt8912b: fix corrupted image output
  drm/bridge: lt8912b: clarify lvds output status

Philippe Schenker (2):
  drm/bridge: lt8912b: add vsync hsync
  drm/bridge: lt8912b: set hdmi or dvi mode

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 39 +++++++++++++++++-------
 1 file changed, 28 insertions(+), 11 deletions(-)

-- 
2.37.3


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

* [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
@ 2022-09-22 12:43 ` Philippe Schenker
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Robert Foss, Philippe Schenker, Jernej Skrabec,
	Laurent Pinchart

From: Philippe Schenker <philippe.schenker@toradex.com>

This patch-set fixes the lt8912b driver that currently does not take
care whether or not the attached display has postiive or negative syncs
and or reports on EDID if it needs HDMI mode or DVI.

This series addresses also an issue where the LVDS startup sequence was
written to the wrong I2C address (the lt8912 has three). This caused
writing into reserved registers and causing an unstable HDMI picture
that manifests itself only sometimes and depending on the monitor with a
flickering and a repeating of going black and coming up again. While at
it move also some sensible comments to the sequence.


Francesco Dolcini (2):
  drm/bridge: lt8912b: fix corrupted image output
  drm/bridge: lt8912b: clarify lvds output status

Philippe Schenker (2):
  drm/bridge: lt8912b: add vsync hsync
  drm/bridge: lt8912b: set hdmi or dvi mode

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 39 +++++++++++++++++-------
 1 file changed, 28 insertions(+), 11 deletions(-)

-- 
2.37.3


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

* [PATCH 1/4] drm/bridge: lt8912b: add vsync hsync
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-22 12:43   ` Philippe Schenker
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Jernej Skrabec, Jonas Karlman, Robert Foss, linux-kernel,
	Daniel Vetter, Neil Armstrong, Laurent Pinchart, Andrzej Hajda,
	David Airlie, Philippe Schenker

From: Philippe Schenker <philippe.schenker@toradex.com>

Currently the bridge driver does not take care whether or not the display
needs positive/negative vertical/horizontal syncs. Pass these two flags
to the bridge from the EDID that was read out from the display.

Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 28bad30dc4e5..0fd3472e767c 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -268,7 +268,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
 	u32 hactive, h_total, hpw, hfp, hbp;
 	u32 vactive, v_total, vpw, vfp, vbp;
 	u8 settle = 0x08;
-	int ret;
+	int ret, hsync_activehigh, vsync_activehigh;
 
 	if (!lt)
 		return -EINVAL;
@@ -278,12 +278,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
 	hpw = lt->mode.hsync_len;
 	hbp = lt->mode.hback_porch;
 	h_total = hactive + hfp + hpw + hbp;
+	hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
 
 	vactive = lt->mode.vactive;
 	vfp = lt->mode.vfront_porch;
 	vpw = lt->mode.vsync_len;
 	vbp = lt->mode.vback_porch;
 	v_total = vactive + vfp + vpw + vbp;
+	vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
 
 	if (vactive <= 600)
 		settle = 0x04;
@@ -317,6 +319,11 @@ static int lt8912_video_setup(struct lt8912 *lt)
 	ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
 	ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
 
+	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
+				  vsync_activehigh ? BIT(0) : 0);
+	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
+				  hsync_activehigh ? BIT(1) : 0);
+
 	return ret;
 }
 
-- 
2.37.3


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

* [PATCH 1/4] drm/bridge: lt8912b: add vsync hsync
@ 2022-09-22 12:43   ` Philippe Schenker
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Robert Foss, Philippe Schenker, Jernej Skrabec,
	Laurent Pinchart

From: Philippe Schenker <philippe.schenker@toradex.com>

Currently the bridge driver does not take care whether or not the display
needs positive/negative vertical/horizontal syncs. Pass these two flags
to the bridge from the EDID that was read out from the display.

Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 28bad30dc4e5..0fd3472e767c 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -268,7 +268,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
 	u32 hactive, h_total, hpw, hfp, hbp;
 	u32 vactive, v_total, vpw, vfp, vbp;
 	u8 settle = 0x08;
-	int ret;
+	int ret, hsync_activehigh, vsync_activehigh;
 
 	if (!lt)
 		return -EINVAL;
@@ -278,12 +278,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
 	hpw = lt->mode.hsync_len;
 	hbp = lt->mode.hback_porch;
 	h_total = hactive + hfp + hpw + hbp;
+	hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
 
 	vactive = lt->mode.vactive;
 	vfp = lt->mode.vfront_porch;
 	vpw = lt->mode.vsync_len;
 	vbp = lt->mode.vback_porch;
 	v_total = vactive + vfp + vpw + vbp;
+	vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
 
 	if (vactive <= 600)
 		settle = 0x04;
@@ -317,6 +319,11 @@ static int lt8912_video_setup(struct lt8912 *lt)
 	ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
 	ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
 
+	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
+				  vsync_activehigh ? BIT(0) : 0);
+	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
+				  hsync_activehigh ? BIT(1) : 0);
+
 	return ret;
 }
 
-- 
2.37.3


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

* [PATCH 2/4] drm/bridge: lt8912b: set hdmi or dvi mode
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-22 12:43   ` Philippe Schenker
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Jernej Skrabec, Jonas Karlman, Robert Foss, linux-kernel,
	Daniel Vetter, Neil Armstrong, Laurent Pinchart, Andrzej Hajda,
	David Airlie, Philippe Schenker

From: Philippe Schenker <philippe.schenker@toradex.com>

The Lontium LT8912 does have a setting for DVI or HDMI. This patch reads
from EDID what the display needs and sets it accordingly.

Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 0fd3472e767c..6a4bb7422176 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -323,6 +323,8 @@ static int lt8912_video_setup(struct lt8912 *lt)
 				  vsync_activehigh ? BIT(0) : 0);
 	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
 				  hsync_activehigh ? BIT(1) : 0);
+	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xb2, BIT(0),
+				  lt->connector.display_info.is_hdmi ? BIT(0) : 0);
 
 	return ret;
 }
-- 
2.37.3


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

* [PATCH 2/4] drm/bridge: lt8912b: set hdmi or dvi mode
@ 2022-09-22 12:43   ` Philippe Schenker
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Robert Foss, Philippe Schenker, Jernej Skrabec,
	Laurent Pinchart

From: Philippe Schenker <philippe.schenker@toradex.com>

The Lontium LT8912 does have a setting for DVI or HDMI. This patch reads
from EDID what the display needs and sets it accordingly.

Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 0fd3472e767c..6a4bb7422176 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -323,6 +323,8 @@ static int lt8912_video_setup(struct lt8912 *lt)
 				  vsync_activehigh ? BIT(0) : 0);
 	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
 				  hsync_activehigh ? BIT(1) : 0);
+	ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xb2, BIT(0),
+				  lt->connector.display_info.is_hdmi ? BIT(0) : 0);
 
 	return ret;
 }
-- 
2.37.3


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

* [PATCH 3/4] drm/bridge: lt8912b: fix corrupted image output
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-22 12:43   ` Philippe Schenker
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Jernej Skrabec, Jonas Karlman, Robert Foss, linux-kernel,
	Daniel Vetter, Neil Armstrong, Laurent Pinchart, Andrzej Hajda,
	David Airlie, Francesco Dolcini, Philippe Schenker

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Correct I2C address for the register list in lt8912_write_lvds_config(),
these registers are on the first I2C address (0x48), the current
function is just writing garbage to the wrong registers and this creates
multiple issues (artifacts and output completely corrupted) on some HDMI
displays.

Correct I2C address comes from Lontium documentation and it is the one
used on other out-of-tree LT8912B drivers [1].

[1] https://github.com/boundarydevices/linux/blob/boundary-imx_5.10.x_2.0.0/drivers/video/lt8912.c#L296

Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 6a4bb7422176..5968f4af190b 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -188,7 +188,7 @@ static int lt8912_write_lvds_config(struct lt8912 *lt)
 		{0x03, 0xff},
 	};
 
-	return regmap_multi_reg_write(lt->regmap[I2C_CEC_DSI], seq, ARRAY_SIZE(seq));
+	return regmap_multi_reg_write(lt->regmap[I2C_MAIN], seq, ARRAY_SIZE(seq));
 };
 
 static inline struct lt8912 *bridge_to_lt8912(struct drm_bridge *b)
-- 
2.37.3


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

* [PATCH 3/4] drm/bridge: lt8912b: fix corrupted image output
@ 2022-09-22 12:43   ` Philippe Schenker
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Robert Foss, Philippe Schenker, Jernej Skrabec,
	Francesco Dolcini, Laurent Pinchart

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Correct I2C address for the register list in lt8912_write_lvds_config(),
these registers are on the first I2C address (0x48), the current
function is just writing garbage to the wrong registers and this creates
multiple issues (artifacts and output completely corrupted) on some HDMI
displays.

Correct I2C address comes from Lontium documentation and it is the one
used on other out-of-tree LT8912B drivers [1].

[1] https://github.com/boundarydevices/linux/blob/boundary-imx_5.10.x_2.0.0/drivers/video/lt8912.c#L296

Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 6a4bb7422176..5968f4af190b 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -188,7 +188,7 @@ static int lt8912_write_lvds_config(struct lt8912 *lt)
 		{0x03, 0xff},
 	};
 
-	return regmap_multi_reg_write(lt->regmap[I2C_CEC_DSI], seq, ARRAY_SIZE(seq));
+	return regmap_multi_reg_write(lt->regmap[I2C_MAIN], seq, ARRAY_SIZE(seq));
 };
 
 static inline struct lt8912 *bridge_to_lt8912(struct drm_bridge *b)
-- 
2.37.3


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

* [PATCH 4/4] drm/bridge: lt8912b: clarify lvds output status
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-22 12:43   ` Philippe Schenker
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Jernej Skrabec, Jonas Karlman, Robert Foss, linux-kernel,
	Daniel Vetter, Neil Armstrong, Laurent Pinchart, Andrzej Hajda,
	David Airlie, Francesco Dolcini, Philippe Schenker

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Add comments on the lt8912_write_lvds_config() config to document the
current settings and to make it clear that this is a hardcoded
configuration not relevant for the HDMI output (could be removed without
affecting the HDMI port).

No changes on the actual register writes.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 26 ++++++++++++++++--------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 5968f4af190b..3e870d45f881 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -165,24 +165,32 @@ static int lt8912_write_rxlogicres_config(struct lt8912 *lt)
 	return ret;
 };
 
+/* enable LVDS output with some hardcoded configuration, not required for the HDMI output */
 static int lt8912_write_lvds_config(struct lt8912 *lt)
 {
 	const struct reg_sequence seq[] = {
+		// lvds power up
 		{0x44, 0x30},
 		{0x51, 0x05},
-		{0x50, 0x24},
-		{0x51, 0x2d},
-		{0x52, 0x04},
-		{0x69, 0x0e},
+
+		// core pll bypass
+		{0x50, 0x24}, // cp=50uA
+		{0x51, 0x2d}, // Pix_clk as reference, second order passive LPF PLL
+		{0x52, 0x04}, // loopdiv=0, use second-order PLL
+		{0x69, 0x0e}, // CP_PRESET_DIV_RATIO
 		{0x69, 0x8e},
 		{0x6a, 0x00},
-		{0x6c, 0xb8},
+		{0x6c, 0xb8}, // RGD_CP_SOFT_K_EN,RGD_CP_SOFT_K[13:8]
 		{0x6b, 0x51},
-		{0x04, 0xfb},
+
+		{0x04, 0xfb}, // core pll reset
 		{0x04, 0xff},
-		{0x7f, 0x00},
-		{0xa8, 0x13},
-		{0x02, 0xf7},
+
+		// scaler bypass
+		{0x7f, 0x00}, // disable scaler
+		{0xa8, 0x13}, // 0x13: JEIDA, 0x33: VESA
+
+		{0x02, 0xf7}, // lvds pll reset
 		{0x02, 0xff},
 		{0x03, 0xcf},
 		{0x03, 0xff},
-- 
2.37.3


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

* [PATCH 4/4] drm/bridge: lt8912b: clarify lvds output status
@ 2022-09-22 12:43   ` Philippe Schenker
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Schenker @ 2022-09-22 12:43 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Robert Foss, Philippe Schenker, Jernej Skrabec,
	Francesco Dolcini, Laurent Pinchart

From: Francesco Dolcini <francesco.dolcini@toradex.com>

Add comments on the lt8912_write_lvds_config() config to document the
current settings and to make it clear that this is a hardcoded
configuration not relevant for the HDMI output (could be removed without
affecting the HDMI port).

No changes on the actual register writes.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 drivers/gpu/drm/bridge/lontium-lt8912b.c | 26 ++++++++++++++++--------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 5968f4af190b..3e870d45f881 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -165,24 +165,32 @@ static int lt8912_write_rxlogicres_config(struct lt8912 *lt)
 	return ret;
 };
 
+/* enable LVDS output with some hardcoded configuration, not required for the HDMI output */
 static int lt8912_write_lvds_config(struct lt8912 *lt)
 {
 	const struct reg_sequence seq[] = {
+		// lvds power up
 		{0x44, 0x30},
 		{0x51, 0x05},
-		{0x50, 0x24},
-		{0x51, 0x2d},
-		{0x52, 0x04},
-		{0x69, 0x0e},
+
+		// core pll bypass
+		{0x50, 0x24}, // cp=50uA
+		{0x51, 0x2d}, // Pix_clk as reference, second order passive LPF PLL
+		{0x52, 0x04}, // loopdiv=0, use second-order PLL
+		{0x69, 0x0e}, // CP_PRESET_DIV_RATIO
 		{0x69, 0x8e},
 		{0x6a, 0x00},
-		{0x6c, 0xb8},
+		{0x6c, 0xb8}, // RGD_CP_SOFT_K_EN,RGD_CP_SOFT_K[13:8]
 		{0x6b, 0x51},
-		{0x04, 0xfb},
+
+		{0x04, 0xfb}, // core pll reset
 		{0x04, 0xff},
-		{0x7f, 0x00},
-		{0xa8, 0x13},
-		{0x02, 0xf7},
+
+		// scaler bypass
+		{0x7f, 0x00}, // disable scaler
+		{0xa8, 0x13}, // 0x13: JEIDA, 0x33: VESA
+
+		{0x02, 0xf7}, // lvds pll reset
 		{0x02, 0xff},
 		{0x03, 0xcf},
 		{0x03, 0xff},
-- 
2.37.3


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

* Re: [PATCH 1/4] drm/bridge: lt8912b: add vsync hsync
  2022-09-22 12:43   ` Philippe Schenker
@ 2022-09-22 18:24     ` Adrien Grassein
  -1 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:24 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	dri-devel, linux-kernel, Robert Foss, Philippe Schenker,
	Jernej Skrabec, Laurent Pinchart

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> Currently the bridge driver does not take care whether or not the display
> needs positive/negative vertical/horizontal syncs. Pass these two flags
> to the bridge from the EDID that was read out from the display.
>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 28bad30dc4e5..0fd3472e767c 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -268,7 +268,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
>         u32 hactive, h_total, hpw, hfp, hbp;
>         u32 vactive, v_total, vpw, vfp, vbp;
>         u8 settle = 0x08;
> -       int ret;
> +       int ret, hsync_activehigh, vsync_activehigh;
>
>         if (!lt)
>                 return -EINVAL;
> @@ -278,12 +278,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
>         hpw = lt->mode.hsync_len;
>         hbp = lt->mode.hback_porch;
>         h_total = hactive + hfp + hpw + hbp;
> +       hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
>
>         vactive = lt->mode.vactive;
>         vfp = lt->mode.vfront_porch;
>         vpw = lt->mode.vsync_len;
>         vbp = lt->mode.vback_porch;
>         v_total = vactive + vfp + vpw + vbp;
> +       vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
>
>         if (vactive <= 600)
>                 settle = 0x04;
> @@ -317,6 +319,11 @@ static int lt8912_video_setup(struct lt8912 *lt)
>         ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
>         ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
>
> +       ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
> +                                 vsync_activehigh ? BIT(0) : 0);
> +       ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
> +                                 hsync_activehigh ? BIT(1) : 0);
> +
>         return ret;
>  }
>
> --
> 2.37.3
>

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

* Re: [PATCH 1/4] drm/bridge: lt8912b: add vsync hsync
@ 2022-09-22 18:24     ` Adrien Grassein
  0 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:24 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: dri-devel, Jernej Skrabec, Jonas Karlman, Robert Foss,
	linux-kernel, Daniel Vetter, Neil Armstrong, Laurent Pinchart,
	Andrzej Hajda, David Airlie, Philippe Schenker

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> Currently the bridge driver does not take care whether or not the display
> needs positive/negative vertical/horizontal syncs. Pass these two flags
> to the bridge from the EDID that was read out from the display.
>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 28bad30dc4e5..0fd3472e767c 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -268,7 +268,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
>         u32 hactive, h_total, hpw, hfp, hbp;
>         u32 vactive, v_total, vpw, vfp, vbp;
>         u8 settle = 0x08;
> -       int ret;
> +       int ret, hsync_activehigh, vsync_activehigh;
>
>         if (!lt)
>                 return -EINVAL;
> @@ -278,12 +278,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
>         hpw = lt->mode.hsync_len;
>         hbp = lt->mode.hback_porch;
>         h_total = hactive + hfp + hpw + hbp;
> +       hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
>
>         vactive = lt->mode.vactive;
>         vfp = lt->mode.vfront_porch;
>         vpw = lt->mode.vsync_len;
>         vbp = lt->mode.vback_porch;
>         v_total = vactive + vfp + vpw + vbp;
> +       vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
>
>         if (vactive <= 600)
>                 settle = 0x04;
> @@ -317,6 +319,11 @@ static int lt8912_video_setup(struct lt8912 *lt)
>         ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
>         ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
>
> +       ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
> +                                 vsync_activehigh ? BIT(0) : 0);
> +       ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
> +                                 hsync_activehigh ? BIT(1) : 0);
> +
>         return ret;
>  }
>
> --
> 2.37.3
>

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

* Re: [PATCH 2/4] drm/bridge: lt8912b: set hdmi or dvi mode
  2022-09-22 12:43   ` Philippe Schenker
@ 2022-09-22 18:25     ` Adrien Grassein
  -1 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:25 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	dri-devel, linux-kernel, Robert Foss, Philippe Schenker,
	Jernej Skrabec, Laurent Pinchart

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> The Lontium LT8912 does have a setting for DVI or HDMI. This patch reads
> from EDID what the display needs and sets it accordingly.
>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 0fd3472e767c..6a4bb7422176 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -323,6 +323,8 @@ static int lt8912_video_setup(struct lt8912 *lt)
>                                   vsync_activehigh ? BIT(0) : 0);
>         ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
>                                   hsync_activehigh ? BIT(1) : 0);
> +       ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xb2, BIT(0),
> +                                 lt->connector.display_info.is_hdmi ? BIT(0) : 0);
>
>         return ret;
>  }
> --
> 2.37.3
>

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

* Re: [PATCH 2/4] drm/bridge: lt8912b: set hdmi or dvi mode
@ 2022-09-22 18:25     ` Adrien Grassein
  0 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:25 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: dri-devel, Jernej Skrabec, Jonas Karlman, Robert Foss,
	linux-kernel, Daniel Vetter, Neil Armstrong, Laurent Pinchart,
	Andrzej Hajda, David Airlie, Philippe Schenker

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> The Lontium LT8912 does have a setting for DVI or HDMI. This patch reads
> from EDID what the display needs and sets it accordingly.
>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 0fd3472e767c..6a4bb7422176 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -323,6 +323,8 @@ static int lt8912_video_setup(struct lt8912 *lt)
>                                   vsync_activehigh ? BIT(0) : 0);
>         ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
>                                   hsync_activehigh ? BIT(1) : 0);
> +       ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xb2, BIT(0),
> +                                 lt->connector.display_info.is_hdmi ? BIT(0) : 0);
>
>         return ret;
>  }
> --
> 2.37.3
>

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

* Re: [PATCH 3/4] drm/bridge: lt8912b: fix corrupted image output
  2022-09-22 12:43   ` Philippe Schenker
@ 2022-09-22 18:26     ` Adrien Grassein
  -1 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:26 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	dri-devel, linux-kernel, Robert Foss, Philippe Schenker,
	Jernej Skrabec, Francesco Dolcini, Laurent Pinchart

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Correct I2C address for the register list in lt8912_write_lvds_config(),
> these registers are on the first I2C address (0x48), the current
> function is just writing garbage to the wrong registers and this creates
> multiple issues (artifacts and output completely corrupted) on some HDMI
> displays.
>
> Correct I2C address comes from Lontium documentation and it is the one
> used on other out-of-tree LT8912B drivers [1].
>
> [1] https://github.com/boundarydevices/linux/blob/boundary-imx_5.10.x_2.0.0/drivers/video/lt8912.c#L296
>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 6a4bb7422176..5968f4af190b 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -188,7 +188,7 @@ static int lt8912_write_lvds_config(struct lt8912 *lt)
>                 {0x03, 0xff},
>         };
>
> -       return regmap_multi_reg_write(lt->regmap[I2C_CEC_DSI], seq, ARRAY_SIZE(seq));
> +       return regmap_multi_reg_write(lt->regmap[I2C_MAIN], seq, ARRAY_SIZE(seq));
>  };
>
>  static inline struct lt8912 *bridge_to_lt8912(struct drm_bridge *b)
> --
> 2.37.3
>

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

* Re: [PATCH 3/4] drm/bridge: lt8912b: fix corrupted image output
@ 2022-09-22 18:26     ` Adrien Grassein
  0 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:26 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: dri-devel, Jernej Skrabec, Jonas Karlman, Robert Foss,
	linux-kernel, Daniel Vetter, Neil Armstrong, Laurent Pinchart,
	Andrzej Hajda, David Airlie, Francesco Dolcini,
	Philippe Schenker

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Correct I2C address for the register list in lt8912_write_lvds_config(),
> these registers are on the first I2C address (0x48), the current
> function is just writing garbage to the wrong registers and this creates
> multiple issues (artifacts and output completely corrupted) on some HDMI
> displays.
>
> Correct I2C address comes from Lontium documentation and it is the one
> used on other out-of-tree LT8912B drivers [1].
>
> [1] https://github.com/boundarydevices/linux/blob/boundary-imx_5.10.x_2.0.0/drivers/video/lt8912.c#L296
>
> Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge")
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 6a4bb7422176..5968f4af190b 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -188,7 +188,7 @@ static int lt8912_write_lvds_config(struct lt8912 *lt)
>                 {0x03, 0xff},
>         };
>
> -       return regmap_multi_reg_write(lt->regmap[I2C_CEC_DSI], seq, ARRAY_SIZE(seq));
> +       return regmap_multi_reg_write(lt->regmap[I2C_MAIN], seq, ARRAY_SIZE(seq));
>  };
>
>  static inline struct lt8912 *bridge_to_lt8912(struct drm_bridge *b)
> --
> 2.37.3
>

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

* Re: [PATCH 4/4] drm/bridge: lt8912b: clarify lvds output status
  2022-09-22 12:43   ` Philippe Schenker
@ 2022-09-22 18:26     ` Adrien Grassein
  -1 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:26 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	dri-devel, linux-kernel, Robert Foss, Philippe Schenker,
	Jernej Skrabec, Francesco Dolcini, Laurent Pinchart

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Add comments on the lt8912_write_lvds_config() config to document the
> current settings and to make it clear that this is a hardcoded
> configuration not relevant for the HDMI output (could be removed without
> affecting the HDMI port).
>
> No changes on the actual register writes.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 26 ++++++++++++++++--------
>  1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 5968f4af190b..3e870d45f881 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -165,24 +165,32 @@ static int lt8912_write_rxlogicres_config(struct lt8912 *lt)
>         return ret;
>  };
>
> +/* enable LVDS output with some hardcoded configuration, not required for the HDMI output */
>  static int lt8912_write_lvds_config(struct lt8912 *lt)
>  {
>         const struct reg_sequence seq[] = {
> +               // lvds power up
>                 {0x44, 0x30},
>                 {0x51, 0x05},
> -               {0x50, 0x24},
> -               {0x51, 0x2d},
> -               {0x52, 0x04},
> -               {0x69, 0x0e},
> +
> +               // core pll bypass
> +               {0x50, 0x24}, // cp=50uA
> +               {0x51, 0x2d}, // Pix_clk as reference, second order passive LPF PLL
> +               {0x52, 0x04}, // loopdiv=0, use second-order PLL
> +               {0x69, 0x0e}, // CP_PRESET_DIV_RATIO
>                 {0x69, 0x8e},
>                 {0x6a, 0x00},
> -               {0x6c, 0xb8},
> +               {0x6c, 0xb8}, // RGD_CP_SOFT_K_EN,RGD_CP_SOFT_K[13:8]
>                 {0x6b, 0x51},
> -               {0x04, 0xfb},
> +
> +               {0x04, 0xfb}, // core pll reset
>                 {0x04, 0xff},
> -               {0x7f, 0x00},
> -               {0xa8, 0x13},
> -               {0x02, 0xf7},
> +
> +               // scaler bypass
> +               {0x7f, 0x00}, // disable scaler
> +               {0xa8, 0x13}, // 0x13: JEIDA, 0x33: VESA
> +
> +               {0x02, 0xf7}, // lvds pll reset
>                 {0x02, 0xff},
>                 {0x03, 0xcf},
>                 {0x03, 0xff},
> --
> 2.37.3
>

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

* Re: [PATCH 4/4] drm/bridge: lt8912b: clarify lvds output status
@ 2022-09-22 18:26     ` Adrien Grassein
  0 siblings, 0 replies; 24+ messages in thread
From: Adrien Grassein @ 2022-09-22 18:26 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: dri-devel, Jernej Skrabec, Jonas Karlman, Robert Foss,
	linux-kernel, Daniel Vetter, Neil Armstrong, Laurent Pinchart,
	Andrzej Hajda, David Airlie, Francesco Dolcini,
	Philippe Schenker

Le jeu. 22 sept. 2022 à 14:43, Philippe Schenker <dev@pschenker.ch> a écrit :
>
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Add comments on the lt8912_write_lvds_config() config to document the
> current settings and to make it clear that this is a hardcoded
> configuration not relevant for the HDMI output (could be removed without
> affecting the HDMI port).
>
> No changes on the actual register writes.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 26 ++++++++++++++++--------
>  1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> index 5968f4af190b..3e870d45f881 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
> @@ -165,24 +165,32 @@ static int lt8912_write_rxlogicres_config(struct lt8912 *lt)
>         return ret;
>  };
>
> +/* enable LVDS output with some hardcoded configuration, not required for the HDMI output */
>  static int lt8912_write_lvds_config(struct lt8912 *lt)
>  {
>         const struct reg_sequence seq[] = {
> +               // lvds power up
>                 {0x44, 0x30},
>                 {0x51, 0x05},
> -               {0x50, 0x24},
> -               {0x51, 0x2d},
> -               {0x52, 0x04},
> -               {0x69, 0x0e},
> +
> +               // core pll bypass
> +               {0x50, 0x24}, // cp=50uA
> +               {0x51, 0x2d}, // Pix_clk as reference, second order passive LPF PLL
> +               {0x52, 0x04}, // loopdiv=0, use second-order PLL
> +               {0x69, 0x0e}, // CP_PRESET_DIV_RATIO
>                 {0x69, 0x8e},
>                 {0x6a, 0x00},
> -               {0x6c, 0xb8},
> +               {0x6c, 0xb8}, // RGD_CP_SOFT_K_EN,RGD_CP_SOFT_K[13:8]
>                 {0x6b, 0x51},
> -               {0x04, 0xfb},
> +
> +               {0x04, 0xfb}, // core pll reset
>                 {0x04, 0xff},
> -               {0x7f, 0x00},
> -               {0xa8, 0x13},
> -               {0x02, 0xf7},
> +
> +               // scaler bypass
> +               {0x7f, 0x00}, // disable scaler
> +               {0xa8, 0x13}, // 0x13: JEIDA, 0x33: VESA
> +
> +               {0x02, 0xf7}, // lvds pll reset
>                 {0x02, 0xff},
>                 {0x03, 0xcf},
>                 {0x03, 0xff},
> --
> 2.37.3
>

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

* Re: (subset) [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-23  9:22   ` Neil Armstrong
  -1 siblings, 0 replies; 24+ messages in thread
From: Neil Armstrong @ 2022-09-23  9:22 UTC (permalink / raw)
  To: dri-devel, Philippe Schenker, Adrien Grassein
  Cc: Neil Armstrong, Robert Foss, David Airlie, linux-kernel,
	Jernej Skrabec, Daniel Vetter, Philippe Schenker, Jonas Karlman,
	Laurent Pinchart, Andrzej Hajda

Hi,

On Thu, 22 Sep 2022 14:43:02 +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
> 
> This patch-set fixes the lt8912b driver that currently does not take
> care whether or not the attached display has postiive or negative syncs
> and or reports on EDID if it needs HDMI mode or DVI.
> 
> This series addresses also an issue where the LVDS startup sequence was
> written to the wrong I2C address (the lt8912 has three). This caused
> writing into reserved registers and causing an unstable HDMI picture
> that manifests itself only sometimes and depending on the monitor with a
> flickering and a repeating of going black and coming up again. While at
> it move also some sensible comments to the sequence.
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)

[1/4] drm/bridge: lt8912b: add vsync hsync
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=da73a94fa282f78d485bd0aab36c8ac15b6f792c
[2/4] drm/bridge: lt8912b: set hdmi or dvi mode
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=6dd1de12e1243f2013e4fabf31e99e63b1a860d0
[3/4] drm/bridge: lt8912b: fix corrupted image output
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=051ad2788d35ca07aec8402542e5d38429f2426a

-- 
Neil

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

* Re: (subset) [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
@ 2022-09-23  9:22   ` Neil Armstrong
  0 siblings, 0 replies; 24+ messages in thread
From: Neil Armstrong @ 2022-09-23  9:22 UTC (permalink / raw)
  To: dri-devel, Philippe Schenker, Adrien Grassein
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Jernej Skrabec, Philippe Schenker, Robert Foss,
	Laurent Pinchart

Hi,

On Thu, 22 Sep 2022 14:43:02 +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
> 
> This patch-set fixes the lt8912b driver that currently does not take
> care whether or not the attached display has postiive or negative syncs
> and or reports on EDID if it needs HDMI mode or DVI.
> 
> This series addresses also an issue where the LVDS startup sequence was
> written to the wrong I2C address (the lt8912 has three). This caused
> writing into reserved registers and causing an unstable HDMI picture
> that manifests itself only sometimes and depending on the monitor with a
> flickering and a repeating of going black and coming up again. While at
> it move also some sensible comments to the sequence.
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)

[1/4] drm/bridge: lt8912b: add vsync hsync
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=da73a94fa282f78d485bd0aab36c8ac15b6f792c
[2/4] drm/bridge: lt8912b: set hdmi or dvi mode
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=6dd1de12e1243f2013e4fabf31e99e63b1a860d0
[3/4] drm/bridge: lt8912b: fix corrupted image output
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=051ad2788d35ca07aec8402542e5d38429f2426a

-- 
Neil

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

* Re: (subset) [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-23  9:25   ` Neil Armstrong
  -1 siblings, 0 replies; 24+ messages in thread
From: Neil Armstrong @ 2022-09-23  9:25 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein, Philippe Schenker
  Cc: Neil Armstrong, linux-kernel, Robert Foss, David Airlie,
	Daniel Vetter, Philippe Schenker, Andrzej Hajda, Jernej Skrabec,
	Laurent Pinchart, Jonas Karlman

Hi,

On Thu, 22 Sep 2022 14:43:02 +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
> 
> This patch-set fixes the lt8912b driver that currently does not take
> care whether or not the attached display has postiive or negative syncs
> and or reports on EDID if it needs HDMI mode or DVI.
> 
> This series addresses also an issue where the LVDS startup sequence was
> written to the wrong I2C address (the lt8912 has three). This caused
> writing into reserved registers and causing an unstable HDMI picture
> that manifests itself only sometimes and depending on the monitor with a
> flickering and a repeating of going black and coming up again. While at
> it move also some sensible comments to the sequence.
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[4/4] drm/bridge: lt8912b: clarify lvds output status
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=fc44f3636a4db6544fd1532280e8adcd1ef13ba2

-- 
Neil

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

* Re: (subset) [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
@ 2022-09-23  9:25   ` Neil Armstrong
  0 siblings, 0 replies; 24+ messages in thread
From: Neil Armstrong @ 2022-09-23  9:25 UTC (permalink / raw)
  To: dri-devel, Adrien Grassein, Philippe Schenker
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	linux-kernel, Robert Foss, Philippe Schenker, Jernej Skrabec,
	Laurent Pinchart

Hi,

On Thu, 22 Sep 2022 14:43:02 +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
> 
> This patch-set fixes the lt8912b driver that currently does not take
> care whether or not the attached display has postiive or negative syncs
> and or reports on EDID if it needs HDMI mode or DVI.
> 
> This series addresses also an issue where the LVDS startup sequence was
> written to the wrong I2C address (the lt8912 has three). This caused
> writing into reserved registers and causing an unstable HDMI picture
> that manifests itself only sometimes and depending on the monitor with a
> flickering and a repeating of going black and coming up again. While at
> it move also some sensible comments to the sequence.
> 
> [...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[4/4] drm/bridge: lt8912b: clarify lvds output status
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=fc44f3636a4db6544fd1532280e8adcd1ef13ba2

-- 
Neil

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

* Re: [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
  2022-09-22 12:43 ` Philippe Schenker
@ 2022-09-28 14:22   ` Robert Foss
  -1 siblings, 0 replies; 24+ messages in thread
From: Robert Foss @ 2022-09-28 14:22 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: dri-devel, Adrien Grassein, Jernej Skrabec, Jonas Karlman,
	linux-kernel, Daniel Vetter, Neil Armstrong, Laurent Pinchart,
	Andrzej Hajda, David Airlie, Philippe Schenker

On Thu, 22 Sept 2022 at 14:43, Philippe Schenker <dev@pschenker.ch> wrote:
>
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> This patch-set fixes the lt8912b driver that currently does not take
> care whether or not the attached display has postiive or negative syncs
> and or reports on EDID if it needs HDMI mode or DVI.
>
> This series addresses also an issue where the LVDS startup sequence was
> written to the wrong I2C address (the lt8912 has three). This caused
> writing into reserved registers and causing an unstable HDMI picture
> that manifests itself only sometimes and depending on the monitor with a
> flickering and a repeating of going black and coming up again. While at
> it move also some sensible comments to the sequence.
>
>
> Francesco Dolcini (2):
>   drm/bridge: lt8912b: fix corrupted image output
>   drm/bridge: lt8912b: clarify lvds output status
>
> Philippe Schenker (2):
>   drm/bridge: lt8912b: add vsync hsync
>   drm/bridge: lt8912b: set hdmi or dvi mode
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 39 +++++++++++++++++-------
>  1 file changed, 28 insertions(+), 11 deletions(-)
>
> --
> 2.37.3
>

Thanks for the series & the reviews.

Applied to drm-misc-next.

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

* Re: [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config
@ 2022-09-28 14:22   ` Robert Foss
  0 siblings, 0 replies; 24+ messages in thread
From: Robert Foss @ 2022-09-28 14:22 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: Neil Armstrong, Andrzej Hajda, Jonas Karlman, David Airlie,
	dri-devel, linux-kernel, Jernej Skrabec, Philippe Schenker,
	Adrien Grassein, Laurent Pinchart

On Thu, 22 Sept 2022 at 14:43, Philippe Schenker <dev@pschenker.ch> wrote:
>
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> This patch-set fixes the lt8912b driver that currently does not take
> care whether or not the attached display has postiive or negative syncs
> and or reports on EDID if it needs HDMI mode or DVI.
>
> This series addresses also an issue where the LVDS startup sequence was
> written to the wrong I2C address (the lt8912 has three). This caused
> writing into reserved registers and causing an unstable HDMI picture
> that manifests itself only sometimes and depending on the monitor with a
> flickering and a repeating of going black and coming up again. While at
> it move also some sensible comments to the sequence.
>
>
> Francesco Dolcini (2):
>   drm/bridge: lt8912b: fix corrupted image output
>   drm/bridge: lt8912b: clarify lvds output status
>
> Philippe Schenker (2):
>   drm/bridge: lt8912b: add vsync hsync
>   drm/bridge: lt8912b: set hdmi or dvi mode
>
>  drivers/gpu/drm/bridge/lontium-lt8912b.c | 39 +++++++++++++++++-------
>  1 file changed, 28 insertions(+), 11 deletions(-)
>
> --
> 2.37.3
>

Thanks for the series & the reviews.

Applied to drm-misc-next.

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

end of thread, other threads:[~2022-09-28 14:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 12:43 [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config Philippe Schenker
2022-09-22 12:43 ` Philippe Schenker
2022-09-22 12:43 ` [PATCH 1/4] drm/bridge: lt8912b: add vsync hsync Philippe Schenker
2022-09-22 12:43   ` Philippe Schenker
2022-09-22 18:24   ` Adrien Grassein
2022-09-22 18:24     ` Adrien Grassein
2022-09-22 12:43 ` [PATCH 2/4] drm/bridge: lt8912b: set hdmi or dvi mode Philippe Schenker
2022-09-22 12:43   ` Philippe Schenker
2022-09-22 18:25   ` Adrien Grassein
2022-09-22 18:25     ` Adrien Grassein
2022-09-22 12:43 ` [PATCH 3/4] drm/bridge: lt8912b: fix corrupted image output Philippe Schenker
2022-09-22 12:43   ` Philippe Schenker
2022-09-22 18:26   ` Adrien Grassein
2022-09-22 18:26     ` Adrien Grassein
2022-09-22 12:43 ` [PATCH 4/4] drm/bridge: lt8912b: clarify lvds output status Philippe Schenker
2022-09-22 12:43   ` Philippe Schenker
2022-09-22 18:26   ` Adrien Grassein
2022-09-22 18:26     ` Adrien Grassein
2022-09-23  9:22 ` (subset) [PATCH 0/4] drm/bridge: lt8912b: Fix corrupt display output due to wrong bridge config Neil Armstrong
2022-09-23  9:22   ` Neil Armstrong
2022-09-23  9:25 ` Neil Armstrong
2022-09-23  9:25   ` Neil Armstrong
2022-09-28 14:22 ` Robert Foss
2022-09-28 14:22   ` Robert Foss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.