1/*
2 * Copyright (c) 2023 The Chromium OS Authors.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 */
7
8#include <dt-bindings/usb-c/pd.h>
9
10/ {
11	aliases {
12		usbc-port0 = &port1;
13	};
14
15	pwmleds {
16		compatible = "pwm-leds";
17		pwm_ctl: g0 {
18			pwms = <&pwm15 1 PWM_USEC(50) PWM_POLARITY_INVERTED>;
19			label = "PWM CTL";
20		};
21	};
22
23	pwrctrl {
24		compatible = "gpio-leds";
25
26		/* Pin D3 is used to enable VBUS Source */
27		source_en: g1 {
28			gpios = <&gpiod 3 GPIO_ACTIVE_HIGH>;
29			label = "SOURCE_EN";
30		};
31
32		/* Pin A1 is used for DCDC_EN */
33		dcdc_en: g2 {
34			gpios = <&gpioa 1 GPIO_ACTIVE_HIGH>;
35			label = "V_CTL2";
36		};
37
38		/* Pin D4 enables VCONN on CC1 */
39		vconn1_en: vconn1_en {
40			gpios = <&gpiod 4 GPIO_ACTIVE_LOW>;
41			label = "VCONN1_EN";
42		};
43
44		/* Pin B9 enables VCONN on CC2 */
45		vconn2_en: vconn2_en {
46			gpios = <&gpiob 9 GPIO_ACTIVE_LOW>;
47			label = "VCONN2_EN";
48		};
49	};
50
51	/* usbc.rst vbus-voltage-divider-adc start */
52	vbus1: vbus {
53		compatible = "zephyr,usb-c-vbus-adc";
54		io-channels = <&adc1 9>;
55		output-ohms = <49900>;
56		full-ohms = <(330000 + 49900)>;
57
58		/* Pin B13 is used to control VBUS Discharge for Port1 */
59		discharge-gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
60	};
61	/* usbc.rst vbus-voltage-divider-adc end */
62
63	ports {
64		#address-cells = <1>;
65		#size-cells = <0>;
66
67		/* usbc.rst usbc-port start */
68		port1: usbc-port@1 {
69			compatible = "usb-c-connector";
70			reg = <1>;
71			tcpc = <&ucpd1>;
72			vbus = <&vbus1>;
73			power-role = "source";
74			typec-power-opmode = "3.0A";
75			source-pdos = <PDO_FIXED(5000, 100, 0) PDO_FIXED(9000, 100, 0) PDO_FIXED(15000, 100, 0)>;
76		};
77		/* usbc.rst usbc-port end */
78	};
79};
80