1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Google Gru-Kevin Rev 6+ board device tree source
4 *
5 * Copyright 2016-2017 Google, Inc
6 */
7
8/dts-v1/;
9#include "rk3399-gru-chromebook.dtsi"
10#include <dt-bindings/input/linux-event-codes.h>
11
12/*
13 * Kevin-specific things
14 *
15 * Things in this section should use names from Kevin schematic since no
16 * equivalent exists in Gru schematic.  If referring to signals that exist
17 * in Gru we use the Gru names, though.  Confusing enough for you?
18 */
19/ {
20	model = "Google Kevin";
21	compatible = "google,kevin-rev15", "google,kevin-rev14",
22		     "google,kevin-rev13", "google,kevin-rev12",
23		     "google,kevin-rev11", "google,kevin-rev10",
24		     "google,kevin-rev9", "google,kevin-rev8",
25		     "google,kevin-rev7", "google,kevin-rev6",
26		     "google,kevin", "google,gru", "rockchip,rk3399";
27
28	/* Power tree */
29
30	p3_3v_dig: p3-3v-dig {
31		compatible = "regulator-fixed";
32		regulator-name = "p3.3v_dig";
33		pinctrl-names = "default";
34		pinctrl-0 = <&cpu3_pen_pwr_en>;
35
36		enable-active-high;
37		gpio = <&gpio4 30 GPIO_ACTIVE_HIGH>;
38		vin-supply = <&pp3300>;
39	};
40
41	edp_panel: edp-panel {
42		compatible = "sharp,lq123p1jx31";
43		backlight = <&backlight>;
44		power-supply = <&pp3300_disp>;
45
46		panel-timing {
47			clock-frequency = <266666667>;
48			hactive = <2400>;
49			hfront-porch = <48>;
50			hback-porch = <84>;
51			hsync-len = <32>;
52			hsync-active = <0>;
53			vactive = <1600>;
54			vfront-porch = <3>;
55			vback-porch = <120>;
56			vsync-len = <10>;
57			vsync-active = <0>;
58		};
59
60		port {
61			panel_in_edp: endpoint {
62				remote-endpoint = <&edp_out_panel>;
63			};
64		};
65	};
66
67	thermistor_ppvar_bigcpu: thermistor-ppvar-bigcpu {
68		compatible = "murata,ncp15wb473";
69		pullup-uv = <1800000>;
70		pullup-ohm = <25500>;
71		pulldown-ohm = <0>;
72		io-channels = <&saradc 2>;
73		#thermal-sensor-cells = <0>;
74	};
75
76	thermistor_ppvar_litcpu: thermistor-ppvar-litcpu {
77		compatible = "murata,ncp15wb473";
78		pullup-uv = <1800000>;
79		pullup-ohm = <25500>;
80		pulldown-ohm = <0>;
81		io-channels = <&saradc 3>;
82		#thermal-sensor-cells = <0>;
83	};
84};
85
86&backlight {
87	pwms = <&cros_ec_pwm 1>;
88};
89
90&gpio_keys {
91	pinctrl-names = "default";
92	pinctrl-0 = <&bt_host_wake_l>, <&cpu1_pen_eject>;
93
94	pen-insert {
95		label = "Pen Insert";
96		/* Insert = low, eject = high */
97		gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
98		linux,code = <SW_PEN_INSERTED>;
99		linux,input-type = <EV_SW>;
100		wakeup-source;
101	};
102};
103
104&thermal_zones {
105	bigcpu_reg_thermal: bigcpu-reg-thermal {
106		polling-delay-passive = <100>; /* milliseconds */
107		polling-delay = <1000>; /* milliseconds */
108		thermal-sensors = <&thermistor_ppvar_bigcpu 0>;
109		sustainable-power = <4000>;
110
111		ppvar_bigcpu_trips: trips {
112			ppvar_bigcpu_on: ppvar-bigcpu-on {
113				temperature = <40000>;	/* millicelsius */
114				hysteresis = <2000>;	/* millicelsius */
115				type = "passive";
116			};
117
118			ppvar_bigcpu_alert: ppvar-bigcpu-alert {
119				temperature = <50000>;	/* millicelsius */
120				hysteresis = <2000>;	/* millicelsius */
121				type = "passive";
122			};
123
124			ppvar_bigcpu_crit: ppvar-bigcpu-crit {
125				temperature = <90000>;	/* millicelsius */
126				hysteresis = <0>;	/* millicelsius */
127				type = "critical";
128			};
129		};
130
131		cooling-maps {
132			map0 {
133				trip = <&ppvar_bigcpu_alert>;
134				cooling-device =
135					<&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
136					<&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
137					<&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
138					<&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
139				contribution = <4096>;
140			};
141			map1 {
142				trip = <&ppvar_bigcpu_alert>;
143				cooling-device =
144					<&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
145					<&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
146				contribution = <1024>;
147			};
148		};
149	};
150
151	litcpu_reg_thermal: litcpu-reg-thermal {
152		polling-delay-passive = <100>; /* milliseconds */
153		polling-delay = <1000>; /* milliseconds */
154		thermal-sensors = <&thermistor_ppvar_litcpu 0>;
155		sustainable-power = <4000>;
156
157		ppvar_litcpu_trips: trips {
158			ppvar_litcpu_on: ppvar-litcpu-on {
159				temperature = <40000>;	/* millicelsius */
160				hysteresis = <2000>;	/* millicelsius */
161				type = "passive";
162			};
163
164			ppvar_litcpu_alert: ppvar-litcpu-alert {
165				temperature = <50000>;	/* millicelsius */
166				hysteresis = <2000>;	/* millicelsius */
167				type = "passive";
168			};
169
170			ppvar_litcpu_crit: ppvar-litcpu-crit {
171				temperature = <90000>;	/* millicelsius */
172				hysteresis = <0>;	/* millicelsius */
173				type = "critical";
174			};
175		};
176	};
177};
178
179ap_i2c_tpm: &i2c0 {
180	status = "okay";
181
182	clock-frequency = <400000>;
183
184	/* These are relatively safe rise/fall times. */
185	i2c-scl-falling-time-ns = <50>;
186	i2c-scl-rising-time-ns = <300>;
187
188	tpm: tpm@20 {
189		compatible = "infineon,slb9645tt";
190		reg = <0x20>;
191		powered-while-suspended;
192	};
193};
194
195ap_i2c_dig: &i2c2 {
196	status = "okay";
197
198	clock-frequency = <400000>;
199
200	/* These are relatively safe rise/fall times. */
201	i2c-scl-falling-time-ns = <50>;
202	i2c-scl-rising-time-ns = <300>;
203
204	digitizer: digitizer@9 {
205		/* wacom,w9013 */
206		compatible = "hid-over-i2c";
207		reg = <0x9>;
208		pinctrl-names = "default";
209		pinctrl-0 = <&cpu1_dig_irq_l &cpu1_dig_pdct_l>;
210
211		vdd-supply = <&p3_3v_dig>;
212		post-power-on-delay-ms = <100>;
213
214		interrupt-parent = <&gpio2>;
215		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
216
217		hid-descr-addr = <0x1>;
218	};
219};
220
221/* Adjustments to things in the gru baseboard */
222
223&ap_i2c_tp {
224	trackpad@4a {
225		compatible = "atmel,maxtouch";
226		reg = <0x4a>;
227		pinctrl-names = "default";
228		pinctrl-0 = <&trackpad_int_l>;
229		interrupt-parent = <&gpio1>;
230		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
231		linux,gpio-keymap = <KEY_RESERVED
232				     KEY_RESERVED
233				     KEY_RESERVED
234				     BTN_LEFT>;
235		wakeup-source;
236	};
237};
238
239&ap_i2c_ts {
240	touchscreen@4b {
241		compatible = "atmel,maxtouch";
242		reg = <0x4b>;
243		pinctrl-names = "default";
244		pinctrl-0 = <&touch_int_l>;
245		interrupt-parent = <&gpio3>;
246		interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
247	};
248};
249
250&ppvar_bigcpu_pwm {
251	regulator-min-microvolt = <798674>;
252	regulator-max-microvolt = <1302172>;
253};
254
255&ppvar_bigcpu {
256	regulator-min-microvolt = <798674>;
257	regulator-max-microvolt = <1302172>;
258	ctrl-voltage-range = <798674 1302172>;
259};
260
261&ppvar_litcpu_pwm {
262	regulator-min-microvolt = <799065>;
263	regulator-max-microvolt = <1303738>;
264};
265
266&ppvar_litcpu {
267	regulator-min-microvolt = <799065>;
268	regulator-max-microvolt = <1303738>;
269	ctrl-voltage-range = <799065 1303738>;
270};
271
272&ppvar_gpu_pwm {
273	regulator-min-microvolt = <785782>;
274	regulator-max-microvolt = <1217729>;
275};
276
277&ppvar_gpu {
278	regulator-min-microvolt = <785782>;
279	regulator-max-microvolt = <1217729>;
280	ctrl-voltage-range = <785782 1217729>;
281};
282
283&ppvar_centerlogic_pwm {
284	regulator-min-microvolt = <800069>;
285	regulator-max-microvolt = <1049692>;
286};
287
288&ppvar_centerlogic {
289	regulator-min-microvolt = <800069>;
290	regulator-max-microvolt = <1049692>;
291	ctrl-voltage-range = <800069 1049692>;
292};
293
294&saradc {
295	status = "okay";
296	vref-supply = <&pp1800_ap_io>;
297};
298
299&mvl_wifi {
300	marvell,wakeup-pin = <14>; /* GPIO_14 on Marvell */
301};
302
303&pinctrl {
304	digitizer {
305		/* Has external pullup */
306		cpu1_dig_irq_l: cpu1-dig-irq-l {
307			rockchip,pins = <2 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
308		};
309
310		/* Has external pullup */
311		cpu1_dig_pdct_l: cpu1-dig-pdct-l {
312			rockchip,pins = <2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
313		};
314	};
315
316	discrete-regulators {
317		cpu3_pen_pwr_en: cpu3-pen-pwr-en {
318			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
319		};
320	};
321
322	pen {
323		cpu1_pen_eject: cpu1-pen-eject {
324			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
325		};
326	};
327};
328