Skip to contentSkip to conversation

drm: bridge: Add TI tmds181 and sn65dp159 driver

PATCH Superseded Mike Looijmans 3 participants 5 messages Sep 8, 2025 – Sep 10, 2025 1 message not in the archive

Subsystems (4)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.57586665-3488-4462-a637-86a93c4d061d@emailsignatures365.codetwo.com

#1 lore raw

v5 cover drm: bridge: Add TI tmds181 and sn65dp159 driver

In the past I've seen (and contributed to) hacks that model the chips as phy or even (really!) clock drivers. Since the chip usually sits between a signal that is (almost) HDMI and a HDMI connector, I decided to stop lying and write it as a DRM bridge driver.

Our experience with these chips is that they work best under manual control enabling them only once the signal is active. At low resolutions (under 4k), the optimal setting is usually to only use redriver mode. Setting the termination to 150-300 Ohms improves EMC performance at lower resolutions, hence the driver enables 75-150 Ohms for HDMI2 modes and defaults to 150-300 Ohm termination for other modes.

Changes in v5:
ti,equalizer and ti,mode changed to enum
Rename ti,slew-rate to slew-rate
Make properties conditional for DP159/TMDS181
Remove ti,dvi-mode (always set to avoid conflict)
Really added vcc/vdd regulator support
"oe" gpio is now "reset" (reversed logic)
devicetree enums ti,equalizer and ti,mode
Always disable HDMI_SEL (formerly "dvi-mode")

Changes in v4:
Use fallback compatible
dev_err_probe, this_module, of_match_ptr
Use fallback compatible
Add vcc-supply and vdd-supply

Changes in v3:
Fix duplicate links
Add vcc-supply and vdd-supply
Fix missing type for ti,slew-rate
Lower-case hex values and use defines for EYESCAN registers Remove equalizer code (unlikely to be used)
Remove attributes (no longer useful, undocumented) Fix build for 6.17 kernel
Use devm_drm_bridge_alloc
Sort includes and add linux/bitfield.h
Check chip type and complain on mismatch

Changes in v2:
Document driver specific bindings like slew-rate and threshold Use atomic_enable/disable
Use #defines for bit fields in registers
Allow HDMI 2 compliance
Filter modes on clock range
Use cross-over pixel frequency instead of manual overides Devicetree bindings according to standards

Mike Looijmans (2):
dt-bindings: drm/bridge: ti-tmds181: Add TI TMDS181 and SN65DP159
bindings
drm: bridge: Add TI tmds181 and sn65dp159 driver

 .../bindings/display/bridge/ti,tmds181.yaml   | 170 +++++++
 drivers/gpu/drm/bridge/Kconfig                |  11 +
 drivers/gpu/drm/bridge/Makefile               |   1 +
 drivers/gpu/drm/bridge/ti-tmds181.c           | 427 ++++++++++++++++++
 4 files changed, 609 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,tmds181.yaml
 create mode 100644 drivers/gpu/drm/bridge/ti-tmds181.c
Signature · 20 lines
2.43.0

base-commit: 53e760d8949895390e256e723e7ee46618310361
branch: drm-ti-tmds181

Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl

Please consider the environment before printing this e-mail
#2 lore raw

PATCH v5 1/2 dt-bindings: drm/bridge: ti-tmds181: Add TI TMDS181 and SN65DP159 bindings

Add DT binding document for TI TMDS181 and SN65DP159 HDMI retimers.

The two chips have similar register maps, but different applications (source vs. sink).

binding

---

Changes in v5:
ti,equalizer and ti,mode changed to enum
Rename ti,slew-rate to slew-rate
Make properties conditional for DP159/TMDS181
Remove ti,dvi-mode (always set to avoid conflict)

Changes in v4:
Use fallback compatible

Changes in v3:
Fix duplicate links
Add vcc-supply and vdd-supply
Fix missing type for ti,slew-rate

Changes in v2:
Document driver specific bindings like slew-rate and threshold

 .../bindings/display/bridge/ti,tmds181.yaml   | 170 ++++++++++++++++++
 1 file changed, 170 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ti,tmds181.yaml
Documentation/devicetree/bindings/display/bridge/ti,tmds181.yaml new file +170 -0
new file mode 100644
index 000000000000..aad4cc57dfef
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,tmds181.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TMDS181 and SN65DP159 HDMI retimer/redriver chips
+
+maintainers:
+  - Mike Looijmans <[email protected]>
+
+description: |
+  Texas Instruments TMDS181 and SN65DP159 retimer and redriver chips.
+  https://www.ti.com/product/TMDS181
+  https://www.ti.com/product/SN65DP159
+  When I2C control is enabled, various pin strapping options like equalizer and
+  slew-rate are unavailable. These can be configured through I2C using the
+  properties defined here.
+  A common application for these chips is to convert AC coupled serdes outputs
+  from an FPGA or SoC into HDMI compliant signals.
+
+properties:
+  compatible:
+    oneOf:
+      - const: ti,tmds181
+      - items:
+          - const: ti,sn65dp159
+          - const: ti,tmds181
+
+  reg:
+    enum:
+      - 0x5b
+      - 0x5c
+      - 0x5d
+      - 0x5e
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO specifier for OE pin which acts as active low reset.
+
+  vdd-supply:
+    description: Core power supply, 1.1V
+
+  vcc-supply:
+    description: IO power supply, 3.3V
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: Video port for HDMI (ish) input
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: Video port for HDMI output (panel or bridge)
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+    required:
+      - port@0
+      - port@1
+
+  ti,mode:
+    enum:
+      - source
+      - sink
+    description:
+      Force chip to operate in "source" or "sink" mode.
+
+  ti,retimer-threshold-hz:
+    minimum: 25000000
+    maximum: 600000000
+    default: 200000000
+    description:
+      Cross-over point. Up until this pixel clock frequency the chip remains in
+      the low-power redriver mode. Above the threshold the chip should operate
+      in retimer mode.
+
+  slew-rate:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 3
+    default: 3
+    description: Set slew rate, 0 is slowest, 3 is fastest.
+
+  ti,equalizer:
+    enum:
+      - adaptive
+      - disabled
+      - fixed
+    default: adaptive
+    description: Configure the equalizer
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: ti,sn65dp159
+
+then:
+  properties:
+    ti,mode:
+      default: source
+
+else:
+  properties:
+    ti,mode:
+      default: sink
+    slew-rate: false
+
+required:
+  - compatible
+  - reg
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        bridge@5b {
+            compatible = "ti,sn65dp159", "ti,tmds181";
+            reg = <0x5b>;
+            vdd-supply = <&vcc_1v1_reg>;
+            vcc-supply = <&vcc_3v3_reg>;
+            reset-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+            slew-rate = <2>;
+            ti,retimer-threshold-hz = <350000000>;
+            ti,mode = "source";
+            ti,equalizer = "disabled";
+
+            ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                port@0 {
+                    reg = <0>;
+
+                    endpoint {
+                        remote-endpoint = <&encoder_out>;
+                    };
+                };
+
+                port@1 {
+                    reg = <1>;
+
+                    endpoint {
+                        remote-endpoint = <&hdmi_connector_in>;
+                    };
+                };
+            };
+        };
+    };
Signature · 18 lines
2.43.0


Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl

Please consider the environment before printing this e-mail
#3 lore raw

Re: [PATCH v5 1/2] dt-bindings: drm/bridge: ti-tmds181: Add TI TMDS181 and SN65DP159 bindings

Quoted 8 lines · Mike Looijmans

Add DT binding document for TI TMDS181 and SN65DP159 HDMI retimers.

The two chips have similar register maps, but different applications (source vs. sink).

binding

This does not belong here.

Quoted 3 lines

---

...

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/ti,tmds181.yaml new file +5 -0
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description: Video port for HDMI output (panel or bridge)
+

Documentation/devicetree/bindings/display/bridge/ti,tmds181.yaml line 75

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/ti,tmds181.yaml new file +10 -0
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+    required:
+      - port@0
+      - port@1
+
+  ti,mode:

Conflicting type. There is already ti,mode as uint8. Anyway name is too generic, so maybe ti,retimer-mode

Best regards,
Krzysztof

#4 lore raw

PATCH v5 2/2 drm: bridge: Add TI tmds181 and sn65dp159 driver

In reply to Mike Looijmans

The tmds181 and sn65dp159 are "retimers" and hence can be considered HDMI-to-HDMI bridges. Typical usage is to convert the output of an FPGA into a valid HDMI signal, and it will typically be inserted between an encoder and hdmi-connector.

---

Changes in v5:
Really added vcc/vdd regulator support
"oe" gpio is now "reset" (reversed logic)
devicetree enums ti,equalizer and ti,mode
Always disable HDMI_SEL (formerly "dvi-mode")

Changes in v4:
dev_err_probe, this_module, of_match_ptr
Use fallback compatible
Add vcc-supply and vdd-supply

Changes in v3:
Lower-case hex values and use defines for EYESCAN registers Remove equalizer code (unlikely to be used)
Remove attributes (no longer useful, undocumented) Fix build for 6.17 kernel
Use devm_drm_bridge_alloc
Sort includes and add linux/bitfield.h
Check chip type and complain on mismatch

Changes in v2:
Use atomic_enable/disable
Use #defines for bit fields in registers
Allow HDMI 2 compliance
Filter modes on clock range
Use cross-over pixel frequency instead of manual overides Devicetree bindings according to standards

 drivers/gpu/drm/bridge/Kconfig      |  11 +
 drivers/gpu/drm/bridge/Makefile     |   1 +
 drivers/gpu/drm/bridge/ti-tmds181.c | 427 ++++++++++++++++++++++++++++
 3 files changed, 439 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ti-tmds181.c
drivers/gpu/drm/bridge/Kconfig +11 -0
index b9e0ca85226a..753177fc9b50 100644
@@ -430,6 +430,17 @@ config DRM_TI_SN65DSI86
 	help
 	  Texas Instruments SN65DSI86 DSI to eDP Bridge driver
 
+config DRM_TI_TMDS181
+        tristate "TI TMDS181 and SN65DP159 HDMI retimer bridge driver"
+	depends on OF
+	select DRM_KMS_HELPER
+	select REGMAP_I2C
+	help
+	  Enable this to support the TI TMDS181 and SN65DP159 HDMI retimers.
+	  The SN65DP159 provides output into a cable (source) whereas the
+	  TMDS181 is meant to forward a cable signal into a PCB (sink). Either
+	  can be set up as source or sink though.
+
 config DRM_TI_TPD12S015
 	tristate "TI TPD12S015 HDMI level shifter and ESD protection"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index 245e8a27e3fc..f4b5089e903c 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_DRM_TI_SN65DSI83) += ti-sn65dsi83.o
 obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
 obj-$(CONFIG_DRM_TI_TDP158) += ti-tdp158.o
 obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
+obj-$(CONFIG_DRM_TI_TMDS181) += ti-tmds181.o
 obj-$(CONFIG_DRM_TI_TPD12S015) += ti-tpd12s015.o
 obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.o
 obj-$(CONFIG_DRM_ITE_IT66121) += ite-it66121.o
drivers/gpu/drm/bridge/ti-tmds181.c new file +427 -0

427 lines not on this page · raw message

Signature · 18 lines
2.43.0


Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: [email protected]
W: www.topic.nl

Please consider the environment before printing this e-mail
#5 lore raw
kernel test robot noticed the following build errors:

Hi Mike,

kernel test robot noticed the following build errors:

[auto build test ERROR on 53e760d8949895390e256e723e7ee46618310361]

url:    https://github.com/intel-lab-lkp/linux/commits/Mike-Looijmans/dt-bindings-drm-bridge-ti-tmds181-Add-TI-TMDS181-and-SN65DP159-bindings/20250908-141752
base:   53e760d8949895390e256e723e7ee46618310361
patch link:    https://lore.kernel.org/r/20250908061605.76787-3-mike.looijmans%40topic.nl
patch subject: [PATCH v5 2/2] drm: bridge: Add TI tmds181 and sn65dp159 driver
config: i386-randconfig-013-20250910 (https://download.01.org/0day-ci/archive/20250911/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250911/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

ld: drivers/gpu/drm/bridge/ti-tmds181.o: in function `tmds181_mode_valid':

>> drivers/gpu/drm/bridge/ti-tmds181.c:118:(.text+0x2e): undefined reference to `drm_hdmi_compute_mode_clock'

vim +118 drivers/gpu/drm/bridge/ti-tmds181.c

111
112 static enum drm_mode_status
113 tmds181_mode_valid(struct drm_bridge *bridge, const struct drm_display_info *info,
114 const struct drm_display_mode *mode)
115 {
116 unsigned long long rate;
117

 > 118		rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB);

119
120 /* Minimum clock rate is 25MHz */
121 if (rate < 25000000)
122 return MODE_CLOCK_LOW;
123
124 /*
125 * When in HDMI 2 mode, the clock is 1/40th of the bitrate. The limit is
126 * then the data rate of 6Gbps, which would use a 600MHz pixel clock.
127 */
128 if (rate > 600000000)
129 return MODE_CLOCK_HIGH;
130
131 return MODE_OK;
132 }
133

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki