Skip to content
107 changes: 107 additions & 0 deletions Documentation/devicetree/bindings/usb/cypress,cypd6129.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/cypress,cypd6129.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cypress cypd6129/cypd6229 Type-C Controller

maintainers:
- Akash Kumar <akash.kumar@oss.qualcomm.com>

description:
The Cypress cypd6129 and cypd6229 are dual Type-C PD controllers that are
controlled via an I2C interface.

properties:
compatible:
oneOf:
- const: cypress,cypd6129
- items:
- const: cypress,cypd6229
- const: cypress,cypd6129

'#address-cells':
const: 1

'#size-cells':
const: 0

reg:
maxItems: 1

interrupts:
maxItems: 1

pinctrl-0: true
pinctrl-1: true

pinctrl-names:
minItems: 1
items:
- const: default
- const: sleep

wakeup-source:
description: enable IRQ remote wakeup, see power/wakeup-source.txt
type: boolean

patternProperties:
'^connector@[01]$':
$ref: /schemas/connector/usb-connector.yaml#
required:
- reg

required:
- compatible
- reg
- interrupts

anyOf:
- required:
- connector@0
- required:
- connector@1

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;

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>;

endpoint {
remote-endpoint = <&usb_role_switch0>;
};
};
};
};
};
};
94 changes: 81 additions & 13 deletions arch/arm64/boot/dts/qcom/shikra-cqm-evk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -463,21 +463,13 @@
status = "okay";
};

&pm4125_hs_in {
remote-endpoint = <&usb_1_dwc3_hs>;
};

&pm4125_l5 {
/* DSI VDDA - must be at NOM voltage for PHY PLL lock */
regulator-min-microvolt = <1232000>;
regulator-max-microvolt = <1232000>;
regulator-allow-set-load;
};

&pm4125_ss_in {
remote-endpoint = <&usb_qmpphy_out>;
};

&qaif_cpu {
status = "okay";

Expand Down Expand Up @@ -523,6 +515,51 @@
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>;

ccg_typec_con0: 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>;
};

&pm4125_ss_in {
remote-endpoint = <&usb_qmpphy_out>;
};

&sdhc_1 {
vmmc-supply = <&pm4125_l20>;
vqmmc-supply = <&pm4125_l14>;
Expand Down Expand Up @@ -721,11 +758,24 @@
};

&usb_1 {
dr_mode = "otg";
dr_mode = "peripheral";

status = "okay";
};

&tlmm {
usb0_intr_state: usb0-intr-state {
pins = "gpio136";
function = "gpio";
drive-strength = <2>;
bias-pull-up;
};
};

&usb_1 {
/delete-property/ dr_mode;
};

&usb_1_dwc3_hs {
remote-endpoint = <&pm4125_hs_in>;
};
Expand All @@ -738,13 +788,20 @@
status = "okay";
};

&usb_qmpphy_out {
remote-endpoint = <&pm4125_ss_in>;
&usb_2 {
/delete-property/ dr_mode;

port {
usb_2_dwc3_hs: endpoint {
remote-endpoint = <&ucsi_ccg_port>;
};
};
};

&usb_qmpphy {
vdda-phy-supply = <&pm4125_l8>;
&usb_2_hsphy {
vdd-supply = <&pm4125_l12>;
vdda-pll-supply = <&pm4125_l13>;
vdda-phy-dpdm-supply = <&pm4125_l21>;

status = "okay";
};
Expand All @@ -767,3 +824,14 @@

status = "okay";
};

&usb_qmpphy_out {
remote-endpoint = <&pm4125_ss_in>;
};

&usb_qmpphy {
vdda-phy-supply = <&pm4125_l8>;
vdda-pll-supply = <&pm4125_l13>;

status = "okay";
};
13 changes: 9 additions & 4 deletions arch/arm64/boot/dts/qcom/shikra-cqm-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@
status = "okay";
};

&pm4125_tz {
status = "okay";
};

&pm4125_typec {
status = "okay";

Expand All @@ -233,34 +237,35 @@
typec-power-opmode = "default";
pd-disable;

vbus-supply = <&pm4125_vbus>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

pm4125_hs_in: endpoint {
};
};

port@1 {
reg = <1>;

pm4125_ss_in: endpoint {
};
};
};
};
};

&pm4125_tz {
status = "okay";
};

&pm4125_vbus {
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-min-microamp = <500000>;
regulator-max-microamp = <500000>;

status = "okay";
};

Expand Down
Loading
Loading