]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: mediatek: mt8395-genio-1200-evk: add support for TCPC port
authorFabien Parent <fparent@baylibre.com>
Mon, 24 Feb 2025 11:49:34 +0000 (19:49 +0800)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 25 Feb 2025 09:00:22 +0000 (10:00 +0100)
Enable USB Type-C support on MediaTek MT8395 Genio 1200 EVK by adding
configuration for TCPC Port, USB-C connector, MUX IT5205 and related
settings.

Configure dual role switch capability, set up PD (Power Delivery) profiles,
and establish endpoints for SS (SuperSpeed) and HS (HighSpeed) USB.

Update pinctrl configurations for U3 P0 VBus default pins and set dr_mode
to "otg" for OTG (On-The-Go) mode operation.

Add ITE IT5205 (TYPEC MUX) under I2C2 bus and configure its properties;
also add references and configurations to 'typec-mux' node.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Yow-Shin Liou <yow-shin.liou@mediatek.com>
Signed-off-by: Simon Sun <simon.sun@yunjingtech.com>
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20250224114934.3583191-1-macpaul.lin@mediatek.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts

index 5950194c9ccb2520d826c4d26f6dc0958a5a17fa..f02c32def593a54531221ec57473a335af08a92f 100644 (file)
        pinctrl-0 = <&i2c2_pins>;
        pinctrl-names = "default";
        status = "okay";
+
+       typec-mux@48 {
+               compatible = "ite,it5205";
+               reg = <0x48>;
+               vcc-supply = <&mt6359_vibr_ldo_reg>;
+               mode-switch;
+               orientation-switch;
+               status = "okay";
+
+               port {
+                       it5205_sbu_ep: endpoint {
+                               remote-endpoint = <&mt6360_ssusb_sbu_ep>;
+                       };
+               };
+       };
 };
 
 &i2c6 {
                                regulator-always-on;
                        };
                };
+
+               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";
+                               op-sink-microwatt = <10000000>;
+                               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)>;
+
+                               pd-revision = /bits/ 8 <0x03 0x01 0x01 0x06>;
+
+                               altmodes {
+                                       displayport {
+                                               svid = /bits/ 16 <0xff01>;
+                                               vdo = <0x00001c46>;
+                                       };
+                               };
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               typec_con_hs: endpoint {
+                                                       remote-endpoint = <&mtu3_hs0_role_sw>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               typec_con_ss: endpoint {
+                                                       remote-endpoint = <&mtu3_ss0_role_sw>;
+                                               };
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               mt6360_ssusb_sbu_ep: endpoint {
+                                                       remote-endpoint = <&it5205_sbu_ep>;
+                                               };
+                                       };
+                               };
+                       };
+               };
        };
 };
 
                };
        };
 
+       u3_p0_vbus: u3-p0-vbus-default-pins {
+               pins-vbus {
+                       pinmux = <PINMUX_GPIO63__FUNC_VBUSVALID>;
+                       input-enable;
+               };
+       };
+
        uart0_pins: uart0-pins {
                pins {
                        pinmux = <PINMUX_GPIO98__FUNC_UTXD0>,
 };
 
 &ssusb0 {
+       dr_mode = "otg";
+       pinctrl-names = "default";
+       pinctrl-0 = <&u3_p0_vbus>;
+       usb-role-switch;
        vusb33-supply = <&mt6359_vusb_ldo_reg>;
        status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+                       mtu3_hs0_role_sw: endpoint {
+                               remote-endpoint = <&typec_con_hs>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+                       mtu3_ss0_role_sw: endpoint {
+                               remote-endpoint = <&typec_con_ss>;
+                       };
+               };
+       };
 };
 
 &ssusb2 {