1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2019 BayLibre, SAS.
4 * Author: Fabien Parent <fparent@baylibre.com>
5 */
6
7#include <dt-bindings/gpio/gpio.h>
8
9/ {
10	aliases {
11		serial0 = &uart0;
12	};
13
14	chosen {
15		stdout-path = "serial0:921600n8";
16	};
17
18	firmware {
19		optee: optee@4fd00000 {
20			compatible = "linaro,optee-tz";
21			method = "smc";
22		};
23	};
24
25	gpio-keys {
26		compatible = "gpio-keys";
27		input-name = "gpio-keys";
28		pinctrl-names = "default";
29		pinctrl-0 = <&gpio_keys_default>;
30
31		volume-up {
32			gpios = <&pio 42 GPIO_ACTIVE_LOW>;
33			label = "volume_up";
34			linux,code = <115>;
35			wakeup-source;
36			debounce-interval = <15>;
37		};
38
39		volume-down {
40			gpios = <&pio 43 GPIO_ACTIVE_LOW>;
41			label = "volume_down";
42			linux,code = <114>;
43			wakeup-source;
44			debounce-interval = <15>;
45		};
46	};
47};
48
49&i2c0 {
50	clock-div = <2>;
51	pinctrl-names = "default";
52	pinctrl-0 = <&i2c0_pins_a>;
53	status = "okay";
54
55	tca6416: gpio@20 {
56		compatible = "ti,tca6416";
57		reg = <0x20>;
58		rst-gpio = <&pio 65 GPIO_ACTIVE_HIGH>;
59		pinctrl-names = "default";
60		pinctrl-0 = <&tca6416_pins>;
61
62		gpio-controller;
63		#gpio-cells = <2>;
64
65		eint20_mux_sel0 {
66			gpio-hog;
67			gpios = <0 0>;
68			input;
69			line-name = "eint20_mux_sel0";
70		};
71
72		expcon_mux_sel1 {
73			gpio-hog;
74			gpios = <1 0>;
75			input;
76			line-name = "expcon_mux_sel1";
77		};
78
79		mrg_di_mux_sel2 {
80			gpio-hog;
81			gpios = <2 0>;
82			input;
83			line-name = "mrg_di_mux_sel2";
84		};
85
86		sd_sdio_mux_sel3 {
87			gpio-hog;
88			gpios = <3 0>;
89			input;
90			line-name = "sd_sdio_mux_sel3";
91		};
92
93		sd_sdio_mux_ctrl7 {
94			gpio-hog;
95			gpios = <7 0>;
96			output-low;
97			line-name = "sd_sdio_mux_ctrl7";
98		};
99
100		hw_id0 {
101			gpio-hog;
102			gpios = <8 0>;
103			input;
104			line-name = "hw_id0";
105		};
106
107		hw_id1 {
108			gpio-hog;
109			gpios = <9 0>;
110			input;
111			line-name = "hw_id1";
112		};
113
114		hw_id2 {
115			gpio-hog;
116			gpios = <10 0>;
117			input;
118			line-name = "hw_id2";
119		};
120
121		fg_int_n {
122			gpio-hog;
123			gpios = <11 0>;
124			input;
125			line-name = "fg_int_n";
126		};
127
128		usba_pwr_en {
129			gpio-hog;
130			gpios = <12 0>;
131			output-high;
132			line-name = "usba_pwr_en";
133		};
134
135		wifi_3v3_pg {
136			gpio-hog;
137			gpios = <13 0>;
138			input;
139			line-name = "wifi_3v3_pg";
140		};
141
142		cam_rst {
143			gpio-hog;
144			gpios = <14 0>;
145			output-low;
146			line-name = "cam_rst";
147		};
148
149		cam_pwdn {
150			gpio-hog;
151			gpios = <15 0>;
152			output-low;
153			line-name = "cam_pwdn";
154		};
155	};
156};
157
158&i2c2 {
159	clock-div = <2>;
160	pinctrl-names = "default";
161	pinctrl-0 = <&i2c2_pins_a>;
162	status = "okay";
163};
164
165&uart0 {
166	status = "okay";
167};
168
169&usb0 {
170	status = "okay";
171	dr_mode = "peripheral";
172
173	usb_con: connector {
174		compatible = "usb-c-connector";
175		label = "USB-C";
176	};
177};
178
179&usb0_phy {
180	status = "okay";
181};
182
183&pio {
184	gpio_keys_default: gpiodefault {
185		pins_cmd_dat {
186			pinmux = <MT8516_PIN_42_KPCOL0__FUNC_GPIO42>,
187				 <MT8516_PIN_43_KPCOL1__FUNC_GPIO43>;
188			bias-pull-up;
189			input-enable;
190		};
191	};
192
193	i2c0_pins_a: i2c0@0 {
194		pins1 {
195			pinmux = <MT8516_PIN_58_SDA0__FUNC_SDA0_0>,
196				 <MT8516_PIN_59_SCL0__FUNC_SCL0_0>;
197			bias-disable;
198		};
199	};
200
201	i2c2_pins_a: i2c2@0 {
202		pins1 {
203			pinmux = <MT8516_PIN_60_SDA2__FUNC_SDA2_0>,
204				 <MT8516_PIN_61_SCL2__FUNC_SCL2_0>;
205			bias-disable;
206		};
207	};
208
209	tca6416_pins: pinmux_tca6416_pins {
210		gpio_mux_rst_n_pin {
211			pinmux = <MT8516_PIN_65_UTXD1__FUNC_GPIO65>;
212			output-high;
213		};
214
215		gpio_mux_int_n_pin {
216			pinmux = <MT8516_PIN_64_URXD1__FUNC_GPIO64>;
217			input-enable;
218			bias-pull-up;
219		};
220	};
221};
222