Skip to contentSkip to conversation

drm/bridge: lt9211: Add drive-strength-microamp DT property

PATCH In review Boerge Struempfel 3 participants 10 messages May 13 – May 14

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

v2 cover drm/bridge: lt9211: Add drive-strength-microamp DT property

The LT9211 LVDS TX output driver current is currently hardcoded to 0x8 (~25 uA). Some board layouts require a different drive strength to meet signal integrity requirements.

This series adds support for the standard 'drive-strength-microamp' DT property, allowing board DTs to select one of sixteen discrete current levels between 12 uA and 36 uA. The default preserves the existing behaviour.

Changes in v2:
- Use u8 instead of u32 for the lookup table array (values fit in u8)
- Warn when drive-strength-microamp exists in DT but is malformed

Link to v1: https://lore.kernel.org/dri-devel/[email protected]/

Boerge Struempfel (2):
dt-bindings: display/bridge: lt9211: Add drive-strength-microamp
property
drm/bridge: lt9211: Add drive-strength-microamp DT property

 .../display/bridge/lontium,lt9211.yaml        |  7 +++++
 drivers/gpu/drm/bridge/lontium-lt9211.c       | 31 ++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletion(-)
Signature · 1 line
2.54.0
#1 lore raw

PATCH v2 1/2 dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

Add the 'drive-strength-microamp' property to allow board DTs to configure the LT9211 LVDS TX output driver current. Sixteen discrete levels are supported, ranging from 12 uA to 36 uA. Defaults to 25 uA.

---
 .../devicetree/bindings/display/bridge/lontium,lt9211.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml +7 -0
index 9a6e9b25d14a..381b69c761b8 100644
@@ -31,6 +31,13 @@ properties:
   vccio-supply:
     description: Regulator for 1.8V IO power.
 
+  drive-strength-microamp:
+    description:
+      LVDS TX output driver current. Sixteen discrete levels are supported,
+      corresponding to the following nominal values in microamps.
+    enum: [12, 14, 16, 17, 19, 20, 22, 23, 25, 27, 28, 30, 31, 33, 34, 36]
+    default: 25
+
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
 
Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

Quoted 6 lines · Boerge Struempfel

Add the 'drive-strength-microamp' property to allow board DTs to configure the LT9211 LVDS TX output driver current. Sixteen discrete levels are supported, ranging from 12 uA to 36 uA. Defaults to 25 uA.

AB goes before SoB line.

#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

Quoted 9 lines · Marek Vasut
Quoted 6 lines · Boerge Struempfel

Add the 'drive-strength-microamp' property to allow board DTs to configure the LT9211 LVDS TX output driver current. Sixteen discrete levels are supported, ranging from 12 uA to 36 uA. Defaults to 25 uA.

AB goes before SoB line.

Thank you Marek. I will fix this in v3.

Signature · 6 lines
Best regards,
Börge Strümpfel

DATA MODUL AG
Landsberger Str. 322
80687 München
#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

In reply to Boerge Struempfel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The values for `drive-strength-microamp` are scaled incorrectly by a factor of 100, violating the…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The values for drive-strength-microamp are scaled incorrectly by a factor of 100, violating the standard device tree unit suffix. --

commit ab265d46e886455894986f313701d72a9407a58e
Author: Boerge Struempfel <[email protected]>

dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

This commit adds the drive-strength-microamp property to configure the LT9211 LVDS TX output driver current. It specifies sixteen discrete levels ranging from 12 to 36.

Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml +0 -0

[ ... ]

Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml properties: · line 38

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml +5 -0
+  drive-strength-microamp:
+    description:
+      LVDS TX output driver current. Sixteen discrete levels are supported,
+      corresponding to the following nominal values in microamps.
+    enum: [12, 14, 16, 17, 19, 20, 22, 23, 25, 27, 28, 30, 31, 33, 34, 36]

Are these values scaled incorrectly for a property ending in -microamp?

Properties with the -microamp suffix typically require values in true microamperes. A standard LVDS driver requires differential currents in the milliamp range, typically 1.25 mA to 3.59 mA, to generate a standard 350 mV swing over a 100-ohm termination.

Values from 12 to 36 microamps appear to be physically insufficient for LVDS signaling.

If the actual intended currents are 1.25 mA to 3.59 mA, shouldn't the enum values be 1250, 1406, 1562, up to 3594 to accurately reflect true microamperes?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#5 lore raw

Re: [PATCH v2 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

Quoted 4 lines · On Thu, May 14, 2026 at 05:26:03AM +0000, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The values for drive-strength-microamp are scaled incorrectly by a factor of 100, violating the standard device tree unit suffix. --

Thank you for your review

Quoted 26 lines

commit ab265d46e886455894986f313701d72a9407a58e
Author: Boerge Struempfel <[email protected]>

dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property

This commit adds the drive-strength-microamp property to configure the LT9211 LVDS TX output driver current. It specifies sixteen discrete levels ranging from 12 to 36.

Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml +0 -0

[ ... ]

Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml properties: · line 38

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/lontium,lt9211.yaml +5 -0
+  drive-strength-microamp:
+    description:
+      LVDS TX output driver current. Sixteen discrete levels are supported,
+      corresponding to the following nominal values in microamps.
+    enum: [12, 14, 16, 17, 19, 20, 22, 23, 25, 27, 28, 30, 31, 33, 34, 36]

Are these values scaled incorrectly for a property ending in -microamp?

Properties with the -microamp suffix typically require values in true microamperes. A standard LVDS driver requires differential currents in the milliamp range, typically 1.25 mA to 3.59 mA, to generate a standard 350 mV swing over a 100-ohm termination.

Quoted 7 lines

Values from 12 to 36 microamps appear to be physically insufficient for LVDS signaling.

If the actual intended currents are 1.25 mA to 3.59 mA, shouldn't the enum values be 1250, 1406, 1562, up to 3594 to accurately reflect true microamperes?

I double-checked the partial datasheet I was provided by Lontium. It states for RG_MLTX_HSDRV_ISEL: "Port A/B mipi/lvds tx hstx current select, 4'b0000 = 12.5 µA, 4'b1111 = 35.9735 µA, step = 1.5625 µA". Those are the values I took as a reference for this commit. However, I did not measure them myself and this might be a mistake in the datasheet or there might be some amplification happening after, which is not described in the part of the datasheet I got.

Maybe someone else has more insight into this?

In the meantime, I will try to follow up with our hardware team and try to contact Lontium to clarify where this discrepancy between the datasheet values and the expected LVDS output current range comes from.

Quoted 2 lines
Signature · 1 line
Sashiko AI review   https://sashiko.dev/#/patchset/[email protected]?part=1
Signature · 6 lines
Best regards,
Börge Strümpfel

DATA MODUL AG
Landsberger Str. 322
80687 München
#6 lore raw

PATCH v2 2/2 drm/bridge: lt9211: Add drive-strength-microamp DT property

In reply to Boerge Struempfel

The LT9211 LVDS TX output driver current (RG_MLTX_HSDRV_ISEL) was previously hardcoded to 0x8 (~25 uA), which may not be optimal for all board layouts.

The hardware supports 16 discrete current levels starting at 12.5 uA with a step of 1.5625 uA. These are exposed as rounded integer microamp values in the lookup table.

Add support for the 'drive-strength-microamp' DT property. A lookup table maps the sixteen supported microamp values (12..36 uA) to the corresponding register field. Defaults to 25 uA when the property is absent, preserving the existing behaviour.

---
 drivers/gpu/drm/bridge/lontium-lt9211.c | 31 ++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9211.c +30 -1
index 03fc8fd10f20..5edd2d2e3da6 100644
@@ -40,6 +40,11 @@
 /* DSI lane count - 0 means 4 lanes ; 1, 2, 3 means 1, 2, 3 lanes. */
 #define REG_DSI_LANE_COUNT(n)			((n) & 3)
 
+/* Maps register value (index) to drive-strength-microamp DT property value */
+static const u8 lt9211_hsdrv_microamp[] = {
+	12, 14, 16, 17, 19, 20, 22, 23, 25, 27, 28, 30, 31, 33, 34, 36
+};
+
 struct lt9211 {
 	struct drm_bridge		bridge;
 	struct device			*dev;
@@ -50,6 +55,7 @@ struct lt9211 {
 	struct regulator		*vccio;
 	bool				lvds_dual_link;
 	bool				lvds_dual_link_even_odd_swap;
+	u8				lvds_hsdrv_isel;
 };
 
 static const struct regmap_range lt9211_rw_ranges[] = {
@@ -374,7 +380,8 @@ static int lt9211_configure_tx(struct lt9211 *ctx, bool jeida,
 		/* BIT(7) is LVDS dual-port */
 		{ 0x823b, 0x38 | (ctx->lvds_dual_link ? BIT(7) : 0) },
 		{ 0x823e, 0x92 },
-		{ 0x823f, 0x48 },
+		/* bits 3:0: RG_MLTX_HSDRV_ISEL, LVDS TX driver current */
+		{ 0x823f, 0x40 | ctx->lvds_hsdrv_isel },
 		{ 0x8240, 0x31 },
 		{ 0x8243, 0x80 },
 		{ 0x8244, 0x00 },
@@ -629,7 +636,9 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
 	struct device *dev = ctx->dev;
 	struct drm_panel *panel;
 	int dual_link;
+	u32 microamp;
 	int ret;
+	int i;
 
 	ctx->vccio = devm_regulator_get(dev, "vccio");
 	if (IS_ERR(ctx->vccio))
@@ -666,6 +675,26 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
 
 	ctx->panel_bridge = panel_bridge;
 
+	ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
+	ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
+				   &microamp);
+	if (!ret) {
+		for (i = 0; i < ARRAY_SIZE(lt9211_hsdrv_microamp); i++) {
+			if (lt9211_hsdrv_microamp[i] == microamp) {
+				ctx->lvds_hsdrv_isel = i;
+				break;
+			}
+		}
+		if (i == ARRAY_SIZE(lt9211_hsdrv_microamp)) {
+			dev_err(dev, "Invalid drive-strength-microamp value %u\n",
+				microamp);
+			return -EINVAL;
+		}
+	} else if (ret != -EINVAL) {
+		dev_warn(dev, "Failed to read drive-strength-microamp: %d, using default\n",
+			 ret);
+	}
+
 	return 0;
 }
 
Signature · 1 line
2.54.0
#7 lore raw

On 5/13/26 3:31 PM, Boerge Struempfel wrote:

[...]

drivers/gpu/drm/bridge/lontium-lt9211.c static int lt9211_parse_dt(struct lt9211 *ctx) · line 680

Quoted 7 lines
drivers/gpu/drm/bridge/lontium-lt9211.c +3 -0
@@ -666,6 +675,26 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
 
  	ctx->panel_bridge = panel_bridge;
 
+	ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
+	ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
+				   &microamp);

if (ret && ret != -EINVAL) {
... error handling ...
return ret;
}

Then you won't need the if (!ret) conditional and can reduce indent.

I also wonder whether it wouldn't be better to simply bail with dev_err_probe() if the property is invalid, let the user know they should fix their DTs before it is too late.

Quoted 12 lines
drivers/gpu/drm/bridge/lontium-lt9211.c +12 -0
+	if (!ret) {
+		for (i = 0; i < ARRAY_SIZE(lt9211_hsdrv_microamp); i++) {
+			if (lt9211_hsdrv_microamp[i] == microamp) {
+				ctx->lvds_hsdrv_isel = i;
+				break;
+			}
+		}
+		if (i == ARRAY_SIZE(lt9211_hsdrv_microamp)) {
+			dev_err(dev, "Invalid drive-strength-microamp value %u\n",
+				microamp);
+			return -EINVAL;
+		}

[...]

Quoted 3 lines

+
return 0;
}

#8 lore raw
Quoted 17 lines · Marek Vasut

On 5/13/26 3:31 PM, Boerge Struempfel wrote:

[...]

drivers/gpu/drm/bridge/lontium-lt9211.c static int lt9211_parse_dt(struct lt9211 *ctx) · line 680

Quoted 7 lines
drivers/gpu/drm/bridge/lontium-lt9211.c +3 -0
@@ -666,6 +675,26 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
 
  	ctx->panel_bridge = panel_bridge;
 
+	ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
+	ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
+				   &microamp);
if (ret && ret != -EINVAL) {
   ... error handling ...
   return ret;
}
Quoted 1 line

Then you won't need the if (!ret) conditional and can reduce indent.

Thank you for this suggestion. We will than need to do the lookup even in case of no value being supplied, but that would make the code cleaner. Therefore I am changing this in v3.

Quoted 4 lines

I also wonder whether it wouldn't be better to simply bail with dev_err_probe() if the property is invalid, let the user know they should fix their DTs before it is too late.

Ok. I'll change that in v3.

Quoted 20 lines
Quoted 13 lines
drivers/gpu/drm/bridge/lontium-lt9211.c +12 -0
+	if (!ret) {
+		for (i = 0; i < ARRAY_SIZE(lt9211_hsdrv_microamp); i++) {
+			if (lt9211_hsdrv_microamp[i] == microamp) {
+				ctx->lvds_hsdrv_isel = i;
+				break;
+			}
+		}
+		if (i == ARRAY_SIZE(lt9211_hsdrv_microamp)) {
+			dev_err(dev, "Invalid drive-strength-microamp value %u\n",
+				microamp);
+			return -EINVAL;
+		}

[...]

Quoted 3 lines

+
return 0;
}

Signature · 6 lines
Best regards,
Börge Strümpfel

DATA MODUL AG
Landsberger Str. 322
80687 München
#9 lore raw
Quoted 18 lines · Börge Strümpfel
Quoted 17 lines · Marek Vasut

On 5/13/26 3:31 PM, Boerge Struempfel wrote:

[...]

drivers/gpu/drm/bridge/lontium-lt9211.c static int lt9211_parse_dt(struct lt9211 *ctx) · line 680

Quoted 7 lines
drivers/gpu/drm/bridge/lontium-lt9211.c +3 -0
@@ -666,6 +675,26 @@ static int lt9211_parse_dt(struct lt9211 *ctx)
 
   	ctx->panel_bridge = panel_bridge;
 
+	ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
+	ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
+				   &microamp);
if (ret && ret != -EINVAL) {
    ... error handling ...
    return ret;
}
Quoted 5 lines
Quoted 1 line

Then you won't need the if (!ret) conditional and can reduce indent.

Thank you for this suggestion. We will than need to do the lookup even in case of no value being supplied, but that would make the code cleaner. Therefore I am changing this in v3.

of_property_read_u32() returns -ENODATA if property does not have a value -> the error handling above would detect that.