[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241023071226.14090-1-macpaul.lin@mediatek.com>
Date: Wed, 23 Oct 2024 15:12:25 +0800
From: Macpaul Lin <macpaul.lin@...iatek.com>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Matthias Brugger
<matthias.bgg@...il.com>, AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>, Alexandre Mergnat
<amergnat@...libre.com>
CC: Bear Wang <bear.wang@...iatek.com>, Pablo Sun <pablo.sun@...iatek.com>,
Macpaul Lin <macpaul.lin@...iatek.com>, Macpaul Lin <macpaul@...il.com>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
<linux-usb@...r.kernel.org>, Chris-qj chen <chris-qj.chen@...iatek.com>,
Fabien Parent <fparent@...libre.com>, Yow-Shin Liou
<yow-shin.liou@...iatek.com>, Simon Sun <simon.sun@...jingtech.com>
Subject: [PATCH v2 1/2] arm64: dts: mediatek: mt8395-genio-1200-evk: add support for TCPC port
From: Fabien Parent <fparent@...libre.com>
Enable USB Type-C support on MediaTek MT8395 Genio 1200 EVK by adding
configuration for TCPC Port, USB-C connector, and related settings.
Configure dual role switch capability, set up PD (Power Delivery) profiles,
and establish endpoints for SSUSB (SuperSpeed USB).
Update pinctrl configurations for U3 P0 VBus default pins and set dr_mode
to "otg" for OTG (On-The-Go) mode operation.
Signed-off-by: Fabien Parent <fparent@...libre.com>
Signed-off-by: Yow-Shin Liou <yow-shin.liou@...iatek.com>
Signed-off-by: Simon Sun <simon.sun@...jingtech.com>
Signed-off-by: Macpaul Lin <macpaul.lin@...iatek.com>
---
.../dts/mediatek/mt8395-genio-1200-evk.dts | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
Changes for v2:
- Drop the no need '1/2' DT Schema update patch in the 1st version.
- Fix intent for 'ports' node, it should under the 'connector' node.
- Correct the index for 'port@0' and 'port@1' node.
diff --git a/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts b/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts
index 5f16fb820580..195e486d9101 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts
@@ -249,6 +249,43 @@ mt6360: pmic@34 {
#interrupt-cells = <1>;
pinctrl-0 = <&mt6360_pins>;
+ tcpc {
+ compatible = "mediatek,mt6360-tcpc";
+ interrupts-extended = <&pio 17 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-names = "PD_IRQB";
+
+ connector {
+ compatible = "usb-c-connector";
+ label = "USB-C";
+ data-role = "dual";
+ power-role = "dual";
+ try-power-role = "sink";
+ source-pdos = <PDO_FIXED(5000, 1000, \
+ PDO_FIXED_DUAL_ROLE | \
+ PDO_FIXED_DATA_SWAP)>;
+ sink-pdos = <PDO_FIXED(5000, 2000, \
+ PDO_FIXED_DUAL_ROLE | \
+ PDO_FIXED_DATA_SWAP)>;
+ op-sink-microwatt = <10000000>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ };
+
+ port@1 {
+ reg = <1>;
+ mt6360_ssusb_ep: endpoint {
+ remote-endpoint = <&ssusb_ep>;
+ };
+ };
+ };
+ };
+ };
+
charger {
compatible = "mediatek,mt6360-chg";
richtek,vinovp-microvolt = <14500000>;
@@ -446,6 +483,13 @@ &pciephy {
};
&pio {
+ u3_p0_vbus: u3-p0-vbus-default-pins {
+ pins-cmd-dat {
+ pinmux = <PINMUX_GPIO63__FUNC_VBUSVALID>;
+ input-enable;
+ };
+ };
+
audio_default_pins: audio-default-pins {
pins-cmd-dat {
pinmux = <PINMUX_GPIO61__FUNC_DMIC1_CLK>,
@@ -900,8 +944,18 @@ &ufsphy {
};
&ssusb0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&u3_p0_vbus>;
vusb33-supply = <&mt6359_vusb_ldo_reg>;
+ dr_mode = "otg";
+ usb-role-switch;
status = "okay";
+
+ port {
+ ssusb_ep: endpoint {
+ remote-endpoint = <&mt6360_ssusb_ep>;
+ };
+ };
};
&ssusb2 {
--
2.45.2
Powered by blists - more mailing lists