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