1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Matti Lehtimäki <matti.lehtimaki@gmail.com>
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/input/input.h>
9#include "qcom-msm8226.dtsi"
10#include "qcom-pm8226.dtsi"
11
12/delete-node/ &adsp_region;
13/delete-node/ &smem_region;
14
15/ {
16	model = "Samsung Galaxy Tab 4 10.1";
17	compatible = "samsung,matisse-wifi", "qcom,apq8026";
18	chassis-type = "tablet";
19
20	aliases {
21		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
22		mmc1 = &sdhc_2; /* SDC2 SD card slot */
23		display0 = &framebuffer0;
24	};
25
26	chosen {
27		#address-cells = <1>;
28		#size-cells = <1>;
29		ranges;
30
31		stdout-path = "display0";
32
33		framebuffer0: framebuffer@3200000 {
34			compatible = "simple-framebuffer";
35			reg = <0x03200000 0x800000>;
36			width = <1280>;
37			height = <800>;
38			stride = <(1280 * 3)>;
39			format = "r8g8b8";
40		};
41	};
42
43	gpio-hall-sensor {
44		compatible = "gpio-keys";
45
46		event-hall-sensor {
47			label = "Hall Effect Sensor";
48			gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
49			interrupts = <&tlmm 110 IRQ_TYPE_EDGE_FALLING>;
50			linux,input-type = <EV_SW>;
51			linux,code = <SW_LID>;
52			debounce-interval = <15>;
53			wakeup-source;
54		};
55	};
56
57	gpio-keys {
58		compatible = "gpio-keys";
59		autorepeat;
60
61		key-home {
62			label = "Home";
63			gpios = <&tlmm 108 GPIO_ACTIVE_LOW>;
64			linux,code = <KEY_HOMEPAGE>;
65			debounce-interval = <15>;
66		};
67
68		key-volume-down {
69			label = "Volume Down";
70			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
71			linux,code = <KEY_VOLUMEDOWN>;
72			debounce-interval = <15>;
73		};
74
75		key-volume-up {
76			label = "Volume Up";
77			gpios = <&tlmm 106 GPIO_ACTIVE_LOW>;
78			linux,code = <KEY_VOLUMEUP>;
79			debounce-interval = <15>;
80		};
81	};
82
83	i2c-backlight {
84		compatible = "i2c-gpio";
85		sda-gpios = <&tlmm 20 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
86		scl-gpios = <&tlmm 21 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
87
88		pinctrl-0 = <&backlight_i2c_default_state>;
89		pinctrl-names = "default";
90
91		i2c-gpio,delay-us = <4>;
92
93		#address-cells = <1>;
94		#size-cells = <0>;
95
96		backlight@2c {
97			compatible = "ti,lp8556";
98			reg = <0x2c>;
99
100			dev-ctrl = /bits/ 8 <0x80>;
101			init-brt = /bits/ 8 <0x3f>;
102			pwm-period = <100000>;
103
104			pwms = <&backlight_pwm 0 100000>;
105			pwm-names = "lp8556";
106
107			rom-a0h {
108				rom-addr = /bits/ 8 <0xa0>;
109				rom-val = /bits/ 8 <0x44>;
110			};
111
112			rom-a1h {
113				rom-addr = /bits/ 8 <0xa1>;
114				rom-val = /bits/ 8 <0x6c>;
115			};
116
117			rom-a5h {
118				rom-addr = /bits/ 8 <0xa5>;
119				rom-val = /bits/ 8 <0x24>;
120			};
121		};
122	};
123
124	backlight_pwm: pwm {
125		compatible = "clk-pwm";
126		#pwm-cells = <2>;
127		clocks = <&mmcc CAMSS_GP0_CLK>;
128		pinctrl-0 = <&backlight_pwm_default_state>;
129		pinctrl-names = "default";
130	};
131
132	reg_tsp_1p8v: regulator-tsp-1p8v {
133		compatible = "regulator-fixed";
134		regulator-name = "tsp_1p8v";
135		regulator-min-microvolt = <1800000>;
136		regulator-max-microvolt = <1800000>;
137
138		gpio = <&tlmm 31 GPIO_ACTIVE_HIGH>;
139		enable-active-high;
140
141		pinctrl-names = "default";
142		pinctrl-0 = <&tsp_en_default_state>;
143	};
144
145	reg_tsp_3p3v: regulator-tsp-3p3v {
146		compatible = "regulator-fixed";
147		regulator-name = "tsp_3p3v";
148		regulator-min-microvolt = <3300000>;
149		regulator-max-microvolt = <3300000>;
150
151		gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
152		enable-active-high;
153
154		pinctrl-names = "default";
155		pinctrl-0 = <&tsp_en1_default_state>;
156	};
157
158	reserved-memory {
159		#address-cells = <1>;
160		#size-cells = <1>;
161		ranges;
162
163		framebuffer@3200000 {
164			reg = <0x03200000 0x800000>;
165			no-map;
166		};
167
168		mpss@8400000 {
169			reg = <0x08400000 0x1f00000>;
170			no-map;
171		};
172
173		mba@a300000 {
174			reg = <0x0a300000 0x100000>;
175			no-map;
176		};
177
178		reserved@cb00000 {
179			reg = <0x0cb00000 0x700000>;
180			no-map;
181		};
182
183		wcnss@d200000 {
184			reg = <0x0d200000 0x700000>;
185			no-map;
186		};
187
188		adsp_region: adsp@d900000 {
189			reg = <0x0d900000 0x1800000>;
190			no-map;
191		};
192
193		venus@f100000 {
194			reg = <0x0f100000 0x500000>;
195			no-map;
196		};
197
198		smem_region: smem@fa00000 {
199			reg = <0x0fa00000 0x100000>;
200			no-map;
201		};
202
203		reserved@fb00000 {
204			reg = <0x0fb00000 0x260000>;
205			no-map;
206		};
207
208		rfsa@fd60000 {
209			reg = <0x0fd60000 0x20000>;
210			no-map;
211		};
212
213		rmtfs@fd80000 {
214			compatible = "qcom,rmtfs-mem";
215			reg = <0x0fd80000 0x180000>;
216			no-map;
217
218			qcom,client-id = <1>;
219		};
220	};
221};
222
223&adsp {
224	status = "okay";
225};
226
227&blsp1_i2c2 {
228	status = "okay";
229
230	accelerometer@1d {
231		compatible = "st,lis2hh12";
232		reg = <0x1d>;
233
234		interrupt-parent = <&tlmm>;
235		interrupts = <54 IRQ_TYPE_LEVEL_HIGH>;
236
237		pinctrl-names = "default";
238		pinctrl-0 = <&accel_int_default_state>;
239
240		st,drdy-int-pin = <1>;
241
242		vdd-supply = <&pm8226_l19>;
243		vddio-supply = <&pm8226_lvs1>;
244	};
245};
246
247&blsp1_i2c4 {
248	status = "okay";
249
250	muic: usb-switch@25 {
251		compatible = "siliconmitus,sm5502-muic";
252		reg = <0x25>;
253
254		interrupt-parent = <&tlmm>;
255		interrupts = <67 IRQ_TYPE_EDGE_FALLING>;
256
257		pinctrl-names = "default";
258		pinctrl-0 = <&muic_int_default_state>;
259	};
260};
261
262&blsp1_i2c5 {
263	status = "okay";
264
265	touchscreen@4a {
266		compatible = "atmel,maxtouch";
267		reg = <0x4a>;
268
269		interrupt-parent = <&tlmm>;
270		interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
271
272		pinctrl-names = "default";
273		pinctrl-0 = <&tsp_int_rst_default_state>;
274
275		reset-gpios = <&pm8226_gpios 6 GPIO_ACTIVE_LOW>;
276
277		vdd-supply = <&reg_tsp_1p8v>;
278		vdda-supply = <&reg_tsp_3p3v>;
279	};
280};
281
282&rpm_requests {
283	regulators {
284		compatible = "qcom,rpm-pm8226-regulators";
285
286		pm8226_s3: s3 {
287			regulator-min-microvolt = <1200000>;
288			regulator-max-microvolt = <1300000>;
289		};
290
291		pm8226_s4: s4 {
292			regulator-min-microvolt = <1800000>;
293			regulator-max-microvolt = <1800000>;
294		};
295
296		pm8226_s5: s5 {
297			regulator-min-microvolt = <1150000>;
298			regulator-max-microvolt = <1150000>;
299		};
300
301		pm8226_l1: l1 {
302			regulator-min-microvolt = <1225000>;
303			regulator-max-microvolt = <1225000>;
304		};
305
306		pm8226_l2: l2 {
307			regulator-min-microvolt = <1200000>;
308			regulator-max-microvolt = <1200000>;
309		};
310
311		pm8226_l3: l3 {
312			regulator-min-microvolt = <750000>;
313			regulator-max-microvolt = <1337500>;
314			regulator-always-on;
315		};
316
317		pm8226_l4: l4 {
318			regulator-min-microvolt = <1200000>;
319			regulator-max-microvolt = <1200000>;
320		};
321
322		pm8226_l5: l5 {
323			regulator-min-microvolt = <1200000>;
324			regulator-max-microvolt = <1200000>;
325		};
326
327		pm8226_l6: l6 {
328			regulator-min-microvolt = <1800000>;
329			regulator-max-microvolt = <1800000>;
330			regulator-always-on;
331		};
332
333		pm8226_l7: l7 {
334			regulator-min-microvolt = <1850000>;
335			regulator-max-microvolt = <1850000>;
336		};
337
338		pm8226_l8: l8 {
339			regulator-min-microvolt = <1800000>;
340			regulator-max-microvolt = <1800000>;
341			regulator-always-on;
342		};
343
344		pm8226_l9: l9 {
345			regulator-min-microvolt = <2050000>;
346			regulator-max-microvolt = <2050000>;
347		};
348
349		pm8226_l10: l10 {
350			regulator-min-microvolt = <1800000>;
351			regulator-max-microvolt = <1800000>;
352		};
353
354		pm8226_l12: l12 {
355			regulator-min-microvolt = <1800000>;
356			regulator-max-microvolt = <1800000>;
357		};
358
359		pm8226_l14: l14 {
360			regulator-min-microvolt = <2750000>;
361			regulator-max-microvolt = <2750000>;
362		};
363
364		pm8226_l15: l15 {
365			regulator-min-microvolt = <1800000>;
366			regulator-max-microvolt = <3300000>;
367		};
368
369		pm8226_l16: l16 {
370			regulator-min-microvolt = <3000000>;
371			regulator-max-microvolt = <3350000>;
372		};
373
374		pm8226_l17: l17 {
375			regulator-min-microvolt = <2950000>;
376			regulator-max-microvolt = <2950000>;
377
378			regulator-system-load = <200000>;
379			regulator-allow-set-load;
380			regulator-always-on;
381		};
382
383		pm8226_l18: l18 {
384			regulator-min-microvolt = <2950000>;
385			regulator-max-microvolt = <2950000>;
386		};
387
388		pm8226_l19: l19 {
389			regulator-min-microvolt = <2850000>;
390			regulator-max-microvolt = <3000000>;
391		};
392
393		pm8226_l20: l20 {
394			regulator-min-microvolt = <3075000>;
395			regulator-max-microvolt = <3075000>;
396		};
397
398		pm8226_l21: l21 {
399			regulator-min-microvolt = <1800000>;
400			regulator-max-microvolt = <2950000>;
401		};
402
403		pm8226_l22: l22 {
404			regulator-min-microvolt = <1800000>;
405			regulator-max-microvolt = <3000000>;
406		};
407
408		pm8226_l23: l23 {
409			regulator-min-microvolt = <1800000>;
410			regulator-max-microvolt = <3300000>;
411		};
412
413		pm8226_l24: l24 {
414			regulator-min-microvolt = <1300000>;
415			regulator-max-microvolt = <1350000>;
416		};
417
418		pm8226_l25: l25 {
419			regulator-min-microvolt = <1775000>;
420			regulator-max-microvolt = <2125000>;
421		};
422
423		pm8226_l26: l26 {
424			regulator-min-microvolt = <1225000>;
425			regulator-max-microvolt = <1300000>;
426		};
427
428		pm8226_l27: l27 {
429			regulator-min-microvolt = <1800000>;
430			regulator-max-microvolt = <1800000>;
431		};
432
433		pm8226_l28: l28 {
434			regulator-min-microvolt = <1800000>;
435			regulator-max-microvolt = <2950000>;
436		};
437
438		pm8226_lvs1: lvs1 {};
439	};
440};
441
442&sdhc_1 {
443	vmmc-supply = <&pm8226_l17>;
444	vqmmc-supply = <&pm8226_l6>;
445
446	bus-width = <8>;
447	non-removable;
448
449	status = "okay";
450};
451
452&sdhc_2 {
453	vmmc-supply = <&pm8226_l18>;
454	vqmmc-supply = <&pm8226_l21>;
455
456	bus-width = <4>;
457	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
458
459	status = "okay";
460};
461
462&tlmm {
463	accel_int_default_state: accel-int-default-state {
464		pins = "gpio54";
465		function = "gpio";
466		drive-strength = <2>;
467		bias-disable;
468	};
469
470	backlight_i2c_default_state: backlight-i2c-default-state {
471		pins = "gpio20", "gpio21";
472		function = "gpio";
473		drive-strength = <2>;
474		bias-disable;
475	};
476
477	backlight_pwm_default_state: backlight-pwm-default-state {
478		pins = "gpio33";
479		function = "gp0_clk";
480	};
481
482	muic_int_default_state: muic-int-default-state {
483		pins = "gpio67";
484		function = "gpio";
485		drive-strength = <2>;
486		bias-disable;
487	};
488
489	tsp_en_default_state: tsp-en-default-state {
490		pins = "gpio31";
491		function = "gpio";
492		drive-strength = <2>;
493		bias-disable;
494	};
495
496	tsp_en1_default_state: tsp-en1-default-state {
497		pins = "gpio73";
498		function = "gpio";
499		drive-strength = <2>;
500		bias-disable;
501	};
502
503	tsp_int_rst_default_state: tsp-int-rst-default-state {
504		pins = "gpio17";
505		function = "gpio";
506		drive-strength = <10>;
507		bias-pull-up;
508	};
509};
510
511&usb {
512	extcon = <&muic>, <&muic>;
513	status = "okay";
514};
515
516&usb_hs_phy {
517	extcon = <&muic>;
518	v1p8-supply = <&pm8226_l10>;
519	v3p3-supply = <&pm8226_l20>;
520};
521