[PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin

Jens Glathe via B4 Relay posted 2 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Jens Glathe via B4 Relay 1 month, 3 weeks ago
From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>

Add TLMM 119 for hdmi bridge enable. AeoB has this gpio.
In general this is the same setup as on the T14s. Since its using simple-bridge
and also is Lenovo, we also use the same realtek,rtd2171 compatible.
The real chip identity is not known yet. The bridge is wired with un-swapped
lanes, though.

As for gpio119 being used twice: It doesn't work if you don't, so it may be a case
of TLMM multiplexing hpd for both ports.

Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
---
 .../boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts b/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts
index b505a4cbb4350a962bbf779ec788265c7583bf20..80172f3059a42c8656eb682682495194015d3bbc 100644
--- a/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts
+++ b/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts
@@ -78,6 +78,47 @@ camera {
 		vdd-supply = <&vreg_cam_5p0>;
 	};
 
+	hdmi-bridge {
+		compatible = "realtek,rtd2171";
+
+		enable-gpios = <&tlmm 119 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&hdmi_hpd_default>;
+		pinctrl-names = "default";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				hdmi_bridge_dp_in: endpoint {
+					remote-endpoint = <&usb_1_ss2_qmpphy_out_dp>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				hdmi_bridge_tmds_out: endpoint {
+					remote-endpoint = <&hdmi_con>;
+				};
+			};
+		};
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con: endpoint {
+				remote-endpoint = <&hdmi_bridge_tmds_out>;
+			};
+		};
+	};
+
 	gpio-keys {
 		compatible = "gpio-keys";
 
@@ -1038,6 +1079,14 @@ &mdss_dp1_out {
 	link-frequencies = /bits/ 64 <1620000000 2700000000 5400000000 8100000000>;
 };
 
+&mdss_dp2 {
+	status = "okay";
+};
+
+&mdss_dp2_out {
+	link-frequencies = /bits/ 64 <1620000000 2700000000 5400000000 8100000000>;
+};
+
 &mdss_dp3 {
 	/delete-property/ #sound-dai-cells;
 
@@ -1327,6 +1376,19 @@ hall_int_n_default: hall-int-n-state {
 		bias-disable;
 	};
 
+	hdmi_bridge_en: hdmi-bridge-en-state {
+		pins = "gpio119";
+		function = "gpio";
+		drive-strength = <16>;
+		bias-disable;
+	};
+
+	hdmi_hpd_default: hdmi-hpd-default-state {
+		pins = "gpio126";
+		function = "usb2_dp";
+		bias-disable;
+	};
+
 	kybd_default: kybd-default-state {
 		pins = "gpio67";
 		function = "gpio";
@@ -1585,6 +1647,32 @@ &usb_1_ss2_hsphy {
 	status = "okay";
 };
 
+&usb_1_ss2_qmpphy {
+	vdda-phy-supply = <&vreg_l2j_1p2>;
+	vdda-pll-supply = <&vreg_l2d_0p9>;
+
+	/delete-property/ mode-switch;
+	/delete-property/ orientation-switch;
+
+	status = "okay";
+
+	ports {
+		port@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			/delete-node/ endpoint;
+
+			usb_1_ss2_qmpphy_out_dp: endpoint@0 {
+				reg = <0>;
+
+				data-lanes = <0 1 2 3>;
+				remote-endpoint = <&hdmi_bridge_dp_in>;
+			};
+		};
+	};
+};
+
 &usb_2 {
 	status = "okay";
 };

-- 
2.51.0
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Dmitry Baryshkov 1 month, 3 weeks ago
On Sat, Dec 20, 2025 at 06:47:10PM +0100, Jens Glathe via B4 Relay wrote:
> From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> 
> Add TLMM 119 for hdmi bridge enable. AeoB has this gpio.

Whaat is AeoB? I don't see the GPIO being used in other place.

> In general this is the same setup as on the T14s. Since its using simple-bridge
> and also is Lenovo, we also use the same realtek,rtd2171 compatible.
> The real chip identity is not known yet. The bridge is wired with un-swapped
> lanes, though.

Is the chip marked anyhow?

> 
> As for gpio119 being used twice: It doesn't work if you don't, so it may be a case
> of TLMM multiplexing hpd for both ports.

What is the relationship between enable and HPD?

> 
> Signed-off-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> ---
>  .../boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts | 88 ++++++++++++++++++++++
>  1 file changed, 88 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts b/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts
> index b505a4cbb4350a962bbf779ec788265c7583bf20..80172f3059a42c8656eb682682495194015d3bbc 100644
> --- a/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts
> +++ b/arch/arm64/boot/dts/qcom/x1p42100-lenovo-thinkbook-16.dts
> @@ -78,6 +78,47 @@ camera {
>  		vdd-supply = <&vreg_cam_5p0>;
>  	};
>  
> +	hdmi-bridge {
> +		compatible = "realtek,rtd2171";
> +
> +		enable-gpios = <&tlmm 119 GPIO_ACTIVE_HIGH>;
> +
> +		pinctrl-0 = <&hdmi_hpd_default>;
> +		pinctrl-names = "default";
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				hdmi_bridge_dp_in: endpoint {
> +					remote-endpoint = <&usb_1_ss2_qmpphy_out_dp>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				hdmi_bridge_tmds_out: endpoint {
> +					remote-endpoint = <&hdmi_con>;
> +				};
> +			};
> +		};
> +	};
> +
> +	hdmi-connector {
> +		compatible = "hdmi-connector";
> +		type = "a";
> +
> +		port {
> +			hdmi_con: endpoint {
> +				remote-endpoint = <&hdmi_bridge_tmds_out>;
> +			};
> +		};
> +	};
> +
>  	gpio-keys {
>  		compatible = "gpio-keys";
>  
> @@ -1038,6 +1079,14 @@ &mdss_dp1_out {
>  	link-frequencies = /bits/ 64 <1620000000 2700000000 5400000000 8100000000>;
>  };
>  
> +&mdss_dp2 {
> +	status = "okay";
> +};
> +
> +&mdss_dp2_out {
> +	link-frequencies = /bits/ 64 <1620000000 2700000000 5400000000 8100000000>;
> +};
> +
>  &mdss_dp3 {
>  	/delete-property/ #sound-dai-cells;
>  
> @@ -1327,6 +1376,19 @@ hall_int_n_default: hall-int-n-state {
>  		bias-disable;
>  	};
>  
> +	hdmi_bridge_en: hdmi-bridge-en-state {
> +		pins = "gpio119";
> +		function = "gpio";
> +		drive-strength = <16>;
> +		bias-disable;
> +	};
> +
> +	hdmi_hpd_default: hdmi-hpd-default-state {
> +		pins = "gpio126";
> +		function = "usb2_dp";
> +		bias-disable;
> +	};
> +
>  	kybd_default: kybd-default-state {
>  		pins = "gpio67";
>  		function = "gpio";
> @@ -1585,6 +1647,32 @@ &usb_1_ss2_hsphy {
>  	status = "okay";
>  };
>  
> +&usb_1_ss2_qmpphy {
> +	vdda-phy-supply = <&vreg_l2j_1p2>;
> +	vdda-pll-supply = <&vreg_l2d_0p9>;
> +
> +	/delete-property/ mode-switch;
> +	/delete-property/ orientation-switch;
> +
> +	status = "okay";
> +
> +	ports {
> +		port@0 {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			/delete-node/ endpoint;
> +
> +			usb_1_ss2_qmpphy_out_dp: endpoint@0 {
> +				reg = <0>;
> +
> +				data-lanes = <0 1 2 3>;
> +				remote-endpoint = <&hdmi_bridge_dp_in>;
> +			};
> +		};
> +	};
> +};
> +
>  &usb_2 {
>  	status = "okay";
>  };
> 
> -- 
> 2.51.0
> 
> 

-- 
With best wishes
Dmitry
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Jens Glathe 1 month, 3 weeks ago
On 20.12.25 19:52, Dmitry Baryshkov wrote:
> On Sat, Dec 20, 2025 at 06:47:10PM +0100, Jens Glathe via B4 Relay wrote:
>> From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
>>
>> Add TLMM 119 for hdmi bridge enable. AeoB has this gpio.
> Whaat is AeoB? I don't see the GPIO being used in other place.

AeoB is a resource format used by the QCom Windows drivers to add / 
overwrite definitions coming from the ACPI tables. [1] It had the info 
that was not to be found in the DSDT. Actually, x1e80100.dtsi has the 
edp0_hpd_default pinctrl which is required for the display to work with 
the function edp_hot. I verified this, you need both. I can use that 
definition in this patchset, too, but its not for HDMI.

[1]: 
https://github.com/alexVinarskis/qcom-aeob-dumps/tree/master/lenovo-thinkbook-16-g7-qoy

>> In general this is the same setup as on the T14s. Since its using simple-bridge
>> and also is Lenovo, we also use the same realtek,rtd2171 compatible.
>> The real chip identity is not known yet. The bridge is wired with un-swapped
>> lanes, though.
> Is the chip marked anyhow?
I don't know. Haven't looked inside.
>> As for gpio119 being used twice: It doesn't work if you don't, so it may be a case
>> of TLMM multiplexing hpd for both ports.
> What is the relationship between enable and HPD?

Yeah, good question. Actually HDMI hpd is wired to gpio126, and works 
without the enable pin. But no link training succeeds, no display coming 
up. With enable set on probe() this works. If you have the lane order 
right. The HDMI socket  is "above" the type-c ports on the TB16, 
compared to the T14s where it is "below" the type-c ports, so swapped 
lanes sounds reasonable.

[...]
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Dmitry Baryshkov 1 month, 3 weeks ago
On Sat, Dec 20, 2025 at 09:17:16PM +0100, Jens Glathe wrote:
> On 20.12.25 19:52, Dmitry Baryshkov wrote:
> > On Sat, Dec 20, 2025 at 06:47:10PM +0100, Jens Glathe via B4 Relay wrote:
> > > From: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> > > 
> > > Add TLMM 119 for hdmi bridge enable. AeoB has this gpio.
> > Whaat is AeoB? I don't see the GPIO being used in other place.
> 
> AeoB is a resource format used by the QCom Windows drivers to add /
> overwrite definitions coming from the ACPI tables. [1] It had the info that
> was not to be found in the DSDT. Actually, x1e80100.dtsi has the
> edp0_hpd_default pinctrl which is required for the display to work with the
> function edp_hot. I verified this, you need both. I can use that definition
> in this patchset, too, but its not for HDMI.
> 
> [1]: https://github.com/alexVinarskis/qcom-aeob-dumps/tree/master/lenovo-thinkbook-16-g7-qoy
> 
> > > In general this is the same setup as on the T14s. Since its using simple-bridge
> > > and also is Lenovo, we also use the same realtek,rtd2171 compatible.
> > > The real chip identity is not known yet. The bridge is wired with un-swapped
> > > lanes, though.
> > Is the chip marked anyhow?
> I don't know. Haven't looked inside.

Photos / scans of the mainboard?

> > > As for gpio119 being used twice: It doesn't work if you don't, so it may be a case
> > > of TLMM multiplexing hpd for both ports.
> > What is the relationship between enable and HPD?
> 
> Yeah, good question. Actually HDMI hpd is wired to gpio126, and works
> without the enable pin. But no link training succeeds, no display coming up.
> With enable set on probe() this works. If you have the lane order right. The
> HDMI socket  is "above" the type-c ports on the TB16, compared to the T14s
> where it is "below" the type-c ports, so swapped lanes sounds reasonable.

Okay, I might be misunderstanding something. What do you mean here by
"gpio119 being used twice"?

> 
> [...]
> 

-- 
With best wishes
Dmitry
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Jens Glathe 1 month, 3 weeks ago
On 21.12.25 03:49, Dmitry Baryshkov wrote:
> Photos / scans of the mainboard?
Haven't found good ones where you could even see a chip (let alone 
markings) in the vicinity of the hdmi connector.
> Okay, I might be misunderstanding something. What do you mean here by
> "gpio119 being used twice"?

/me trying to explain something and confusing people :) Sorry for that. 
The whole dts has actually one place where the TLMM 119 is explicitly 
specified, on the hdmi-bridge. It is defined again on the tlmm node for 
pinctrl as hdmi_bridge_en (function gpio), so far so normal. gpio 119 
(on the TLMM) is also defined and used as edp_hpd_default on the 
mdss_dp3 node, there with function edp0_hot.

You need the hdmi_bridge_en and the edp_hpd definition in the dts for 
both to work. And both use gpio 119, on the TLMM, which might be a bit 
confusing.

with best regards

Jens
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Dmitry Baryshkov 1 month, 2 weeks ago
On Sun, Dec 21, 2025 at 09:03:30AM +0100, Jens Glathe wrote:
> On 21.12.25 03:49, Dmitry Baryshkov wrote:
> > Photos / scans of the mainboard?
> Haven't found good ones where you could even see a chip (let alone markings)
> in the vicinity of the hdmi connector.
> > Okay, I might be misunderstanding something. What do you mean here by
> > "gpio119 being used twice"?
> 
> /me trying to explain something and confusing people :) Sorry for that. The
> whole dts has actually one place where the TLMM 119 is explicitly specified,
> on the hdmi-bridge. It is defined again on the tlmm node for pinctrl as
> hdmi_bridge_en (function gpio), so far so normal. gpio 119 (on the TLMM) is
> also defined and used as edp_hpd_default on the mdss_dp3 node, there with
> function edp0_hot.
> 
> You need the hdmi_bridge_en and the edp_hpd definition in the dts for both
> to work. And both use gpio 119, on the TLMM, which might be a bit confusing.

This can't work, the pin can only be used for a single function.

> 
> with best regards
> 
> Jens
> 

-- 
With best wishes
Dmitry
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Jens Glathe 1 month, 2 weeks ago
On 21.12.25 16:23, Dmitry Baryshkov wrote:
> This can't work, the pin can only be used for a single function.

See, that's where I am, too :) Configure it that way and you get the 
HDMI to work, be prudent and remove edp_hpd_default, and boom the 
internal display is gone. Maybe someone with some schematics can shed 
light on this.

with best regards

Jens
Re: [PATCH 2/2] arm64: dts: qcom: x1p42100-lenovo-thinkbook-16: add hdmi bridge with enable pin
Posted by Jens Glathe 1 month, 1 week ago
On 21.12.25 16:51, Jens Glathe wrote:

> On 21.12.25 16:23, Dmitry Baryshkov wrote:
>> This can't work, the pin can only be used for a single function.
>
> See, that's where I am, too :) Configure it that way and you get the 
> HDMI to work, be prudent and remove edp_hpd_default, and boom the 
> internal display is gone. Maybe someone with some schematics can shed 
> light on this.
>
Well I dived into that again (no schematics, sadly) and found and tested 
something that works through exclusion. In pinctrl-x1e80100.c there is a 
definition for function block goups (?) describing gpio pins intended 
for functions. Well, gpio120 (very near 119) is only and exclusively in 
edp1_hot_groups[] and edp0_lcd_groups[]. edp1_hot_groups[] fits pretty 
well for a second display out, and its not used anywhere. Assigned it as 
enable pin and it works well.

Will do a V2 of this patch, thank you for all the suggestions.

with best regards

Jens