arm64: dts: qcom: shikra: Add CYPD6129/CYPD6229 Type-C controller support
PATCH 1/1 arm64: dts: qcom: shikra: Add CYPD6129/CYPD6229 Type-C controller support
From: Akash Kumar <[email protected]>
Add the Cypress CYPD6129/CYPD6229 Type-C PD controllers used on the Shikra CQM, CQS and IQS platforms, and wire up their connectors to the corresponding USB controllers.
CQM and CQS each expose a single USB-C port driven by a CYPD6129 on I2C3, connected to the HS-only usb_2 controller. IQS exposes two USB-C ports driven by a CYPD6229 (CYPD6129-compatible) on I2C3: the first port is HS-only and connects to usb_2, while the second port carries both the HS and SuperSpeed lanes and connects to usb_1 and its QMP SS PHY.
Both affected USB controllers are switched from the board-default peripheral-only mode to OTG, so that the role-switch framework can move them between host and device roles based on the data role the PD controller negotiates.
The PD controller's interrupt line is routed through a TLMM pin and marked as a wakeup source, since Type-C attach/detach and role events need to wake the SoC. On IQS, the 5V VBUS boost supply is driven by a GPIO rather than a PMIC rail, so it is modeled as a regulator-fixed node, matching the existing boost-supply pattern used elsewhere on Shikra/Purwa, and wired to both connectors via vbus-supply, giving the regulator and connector frameworks control over it instead of unconditionally latching it on with a GPIO hog.
--- arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts | 55 ++++++++++ arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts | 55 ++++++++++ arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts | 108 ++++++++++++++++++++ 3 files changed, 218 insertions(+)
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +55 -0
@@ -15,6 +15,7 @@ / { chassis-type = "embedded"; aliases { + i2c3 = &i2c3; mmc0 = &sdhc_1; mmc1 = &sdhc_2; /* SDC2 SD card slot */ serial0 = &uart0;
@@ -29,6 +30,43 @@ &audiocorecc { status = "okay"; }; +&i2c3 { + status = "okay"; + + typec@40 { + compatible = "cypress,cypd6129"; + reg = <0x40>; + interrupts-extended = <&tlmm 136 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&usb0_intr_state>; + pinctrl-names = "default"; + wakeup-source; + + #address-cells = <1>; + #size-cells = <0>; + + connector@0 { + compatible = "usb-c-connector"; + reg = <0>; + label = "USB-C"; + data-role = "dual"; + power-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + ucsi_ccg_port: endpoint { + remote-endpoint = <&usb_2_dwc3_hs>; + }; + }; + }; + }; + }; +}; + &pm4125_hs_in { remote-endpoint = <&usb_1_dwc3_hs>; };
@@ -79,6 +117,15 @@ &sdhc_2 { status = "okay"; }; +&tlmm { + usb0_intr_state: usb0-intr-state { + pins = "gpio136"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; +}; + &usb_1 { dr_mode = "otg"; };
@@ -106,6 +153,14 @@ &usb_qmpphy_out { remote-endpoint = <&pm4125_ss_in>; }; +&usb_2 { + dr_mode = "otg"; +}; + +&usb_2_dwc3_hs { + remote-endpoint = <&ucsi_ccg_port>; +}; + &usb_2_hsphy { vdd-supply = <&pm4125_l12>; vdda-pll-supply = <&pm4125_l13>;
arch/arm64/boot/dts/qcom/shikra-cqs-evk.dts +55 -0
79 lines not on this page · raw message
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +108 -0
132 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] arm64: dts: qcom: shikra: unmatched cypress,cypd6129/cypd6229 compatibles - [High] arm64: dts: qcom…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [High] arm64: dts: qcom: shikra: unmatched cypress,cypd6129/cypd6229 compatibles
- [High] arm64: dts: qcom: shikra: unconsumed vbus_boost_5v disabled after boot
--
commit 3ae712ea5d9b843ce48bb12bea9832d0a56a64ed
Author: Akash Kumar <[email protected]>
arm64: dts: qcom: shikra: Add CYPD6129/CYPD6229 Type-C controller support
This commit adds CYPD6129/CYPD6229 Type-C PD controller nodes and connector endpoints on the Shikra CQM, CQS, and IQS EVK boards, and switches the corresponding USB controllers to OTG mode.
Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +0
-0
[ ... ]
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts &audiocorecc { · line 38
Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts +6
-0@@ -29,6 +30,43 @@ &audiocorecc { status = "okay"; }; +&i2c3 { + status = "okay"; + + typec@40 { + compatible = "cypress,cypd6129"; + reg = <0x40>;
[Severity: High]
Does any driver bind to typec@40 with "cypress,cypd6129" (or "cypress,cypd6229" in shikra-iqs-evk.dts)?
ucsi_ccg_of_match_table in drivers/usb/typec/ucsi/ucsi_ccg.c only matches "cypress,cypd4226", and ucsi_ccg_device_id only matches "ccgx-ucsi". Without a matching driver entry, typec@40 never probes on CQM, CQS, or IQS, leaving USB OTG role switching and SuperSpeed orientation switching non-functional.
In addition, Documentation/devicetree/bindings/usb/cypress,cypd4226.yaml only allows "cypress,cypd4226" at reg 0x08 and does not define wakeup-source, so these nodes also fail dtbs_check.
[ ... ]
Quoted 4 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +0
-0
[ ... ]
Quoted 27 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +23
-0@@ -23,6 +24,84 @@ aliases { chosen { stdout-path = "serial0:115200n8"; }; + + vbus_boost_5v: regulator-vbus-boost-5v { + compatible = "regulator-fixed"; + regulator-name = "vbus_boost_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&tlmm 79 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; +}; + +&i2c3 { + status = "okay"; + + typec@40 { + compatible = "cypress,cypd6229", "cypress,cypd6129"; + reg = <0x40>; + interrupts-extended = <&tlmm 50 IRQ_TYPE_LEVEL_LOW>; + pinctrl-0 = <&usb0_intr_state>; + pinctrl-names = "default"; + wakeup-source; +
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts aliases { · line 59
Quoted 10 lines
arch/arm64/boot/dts/qcom/shikra-iqs-evk.dts +10
-0+ #address-cells = <1>; + #size-cells = <0>; + + connector@0 { + compatible = "usb-c-connector"; + reg = <0>; + label = "USB2-Type-C"; + data-role = "dual"; + power-role = "dual"; + vbus-supply = <&vbus_boost_5v>;
[Severity: High]
Will regulator_late_cleanup() turn off vbus_boost_5v 30 seconds after boot?
Neither ucsi_ccg, ucsi_register_port(), nor the Type-C class parses or enables vbus-supply on UCSI connector child nodes. Because vbus_boost_5v has no active consumer and omits regulator-always-on, its use_count stays 0 and regulator_late_cleanup() disables it, cutting off the shared 5V VBUS boost rail for both Type-C ports.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1