1#include "qcom-msm8974pro.dtsi"
2#include "qcom-pm8841.dtsi"
3#include "qcom-pm8941.dtsi"
4#include <dt-bindings/gpio/gpio.h>
5#include <dt-bindings/input/input.h>
6#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
7
8/ {
9	model = "Sony Xperia Z2 Tablet";
10	compatible = "sony,xperia-castor", "qcom,msm8974";
11
12	aliases {
13		serial0 = &blsp1_uart2;
14		serial1 = &blsp2_uart7;
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	gpio-keys {
22		compatible = "gpio-keys";
23		input-name = "gpio-keys";
24
25		pinctrl-names = "default";
26		pinctrl-0 = <&gpio_keys_pin_a>;
27
28		volume-down {
29			label = "volume_down";
30			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
31			linux,input-type = <1>;
32			linux,code = <KEY_VOLUMEDOWN>;
33		};
34
35		camera-snapshot {
36			label = "camera_snapshot";
37			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
38			linux,input-type = <1>;
39			linux,code = <KEY_CAMERA>;
40		};
41
42		camera-focus {
43			label = "camera_focus";
44			gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
45			linux,input-type = <1>;
46			linux,code = <KEY_CAMERA_FOCUS>;
47		};
48
49		volume-up {
50			label = "volume_up";
51			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
52			linux,input-type = <1>;
53			linux,code = <KEY_VOLUMEUP>;
54		};
55	};
56
57	smd {
58		rpm {
59			rpm_requests {
60				pm8941-regulators {
61					vdd_l1_l3-supply = <&pm8941_s1>;
62					vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
63					vdd_l4_l11-supply = <&pm8941_s1>;
64					vdd_l5_l7-supply = <&pm8941_s2>;
65					vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
66					vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
67					vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
68					vdd_l21-supply = <&vreg_boost>;
69
70					s1 {
71						regulator-min-microvolt = <1300000>;
72						regulator-max-microvolt = <1300000>;
73						regulator-always-on;
74						regulator-boot-on;
75					};
76
77					s2 {
78						regulator-min-microvolt = <2150000>;
79						regulator-max-microvolt = <2150000>;
80						regulator-boot-on;
81					};
82
83					s3 {
84						regulator-min-microvolt = <1800000>;
85						regulator-max-microvolt = <1800000>;
86						regulator-always-on;
87						regulator-boot-on;
88
89						regulator-system-load = <154000>;
90					};
91
92					s4 {
93						regulator-min-microvolt = <5000000>;
94						regulator-max-microvolt = <5000000>;
95					};
96
97					l1 {
98						regulator-min-microvolt = <1225000>;
99						regulator-max-microvolt = <1225000>;
100
101						regulator-always-on;
102						regulator-boot-on;
103					};
104
105					l2 {
106						regulator-min-microvolt = <1200000>;
107						regulator-max-microvolt = <1200000>;
108					};
109
110					l3 {
111						regulator-min-microvolt = <1200000>;
112						regulator-max-microvolt = <1200000>;
113					};
114
115					l4 {
116						regulator-min-microvolt = <1225000>;
117						regulator-max-microvolt = <1225000>;
118					};
119
120					l5 {
121						regulator-min-microvolt = <1800000>;
122						regulator-max-microvolt = <1800000>;
123					};
124
125					l6 {
126						regulator-min-microvolt = <1800000>;
127						regulator-max-microvolt = <1800000>;
128
129						regulator-boot-on;
130					};
131
132					l7 {
133						regulator-min-microvolt = <1800000>;
134						regulator-max-microvolt = <1800000>;
135
136						regulator-boot-on;
137					};
138
139					l8 {
140						regulator-min-microvolt = <1800000>;
141						regulator-max-microvolt = <1800000>;
142					};
143
144					l9 {
145						regulator-min-microvolt = <1800000>;
146						regulator-max-microvolt = <2950000>;
147					};
148
149					l11 {
150						regulator-min-microvolt = <1300000>;
151						regulator-max-microvolt = <1350000>;
152					};
153
154					l12 {
155						regulator-min-microvolt = <1800000>;
156						regulator-max-microvolt = <1800000>;
157
158						regulator-always-on;
159						regulator-boot-on;
160					};
161
162					l13 {
163						regulator-min-microvolt = <1800000>;
164						regulator-max-microvolt = <2950000>;
165
166						regulator-boot-on;
167					};
168
169					l14 {
170						regulator-min-microvolt = <1800000>;
171						regulator-max-microvolt = <1800000>;
172					};
173
174					l15 {
175						regulator-min-microvolt = <2050000>;
176						regulator-max-microvolt = <2050000>;
177					};
178
179					l16 {
180						regulator-min-microvolt = <2700000>;
181						regulator-max-microvolt = <2700000>;
182					};
183
184					l17 {
185						regulator-min-microvolt = <2700000>;
186						regulator-max-microvolt = <2700000>;
187					};
188
189					l18 {
190						regulator-min-microvolt = <2850000>;
191						regulator-max-microvolt = <2850000>;
192					};
193
194					l19 {
195						regulator-min-microvolt = <2850000>;
196						regulator-max-microvolt = <2850000>;
197					};
198
199					l20 {
200						regulator-min-microvolt = <2950000>;
201						regulator-max-microvolt = <2950000>;
202
203						regulator-allow-set-load;
204						regulator-boot-on;
205						regulator-allow-set-load;
206						regulator-system-load = <500000>;
207					};
208
209					l21 {
210						regulator-min-microvolt = <2950000>;
211						regulator-max-microvolt = <2950000>;
212
213						regulator-boot-on;
214					};
215
216					l22 {
217						regulator-min-microvolt = <3000000>;
218						regulator-max-microvolt = <3000000>;
219					};
220
221					l23 {
222						regulator-min-microvolt = <2800000>;
223						regulator-max-microvolt = <2800000>;
224					};
225
226					l24 {
227						regulator-min-microvolt = <3075000>;
228						regulator-max-microvolt = <3075000>;
229
230						regulator-boot-on;
231					};
232				};
233			};
234		};
235	};
236
237	vreg_bl_vddio: lcd-backlight-vddio {
238		compatible = "regulator-fixed";
239		regulator-name = "vreg_bl_vddio";
240		regulator-min-microvolt = <3150000>;
241		regulator-max-microvolt = <3150000>;
242
243		gpio = <&msmgpio 69 0>;
244		enable-active-high;
245
246		vin-supply = <&pm8941_s3>;
247		startup-delay-us = <70000>;
248
249		pinctrl-names = "default";
250		pinctrl-0 = <&lcd_backlight_en_pin_a>;
251	};
252
253	vreg_vsp: lcd-dcdc-regulator {
254		compatible = "regulator-fixed";
255		regulator-name = "vreg_vsp";
256		regulator-min-microvolt = <5600000>;
257		regulator-max-microvolt = <5600000>;
258
259		gpio = <&pm8941_gpios 20 GPIO_ACTIVE_HIGH>;
260		enable-active-high;
261
262		pinctrl-names = "default";
263		pinctrl-0 = <&lcd_dcdc_en_pin_a>;
264	};
265
266	vreg_wlan: wlan-regulator {
267		compatible = "regulator-fixed";
268
269		regulator-name = "wl-reg";
270		regulator-min-microvolt = <3300000>;
271		regulator-max-microvolt = <3300000>;
272
273		gpio = <&pm8941_gpios 18 GPIO_ACTIVE_HIGH>;
274		enable-active-high;
275
276		pinctrl-names = "default";
277		pinctrl-0 = <&wlan_regulator_pin>;
278	};
279};
280
281&soc {
282	sdhci@f9824900 {
283		status = "okay";
284
285		vmmc-supply = <&pm8941_l20>;
286		vqmmc-supply = <&pm8941_s3>;
287
288		bus-width = <8>;
289		non-removable;
290
291		pinctrl-names = "default";
292		pinctrl-0 = <&sdhc1_pin_a>;
293	};
294
295	sdhci@f9864900 {
296		status = "okay";
297
298		max-frequency = <100000000>;
299		non-removable;
300		vmmc-supply = <&vreg_wlan>;
301
302		pinctrl-names = "default";
303		pinctrl-0 = <&sdhc3_pin_a>;
304
305		#address-cells = <1>;
306		#size-cells = <0>;
307
308		bcrmf@1 {
309			compatible = "brcm,bcm4339-fmac", "brcm,bcm4329-fmac";
310			reg = <1>;
311
312			brcm,drive-strength = <10>;
313
314			pinctrl-names = "default";
315			pinctrl-0 = <&wlan_sleep_clk_pin>;
316		};
317	};
318
319	sdhci@f98a4900 {
320		status = "okay";
321
322		bus-width = <4>;
323
324		vmmc-supply = <&pm8941_l21>;
325		vqmmc-supply = <&pm8941_l13>;
326
327		cd-gpios = <&msmgpio 62 GPIO_ACTIVE_LOW>;
328
329		pinctrl-names = "default";
330		pinctrl-0 = <&sdhc2_pin_a>, <&sdhc2_cd_pin_a>;
331	};
332
333	serial@f991e000 {
334		status = "okay";
335
336		pinctrl-names = "default";
337		pinctrl-0 = <&blsp1_uart2_pin_a>;
338	};
339
340	serial@f995d000 {
341		status = "ok";
342
343		pinctrl-names = "default";
344		pinctrl-0 = <&blsp2_uart7_pin_a>;
345
346		bluetooth {
347			compatible = "brcm,bcm43438-bt";
348			max-speed = <3000000>;
349
350			pinctrl-names = "default";
351			pinctrl-0 = <&bt_host_wake_pin>,
352				    <&bt_dev_wake_pin>,
353				    <&bt_reg_on_pin>;
354
355			host-wakeup-gpios = <&msmgpio 95 GPIO_ACTIVE_HIGH>;
356			device-wakeup-gpios = <&msmgpio 96 GPIO_ACTIVE_HIGH>;
357			shutdown-gpios = <&pm8941_gpios 16 GPIO_ACTIVE_HIGH>;
358		};
359	};
360
361	usb@f9a55000 {
362		status = "okay";
363
364		phys = <&usb_hs1_phy>;
365		phy-select = <&tcsr 0xb000 0>;
366		extcon = <&smbb>, <&usb_id>;
367		vbus-supply = <&chg_otg>;
368
369		hnp-disable;
370		srp-disable;
371		adp-disable;
372
373		ulpi {
374			phy@a {
375				status = "okay";
376
377				v1p8-supply = <&pm8941_l6>;
378				v3p3-supply = <&pm8941_l24>;
379
380				extcon = <&smbb>;
381				qcom,init-seq = /bits/ 8 <0x1 0x64>;
382			};
383		};
384	};
385
386	pinctrl@fd510000 {
387		blsp1_uart2_pin_a: blsp1-uart2-pin-active {
388			rx {
389				pins = "gpio5";
390				function = "blsp_uart2";
391
392				drive-strength = <2>;
393				bias-pull-up;
394			};
395
396			tx {
397				pins = "gpio4";
398				function = "blsp_uart2";
399
400				drive-strength = <4>;
401				bias-disable;
402			};
403		};
404
405		blsp2_uart7_pin_a: blsp2-uart7-pin-active {
406			tx {
407				pins = "gpio41";
408				function = "blsp_uart7";
409
410				drive-strength = <2>;
411				bias-disable;
412			};
413
414			rx {
415				pins = "gpio42";
416				function = "blsp_uart7";
417
418				drive-strength = <2>;
419				bias-pull-up;
420			};
421
422			cts {
423				pins = "gpio43";
424				function = "blsp_uart7";
425
426				drive-strength = <2>;
427				bias-pull-up;
428			};
429
430			rts {
431				pins = "gpio44";
432				function = "blsp_uart7";
433
434				drive-strength = <2>;
435				bias-disable;
436			};
437		};
438
439		i2c8_pins: i2c8 {
440			mux {
441				pins = "gpio47", "gpio48";
442				function = "blsp_i2c8";
443
444				drive-strength = <2>;
445				bias-disable;
446			};
447		};
448
449		i2c11_pins: i2c11 {
450			mux {
451				pins = "gpio83", "gpio84";
452				function = "blsp_i2c11";
453
454				drive-strength = <2>;
455				bias-disable;
456			};
457		};
458
459		lcd_backlight_en_pin_a: lcd-backlight-vddio {
460			pins = "gpio69";
461			drive-strength = <10>;
462			output-low;
463			bias-disable;
464		};
465
466		sdhc1_pin_a: sdhc1-pin-active {
467			clk {
468				pins = "sdc1_clk";
469				drive-strength = <16>;
470				bias-disable;
471			};
472
473			cmd-data {
474				pins = "sdc1_cmd", "sdc1_data";
475				drive-strength = <10>;
476				bias-pull-up;
477			};
478		};
479
480		sdhc2_cd_pin_a: sdhc2-cd-pin-active {
481			pins = "gpio62";
482			function = "gpio";
483
484			drive-strength = <2>;
485			bias-disable;
486		 };
487
488		sdhc2_pin_a: sdhc2-pin-active {
489			clk {
490				pins = "sdc2_clk";
491				drive-strength = <6>;
492				bias-disable;
493			};
494
495			cmd-data {
496				pins = "sdc2_cmd", "sdc2_data";
497				drive-strength = <6>;
498				bias-pull-up;
499			};
500		};
501
502		sdhc3_pin_a: sdhc3-pin-active {
503			clk {
504				pins = "gpio40";
505				function = "sdc3";
506
507				drive-strength = <10>;
508				bias-disable;
509			};
510
511			cmd {
512				pins = "gpio39";
513				function = "sdc3";
514
515				drive-strength = <10>;
516				bias-pull-up;
517			};
518
519			data {
520				pins = "gpio35", "gpio36", "gpio37", "gpio38";
521				function = "sdc3";
522
523				drive-strength = <10>;
524				bias-pull-up;
525			};
526		};
527
528		ts_int_pin: synaptics {
529			pin {
530				pins = "gpio86";
531				function = "gpio";
532
533				drive-strength = <2>;
534				bias-disable;
535				input-enable;
536			};
537		};
538
539		bt_host_wake_pin: bt-host-wake {
540			pins = "gpio95";
541			function = "gpio";
542
543			drive-strength = <2>;
544			bias-disable;
545			output-low;
546		};
547
548		bt_dev_wake_pin: bt-dev-wake {
549			pins = "gpio96";
550			function = "gpio";
551
552			drive-strength = <2>;
553			bias-disable;
554		};
555	};
556
557	i2c@f9964000 {
558		status = "okay";
559
560		clock-frequency = <355000>;
561		qcom,src-freq = <50000000>;
562
563		pinctrl-names = "default";
564		pinctrl-0 = <&i2c8_pins>;
565
566		synaptics@2c {
567			compatible = "syna,rmi4-i2c";
568			reg = <0x2c>;
569
570			interrupt-parent = <&msmgpio>;
571			interrupts = <86 IRQ_TYPE_EDGE_FALLING>;
572
573			#address-cells = <1>;
574			#size-cells = <0>;
575
576			vdd-supply = <&pm8941_l22>;
577			vio-supply = <&pm8941_lvs3>;
578
579			pinctrl-names = "default";
580			pinctrl-0 = <&ts_int_pin>;
581
582			syna,startup-delay-ms = <10>;
583
584			rmi-f01@1 {
585				reg = <0x1>;
586				syna,nosleep = <1>;
587			};
588
589			rmi-f11@11 {
590				reg = <0x11>;
591				syna,f11-flip-x = <1>;
592				syna,sensor-type = <1>;
593			};
594		};
595	};
596
597	i2c@f9967000 {
598		status = "okay";
599		pinctrl-names = "default";
600		pinctrl-0 = <&i2c11_pins>;
601		clock-frequency = <355000>;
602		qcom,src-freq = <50000000>;
603
604		lp8566_wled: backlight@2c {
605			compatible = "ti,lp8556";
606			reg = <0x2c>;
607			power-supply = <&vreg_bl_vddio>;
608
609			bl-name = "backlight";
610			dev-ctrl = /bits/ 8 <0x05>;
611			init-brt = /bits/ 8 <0x3f>;
612			rom_a0h {
613				rom-addr = /bits/ 8 <0xa0>;
614				rom-val = /bits/ 8 <0xff>;
615			};
616			rom_a1h {
617				rom-addr = /bits/ 8 <0xa1>;
618				rom-val = /bits/ 8 <0x3f>;
619			};
620			rom_a2h {
621				rom-addr = /bits/ 8 <0xa2>;
622				rom-val = /bits/ 8 <0x20>;
623			};
624			rom_a3h {
625				rom-addr = /bits/ 8 <0xa3>;
626				rom-val = /bits/ 8 <0x5e>;
627			};
628			rom_a4h {
629				rom-addr = /bits/ 8 <0xa4>;
630				rom-val = /bits/ 8 <0x02>;
631			};
632			rom_a5h {
633				rom-addr = /bits/ 8 <0xa5>;
634				rom-val = /bits/ 8 <0x04>;
635			};
636			rom_a6h {
637				rom-addr = /bits/ 8 <0xa6>;
638				rom-val = /bits/ 8 <0x80>;
639			};
640			rom_a7h {
641				rom-addr = /bits/ 8 <0xa7>;
642				rom-val = /bits/ 8 <0xf7>;
643			};
644			rom_a9h {
645				rom-addr = /bits/ 8 <0xa9>;
646				rom-val = /bits/ 8 <0x80>;
647			};
648			rom_aah {
649				rom-addr = /bits/ 8 <0xaa>;
650				rom-val = /bits/ 8 <0x0f>;
651			};
652			rom_aeh {
653				rom-addr = /bits/ 8 <0xae>;
654				rom-val = /bits/ 8 <0x0f>;
655			};
656		};
657	};
658};
659
660&spmi_bus {
661	pm8941@0 {
662		charger@1000 {
663			qcom,fast-charge-safe-current = <1500000>;
664			qcom,fast-charge-current-limit = <1500000>;
665			qcom,dc-current-limit = <1800000>;
666			qcom,fast-charge-safe-voltage = <4400000>;
667			qcom,fast-charge-high-threshold-voltage = <4350000>;
668			qcom,fast-charge-low-threshold-voltage = <3400000>;
669			qcom,auto-recharge-threshold-voltage = <4200000>;
670			qcom,minimum-input-voltage = <4300000>;
671		};
672
673		gpios@c000 {
674			gpio_keys_pin_a: gpio-keys-active {
675				pins = "gpio2", "gpio5";
676				function = "normal";
677
678				bias-pull-up;
679				power-source = <PM8941_GPIO_S3>;
680			};
681
682			bt_reg_on_pin: bt-reg-on {
683				pins = "gpio16";
684				function = "normal";
685
686				output-low;
687				power-source = <PM8941_GPIO_S3>;
688			};
689
690			wlan_sleep_clk_pin: wl-sleep-clk {
691				pins = "gpio17";
692				function = "func2";
693
694				output-high;
695				power-source = <PM8941_GPIO_S3>;
696			};
697
698			wlan_regulator_pin: wl-reg-active {
699				pins = "gpio18";
700				function = "normal";
701
702				bias-disable;
703				power-source = <PM8941_GPIO_S3>;
704			};
705
706			lcd_dcdc_en_pin_a: lcd-dcdc-en-active {
707				pins = "gpio20";
708				function = "normal";
709
710				bias-disable;
711				power-source = <PM8941_GPIO_S3>;
712				input-disable;
713				output-low;
714			};
715
716		};
717
718		coincell@2800 {
719			status = "okay";
720			qcom,rset-ohms = <2100>;
721			qcom,vset-millivolts = <3000>;
722		};
723	};
724};
725