Skip to contentSkip to conversation

dt-bindings: display: bridge: ldb: Document nxp, enable-termination-resistor

PATCH Applied Fabio Estevam 3 participants 7 messages Jan 20 – Jan 28

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dt-bindings: display: bridge: ldb: Document nxp, enable-termination-resistor

From: Fabio Estevam <[email protected]>

Document the optional nxp,enable-termination-resistor property for the i.MX LVDS display bridge.

This boolean property indicates that the built-in 100 Ohm termination resistor on the LVDS output is enabled. It is controlled via the HS_EN bit in the LVDS_CTRL register. Enabling the resistor can improve LVDS signal quality and may prevent visual artifacts on some boards, but increases the power consumption.

---
Changes since v1:
- Restrict it to i.MX6SX. (Liu Ying)

 .../bindings/display/bridge/fsl,ldb.yaml       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml +18 -0
index 49664101a353..7f380879fffd 100644
@@ -35,6 +35,15 @@ properties:
       - const: ldb
       - const: lvds
 
+  nxp,enable-termination-resistor:
+    type: boolean
+    description:
+      Indicates that the built-in 100 Ohm termination resistor on the LVDS
+      output is enabled. This property is optional and controlled via the
+      HS_EN bit in the LVDS_CTRL register. Enabling it can improve signal
+      quality and prevent visual artifacts on some boards, but increases
+      power consumption.
+
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
 
@@ -84,6 +93,15 @@ allOf:
       required:
         - reg-names
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: fsl,imx6sx-ldb
+    then:
+      properties:
+        nxp,enable-termination-resistor: false
+
 additionalProperties: false
 
 examples:
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 2/2 drm/bridge: fsl-ldb: Allow the termination resistor to be enabled

From: Fabio Estevam <[email protected]>

The LVDS Control Register (LVDS_CTRL) register has an HS_EN bit that allows the 100 Ohm termination resistor in the chip to be enabled.

Add support to setting the HS_EN bit when the optional property "nxp,enable-termination-resistor" is present.

The motivation for introducing this property was a custom i.MX8MP board that was showing visual artifacts. After enabling the 100 Ohm termination resistor the LVDS signal quality improved causing the artifacts to disappear.

---
Changes since v2:
- Rename variable to 'use_termination_resistor'. (Liu Ying)
- Remove clearing the LVDS_CTRL_HS_EN bit. (Liu Ying)
- Use dev->of_node. (Liu Ying)

 drivers/gpu/drm/bridge/fsl-ldb.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/bridge/fsl-ldb.c +7 -0
index 5c3cf37200bc..7b71cde173e0 100644
@@ -92,6 +92,7 @@ struct fsl_ldb {
 	const struct fsl_ldb_devdata *devdata;
 	bool ch0_enabled;
 	bool ch1_enabled;
+	bool use_termination_resistor;
 };
 
 static bool fsl_ldb_is_dual(const struct fsl_ldb *fsl_ldb)
@@ -212,6 +213,9 @@ static void fsl_ldb_atomic_enable(struct drm_bridge *bridge,
 	/* Program LVDS_CTRL */
 	reg = LVDS_CTRL_CC_ADJ(2) | LVDS_CTRL_PRE_EMPH_EN |
 	      LVDS_CTRL_PRE_EMPH_ADJ(3) | LVDS_CTRL_VBG_EN;
+
+	if (fsl_ldb->use_termination_resistor)
+		reg |= LVDS_CTRL_HS_EN;
 	regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->lvds_ctrl, reg);
 
 	/* Wait for VBG to stabilize. */
@@ -340,6 +344,9 @@ static int fsl_ldb_probe(struct platform_device *pdev)
 	if (IS_ERR(panel))
 		return PTR_ERR(panel);
 
+	if (of_property_present(dev->of_node, "nxp,enable-termination-resistor"))
+		fsl_ldb->use_termination_resistor = true;
+
 	fsl_ldb->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
 	if (IS_ERR(fsl_ldb->panel_bridge))
 		return PTR_ERR(fsl_ldb->panel_bridge);
Signature · 1 line
2.34.1
Reviewed-by on v3 2/2
#2 lore raw

Re: [PATCH v3 2/2] drm/bridge: fsl-ldb: Allow the termination resistor to be enabled

Quoted 14 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The LVDS Control Register (LVDS_CTRL) register has an HS_EN bit that allows the 100 Ohm termination resistor in the chip to be enabled.

Add support to setting the HS_EN bit when the optional property "nxp,enable-termination-resistor" is present.

The motivation for introducing this property was a custom i.MX8MP board that was showing visual artifacts. After enabling the 100 Ohm termination resistor the LVDS signal quality improved causing the artifacts to disappear.

Quoted 8 lines

---
Changes since v2:
- Rename variable to 'use_termination_resistor'. (Liu Ying)
- Remove clearing the LVDS_CTRL_HS_EN bit. (Liu Ying)
- Use dev->of_node. (Liu Ying)

 drivers/gpu/drm/bridge/fsl-ldb.c | 7 +++++++
 1 file changed, 7 insertions(+)

Thanks!

Signature · 2 lines
Regards,
Liu Ying
#3 lore raw

Re: [PATCH v3 2/2] drm/bridge: fsl-ldb: Allow the termination resistor to be enabled

Hi Liu Ying,

Quoted 24 lines · Liu Ying
Quoted 20 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The LVDS Control Register (LVDS_CTRL) register has an HS_EN bit that allows the 100 Ohm termination resistor in the chip to be enabled.

Add support to setting the HS_EN bit when the optional property "nxp,enable-termination-resistor" is present.

The motivation for introducing this property was a custom i.MX8MP board that was showing visual artifacts. After enabling the 100 Ohm termination resistor the LVDS signal quality improved causing the artifacts to disappear.

---
Changes since v2:
- Rename variable to 'use_termination_resistor'. (Liu Ying)
- Remove clearing the LVDS_CTRL_HS_EN bit. (Liu Ying)
- Use dev->of_node. (Liu Ying)

Quoted 4 lines
Quoted 2 lines
 drivers/gpu/drm/bridge/fsl-ldb.c | 7 +++++++
 1 file changed, 7 insertions(+)

Could you please help apply this series?

Applied
#4 lore raw

Re: [PATCH v3 2/2] drm/bridge: fsl-ldb: Allow the termination resistor to be enabled

In reply to Fabio Estevam
Quoted 46 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The LVDS Control Register (LVDS_CTRL) register has an HS_EN bit that allows the 100 Ohm termination resistor in the chip to be enabled.

Add support to setting the HS_EN bit when the optional property "nxp,enable-termination-resistor" is present.

The motivation for introducing this property was a custom i.MX8MP board that was showing visual artifacts. After enabling the 100 Ohm termination resistor the LVDS signal quality improved causing the artifacts to disappear.

---
Changes since v2:
- Rename variable to 'use_termination_resistor'. (Liu Ying)
- Remove clearing the LVDS_CTRL_HS_EN bit. (Liu Ying)
- Use dev->of_node. (Liu Ying)

 drivers/gpu/drm/bridge/fsl-ldb.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/bridge/fsl-ldb.c +4 -0
index 5c3cf37200bc..7b71cde173e0 100644
@@ -92,6 +92,7 @@ struct fsl_ldb {
 	const struct fsl_ldb_devdata *devdata;
 	bool ch0_enabled;
 	bool ch1_enabled;
+	bool use_termination_resistor;
 };
 
 static bool fsl_ldb_is_dual(const struct fsl_ldb *fsl_ldb)
@@ -212,6 +213,9 @@ static void fsl_ldb_atomic_enable(struct drm_bridge *bridge,
 	/* Program LVDS_CTRL */
 	reg = LVDS_CTRL_CC_ADJ(2) | LVDS_CTRL_PRE_EMPH_EN |
 	      LVDS_CTRL_PRE_EMPH_ADJ(3) | LVDS_CTRL_VBG_EN;
+
+	if (fsl_ldb->use_termination_resistor)
+		reg |= LVDS_CTRL_HS_EN;
 	regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->lvds_ctrl, reg);
 
 	/* Wait for VBG to stabilize. */

drivers/gpu/drm/bridge/fsl-ldb.c static int fsl_ldb_probe(struct platform_device *pdev) · line 352

Quoted 9 lines
drivers/gpu/drm/bridge/fsl-ldb.c +3 -0
@@ -340,6 +344,9 @@ static int fsl_ldb_probe(struct platform_device *pdev)
 	if (IS_ERR(panel))
 		return PTR_ERR(panel);
 
+	if (of_property_present(dev->of_node, "nxp,enable-termination-resistor"))
+		fsl_ldb->use_termination_resistor = true;
+
 	fsl_ldb->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
 	if (IS_ERR(fsl_ldb->panel_bridge))
 		return PTR_ERR(fsl_ldb->panel_bridge);

Applied to misc/kernel.git (drm-misc-next). Thanks!

Signature · 2 lines
Regards,
Liu Ying
maintainer Acked-by on v3 1/2
#5 lore raw

Re: [PATCH v3 1/2] dt-bindings: display: bridge: ldb: Document nxp,enable-termination-resistor

In reply to Fabio Estevam
Quoted 11 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Document the optional nxp,enable-termination-resistor property for the i.MX LVDS display bridge.

This boolean property indicates that the built-in 100 Ohm termination resistor on the LVDS output is enabled. It is controlled via the HS_EN bit in the LVDS_CTRL register. Enabling the resistor can improve LVDS signal quality and may prevent visual artifacts on some boards, but increases the power consumption.

Quoted 8 lines

---
Changes since v1:
- Restrict it to i.MX6SX. (Liu Ying)

 .../bindings/display/bridge/fsl,ldb.yaml       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Applied
#6 lore raw

Re: [PATCH v3 1/2] dt-bindings: display: bridge: ldb: Document nxp,enable-termination-resistor

In reply to Fabio Estevam
Quoted 45 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Document the optional nxp,enable-termination-resistor property for the i.MX LVDS display bridge.

This boolean property indicates that the built-in 100 Ohm termination resistor on the LVDS output is enabled. It is controlled via the HS_EN bit in the LVDS_CTRL register. Enabling the resistor can improve LVDS signal quality and may prevent visual artifacts on some boards, but increases the power consumption.

---
Changes since v1:
- Restrict it to i.MX6SX. (Liu Ying)

 .../bindings/display/bridge/fsl,ldb.yaml       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml +11 -0
index 49664101a353..7f380879fffd 100644
@@ -35,6 +35,15 @@ properties:
       - const: ldb
       - const: lvds
 
+  nxp,enable-termination-resistor:
+    type: boolean
+    description:
+      Indicates that the built-in 100 Ohm termination resistor on the LVDS
+      output is enabled. This property is optional and controlled via the
+      HS_EN bit in the LVDS_CTRL register. Enabling it can improve signal
+      quality and prevent visual artifacts on some boards, but increases
+      power consumption.
+
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
 
@@ -84,6 +93,15 @@ allOf:
       required:
         - reg-names
 
+  - if:
+      properties:

Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml allOf: · line 107

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml +7 -0
+        compatible:
+          contains:
+            const: fsl,imx6sx-ldb
+    then:
+      properties:
+        nxp,enable-termination-resistor: false
+
 additionalProperties: false
 
 examples:

Applied to misc/kernel.git (drm-misc-next). Thanks!

Signature · 2 lines
Regards,
Liu Ying