• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Devicetree for the Samsung XCover 2 GT-S7710 also known as Skomer.
4 */
5
6/dts-v1/;
7#include "ste-db8500.dtsi"
8#include "ste-ab8505.dtsi"
9#include "ste-dbx5x0-pinctrl.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/interrupt-controller/irq.h>
13
14/ {
15	model = "Samsung XCover 2 (GT-S7710)";
16	compatible = "samsung,skomer", "st-ericsson,u8500";
17
18	chosen {
19		stdout-path = &serial2;
20	};
21
22	/* TI TXS0206 level translator for 2.9 V */
23	sd_level_translator: regulator-gpio {
24		compatible = "regulator-fixed";
25
26		/* GPIO87 EN */
27		gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
28		enable-active-high;
29
30		regulator-name = "sd-level-translator";
31		regulator-min-microvolt = <2900000>;
32		regulator-max-microvolt = <2900000>;
33		regulator-type = "voltage";
34
35		startup-delay-us = <200>;
36
37		pinctrl-names = "default";
38		pinctrl-0 = <&sd_level_translator_default>;
39	};
40
41	/* External LDO MIC5366-3.3YMT for eMMC */
42	ldo_3v3_reg: regulator-gpio-ldo-3v3 {
43		compatible = "regulator-fixed";
44		regulator-name = "en-3v3-fixed-supply";
45		regulator-min-microvolt = <3300000>;
46		regulator-max-microvolt = <3300000>;
47		gpio = <&gpio6 31 GPIO_ACTIVE_HIGH>;
48		startup-delay-us = <5000>;
49		enable-active-high;
50		pinctrl-names = "default";
51		pinctrl-0 = <&emmc_ldo_en_default_mode>;
52	};
53
54	wlan_en: regulator-gpio-wlan-en {
55		compatible = "regulator-fixed";
56		regulator-name = "wl-reg-on";
57		regulator-min-microvolt = <3000000>;
58		regulator-max-microvolt = <3000000>;
59		startup-delay-us = <200000>;
60		/* GPIO215 WLAN_EN */
61		gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
62		enable-active-high;
63		pinctrl-names = "default";
64		pinctrl-0 = <&wlan_en_default_mode>;
65	};
66
67	vibrator {
68		compatible = "gpio-vibrator";
69		enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
70		pinctrl-names = "default";
71		pinctrl-0 = <&vibrator_default>;
72	};
73
74	gpio-keys {
75		compatible = "gpio-keys";
76		pinctrl-names = "default";
77		pinctrl-0 = <&gpio_keys_default_mode>;
78
79		button-home {
80			linux,code = <KEY_HOME>;
81			label = "HOME";
82			/* GPIO91 */
83			gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
84		};
85		button-volup {
86			linux,code = <KEY_VOLUMEUP>;
87			label = "VOL+";
88			/* GPIO67 */
89			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
90		};
91		button-voldown {
92			linux,code = <KEY_VOLUMEDOWN>;
93			label = "VOL-";
94			/* GPIO92 */
95			gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
96		};
97		button-menu {
98			linux,code = <KEY_MENU>;
99			label = "MENU";
100			/* GPIO204 */
101			gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
102		};
103		button-back {
104			linux,code = <KEY_BACK>;
105			label = "BACK";
106			/* GPIO205 */
107			gpios = <&gpio6 13 GPIO_ACTIVE_LOW>;
108		};
109	};
110
111	ktd253: backlight {
112		compatible = "kinetic,ktd253";
113		/* GPIO 69 */
114		enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
115		/* Default to 13/32 brightness */
116		default-brightness = <13>;
117		pinctrl-names = "default";
118		pinctrl-0 = <&gpio_backlight_default_mode>;
119	};
120
121	i2c-gpio-0 {
122		compatible = "i2c-gpio";
123		sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
124		scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
125		pinctrl-names = "default";
126		pinctrl-0 = <&i2c_gpio_0_default>;
127		#address-cells = <1>;
128		#size-cells = <0>;
129		/* TODO: this should be used by the NCP6914 Camera power management unit */
130	};
131
132	i2c-gpio-1 {
133		compatible = "i2c-gpio";
134		sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
135		scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
136		pinctrl-names = "default";
137		pinctrl-0 = <&i2c_gpio_1_default>;
138		#address-cells = <1>;
139		#size-cells = <0>;
140		magnetometer@c {
141			compatible = "alps,hscdtd008a";
142			reg = <0x0c>;
143			avdd-supply = <&ab8500_ldo_aux1_reg>;
144			dvdd-supply = <&ab8500_ldo_aux8_reg>;
145		};
146	};
147
148	soc {
149		// External Micro SD slot
150		sdi0_per1@80126000 {
151			arm,primecell-periphid = <0x10480180>;
152			max-frequency = <100000000>;
153			bus-width = <4>;
154			cap-sd-highspeed;
155			cap-mmc-highspeed;
156			/* All direction control is used */
157			st,sig-pin-fbclk;
158			full-pwr-cycle;
159			vmmc-supply = <&ab8500_ldo_aux3_reg>;
160			vqmmc-supply = <&sd_level_translator>;
161			pinctrl-names = "default", "sleep";
162			pinctrl-0 = <&mc0_a_1_default>;
163			pinctrl-1 = <&mc0_a_1_sleep>;
164			status = "okay";
165		};
166
167		// WLAN SDIO channel
168		sdi1_per2@80118000 {
169			arm,primecell-periphid = <0x10480180>;
170			max-frequency = <50000000>;
171			bus-width = <4>;
172			non-removable;
173			cap-sd-highspeed;
174			vmmc-supply = <&wlan_en>;
175			pinctrl-names = "default", "sleep";
176			pinctrl-0 = <&mc1_a_2_default>;
177			pinctrl-1 = <&mc1_a_2_sleep>;
178			status = "okay";
179			#address-cells = <1>;
180			#size-cells = <0>;
181
182			wifi@1 {
183				compatible = "brcm,bcm4329-fmac";
184				reg = <1>;
185				/* GPIO216 WL_HOST_WAKE */
186				interrupt-parent = <&gpio6>;
187				interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
188				interrupt-names = "host-wake";
189				pinctrl-names = "default";
190				pinctrl-0 = <&wlan_default_mode>;
191			};
192		};
193
194		// eMMC
195		sdi2_per3@80005000 {
196			arm,primecell-periphid = <0x10480180>;
197		        max-frequency = <100000000>;
198			bus-width = <8>;
199			non-removable;
200			cap-mmc-highspeed;
201			mmc-ddr-1_8v;
202			vmmc-supply = <&ldo_3v3_reg>;
203			pinctrl-names = "default", "sleep";
204			pinctrl-0 = <&mc2_a_1_default>;
205			pinctrl-1 = <&mc2_a_1_sleep>;
206
207			status = "okay";
208		};
209
210		/* GBF (Bluetooth) UART */
211		uart@80120000 {
212			pinctrl-names = "default", "sleep";
213			pinctrl-0 = <&u0_a_1_default>;
214			pinctrl-1 = <&u0_a_1_sleep>;
215			status = "okay";
216
217			/* FIXME: not quite working yet, probably needs regulators */
218			bluetooth {
219				compatible = "brcm,bcm4330-bt";
220				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
221				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
222				host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
223				pinctrl-names = "default";
224				pinctrl-0 = <&bluetooth_default_mode>;
225			};
226		};
227
228		/* GPF UART */
229		uart@80121000 {
230			status = "okay";
231			pinctrl-names = "default", "sleep";
232			pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
233			pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
234		};
235
236		/* Debugging console UART connected to AB8505 USB */
237		uart@80007000 {
238			status = "okay";
239			pinctrl-names = "default", "sleep";
240			pinctrl-0 = <&u2rxtx_c_1_default>;
241			pinctrl-1 = <&u2rxtx_c_1_sleep>;
242		};
243
244		prcmu@80157000 {
245			ab8505 {
246				ab8500_usb {
247					pinctrl-names = "default", "sleep";
248					pinctrl-0 = <&usb_a_1_default>;
249					pinctrl-1 = <&usb_a_1_sleep>;
250				};
251
252				ab8505-regulators {
253					ab8500_ldo_aux1 {
254						/* Used for VDD for sensors */
255						regulator-name = "AUX1";
256						regulator-min-microvolt = <3000000>;
257						regulator-max-microvolt = <3300000>;
258					};
259
260					ab8500_ldo_aux2 {
261						/* Supplies the Cypress TMA140 touchscreen only with 3.0V */
262						regulator-name = "AUX2";
263						regulator-min-microvolt = <3000000>;
264						regulator-max-microvolt = <3000000>;
265					};
266
267					ab8500_ldo_aux3 {
268						/* Used for voltage for external MMC/SD card */
269						regulator-name = "AUX3";
270						regulator-min-microvolt = <1100000>;
271						regulator-max-microvolt = <3300000>;
272					};
273
274					ab8500_ldo_aux4 {
275						regulator-name = "AUX4";
276						/* Hammer to 3.0V for the display */
277						regulator-min-microvolt = <3000000>;
278						regulator-max-microvolt = <3000000>;
279					};
280
281					ab8500_ldo_aux5 {
282						regulator-name = "AUX5";
283						/* Intended for 1V8 for touchscreen but actually left unused */
284						regulator-min-microvolt = <1050000>;
285						regulator-max-microvolt = <2790000>;
286					};
287
288					ab8500_ldo_aux6 {
289						regulator-name = "AUX6";
290						/* Hammer to 1.8V for the display */
291						regulator-min-microvolt = <1800000>;
292						regulator-max-microvolt = <1800000>;
293					};
294
295					ab8500_ldo_aux8 {
296						/* Mostly VIO for sensors */
297						regulator-name = "AUX8";
298					};
299				};
300			};
301		};
302
303		/* I2C0 */
304		i2c@80004000 {
305			status = "okay";
306
307			pinctrl-names = "default", "sleep";
308			pinctrl-0 = <&i2c0_a_1_default>;
309			pinctrl-1 = <&i2c0_a_1_sleep>;
310
311			proximity@44 {
312				compatible = "sharp,gp2ap002s00f";
313				clock-frequency = <400000>;
314				reg = <0x44>;
315
316				interrupt-parent = <&gpio4>;
317				interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
318				vdd-supply = <&ab8500_ldo_aux1_reg>;
319				vio-supply = <&ab8500_ldo_aux8_reg>;
320				pinctrl-names = "default";
321				pinctrl-0 = <&gp2ap002_skomer_default>;
322				sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
323				sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
324			};
325		};
326
327
328		/* I2C2 */
329		i2c@80128000 {
330			status = "okay";
331
332			pinctrl-names = "default", "sleep";
333			pinctrl-0 = <&i2c2_b_2_default>;
334			pinctrl-1 = <&i2c2_b_2_sleep>;
335
336			accel@18 {
337				compatible = "bosch,bma254";
338				clock-frequency = <400000>;
339				reg = <0x18>;
340
341				/* GPIO224 used as "smart alert" interrupt */
342				interrupt-parent = <&gpio7>;
343				interrupts = <0 IRQ_TYPE_EDGE_RISING>;
344
345				mount-matrix = "0", "-1", "0",
346					      "1", "0", "0",
347					       "0", "0", "1";
348				vdd-supply = <&ab8500_ldo_aux1_reg>;
349				vddio-supply = <&ab8500_ldo_aux8_reg>;
350				pinctrl-names = "default";
351				pinctrl-0 = <&bma254_skomer_default>;
352			};
353		};
354
355		/* I2C3 */
356		i2c@80110000 {
357			status = "okay";
358
359			pinctrl-names = "default", "sleep";
360			pinctrl-0 = <&i2c3_c_2_default>;
361			pinctrl-1 = <&i2c3_c_2_sleep>;
362
363			/* Cypress CY8CTMA140 touchscreen */
364			touchscreen@20 {
365				compatible = "cypress,cy8ctma140";
366				clock-frequency = <400000>;
367				reg = <0x20>;
368
369				touchscreen-size-x = <480>;
370				touchscreen-size-y = <800>;
371				touchscreen-max-pressure = <255>;
372
373				/* GPIO218 for IRQ */
374				interrupt-parent = <&gpio6>;
375				interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
376
377				/* VDD is "digital supply" nominally 1.71-3.6V */
378				vdd-supply = <&ab8500_ldo_aux2_reg>;
379				/* VCPIN is "analog supply", 2.7-3.6 V */
380				vcpin-supply = <&ab8500_ldo_aux2_reg>;
381
382				pinctrl-names = "default";
383				pinctrl-0 = <&tma140_skomer_default>;
384			};
385		};
386
387		mcde@a0350000 {
388			status = "okay";
389			pinctrl-names = "default";
390			pinctrl-0 = <&dsi_default_mode>;
391
392			dsi-controller@a0351000 {
393				panel {
394					/* NT35510-based Hydis HVA40WV1 */
395					compatible = "hydis,hva40wv1", "novatek,nt35510";
396					reg = <0>;
397					/* v_lcd_3v0 2.3-4.8V */
398					vdd-supply = <&ab8500_ldo_aux4_reg>;
399					/* v_lcd_1v8 1.65-3.3V */
400					vddi-supply = <&ab8500_ldo_aux6_reg>;
401					/* GPIO 139 */
402					reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
403					pinctrl-names = "default";
404					pinctrl-0 = <&display_default_mode>;
405					backlight = <&ktd253>;
406				};
407			};
408		};
409	};
410};
411
412&pinctrl {
413	/*
414	 * This extends the MC0 default config to include DAT32DIR
415	 * which is used by this machine. If we don't do this the
416	 * SD card does not work.
417	 */
418	sdi0 {
419		mc0_a_1_default {
420			default_mux {
421				function = "mc0";
422				/* This machine uses the DAT31 pin */
423				groups = "mc0_a_1", "mc0dat31dir_a_1";
424			};
425			default_cfg5 {
426				pins = "GPIO21_AB3"; /* DAT31DIR */
427				ste,config = <&out_hi>;
428			};
429		};
430	};
431
432	mcde {
433		dsi_default_mode: dsi_default {
434			default_mux1 {
435				/* Mux in VSI0 used for DSI TE */
436				function = "lcd";
437				groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
438			};
439			default_cfg1 {
440				pins = "GPIO68_E1"; /* VSI0 */
441				ste,config = <&in_nopull>;
442			};
443		};
444	};
445
446	/* Two GPIO lines used by the display */
447	display {
448		display_default_mode: display_default {
449			skomer_cfg1 {
450				/*
451				 * OLED DETECT or check_pba, this appears to be high
452				 * on "PBA" which I guess is "prototype board A".
453				 */
454				pins = "GPIO93_B7";
455				ste,config = <&gpio_in_nopull>;
456			};
457			skomer_cfg2 {
458				pins = "GPIO139_C9";
459				/*
460				 * MIPI_DSI0_RESET_N resets the display, leave high
461				 * (de-asserted) so we only assert reset explicitly
462				 * from the display driver.
463				 */
464				ste,config = <&gpio_out_hi>;
465			};
466		};
467	};
468	backlight {
469		gpio_backlight_default_mode: backlight_default {
470			skomer_cfg1 {
471				pins = "GPIO69_E2"; /* LCD_BL_CTRL */
472				ste,config = <&gpio_out_lo>;
473			};
474		};
475	};
476	/* GPIO that enables the 2.9V SD card level translator */
477	sd-level-translator {
478		sd_level_translator_default: sd_level_translator_default {
479			/* level shifter on GPIO87 */
480			skomer_cfg1 {
481				pins = "GPIO87_B3";
482				ste,config = <&gpio_out_hi>;
483			};
484		};
485	};
486	/* GPIO that enables the LDO regulator for the eMMC */
487	emmc-ldo {
488		emmc_ldo_en_default_mode: emmc_ldo_default {
489			/* LDO enable on GPIO223 */
490			skomer_cfg1 {
491				pins = "GPIO223_AH9";
492				ste,config = <&gpio_out_hi>;
493			};
494		};
495	};
496	/* GPIO keys */
497	gpio-keys {
498		gpio_keys_default_mode: gpio_keys_default {
499			skomer_cfg1 {
500				pins = "GPIO67_G2", /* VOL UP */
501				       "GPIO91_B6", /* HOME */
502				       "GPIO92_D6", /* VOL DOWN */
503				       "GPIO204_AF23", /* MENU */
504				       "GPIO205_AG23"; /* BACK */
505					ste,config = <&gpio_in_pu>;
506			};
507		};
508	};
509	/* Interrupt line for BMA254 */
510	bma254 {
511		bma254_skomer_default: bma254_skomer {
512			skomer_cfg1 {
513				pins = "GPIO224_AG9";
514				ste,config = <&gpio_in_pd>;
515			};
516		};
517	};
518	/* Interrupt line for light/proximity sensor GP2AP002 */
519	gp2ap002 {
520		gp2ap002_skomer_default: gp2ap002_skomer {
521			skomer_cfg1 {
522				pins = "GPIO146_D13";
523				ste,config = <&gpio_in_nopull>;
524			};
525		};
526	};
527	/* GPIO-based I2C bus for NCP6914 */
528	i2c-gpio-0 {
529		i2c_gpio_0_default: i2c_gpio_0 {
530			skomer_cfg1 {
531				pins = "GPIO143_D12", "GPIO144_B13";
532				ste,config = <&gpio_in_nopull>;
533			};
534		};
535	};
536	/* GPIO-based I2C bus for ALPS HSCD compass */
537	i2c-gpio-1 {
538		i2c_gpio_1_default: i2c_gpio_1 {
539			skomer_cfg1 {
540				pins = "GPIO151_B17", "GPIO152_D16";
541				ste,config = <&gpio_in_nopull>;
542			};
543		};
544	};
545	wlan {
546		wlan_default_mode: wlan_default {
547			skomer_cfg1 {
548				pins = "GPIO216_AG12";
549				ste,config = <&gpio_in_pd>;
550			};
551		};
552		wlan_en_default_mode: wlan_en_default {
553			skomer_cfg2 {
554				pins = "GPIO215_AH13";
555				ste,config = <&gpio_out_lo>;
556			};
557		};
558	};
559	bluetooth {
560		bluetooth_default_mode: bluetooth_default {
561			skomer_cfg1 {
562				pins = "GPIO199_AH23", "GPIO222_AJ9";
563				ste,config = <&gpio_out_lo>;
564			};
565			skomer_cfg2 {
566				pins = "GPIO97_D9";
567				ste,config = <&gpio_in_nopull>;
568			};
569		};
570	};
571	vibrator {
572		vibrator_default: vibrator_default {
573			skomer_cfg1 {
574				pins = "GPIO195_AG28";	/* MOT_EN */
575				ste,config = <&gpio_out_lo>;
576			};
577		};
578	};
579	/* Interrupt line for the Cypress TMA140 touchscreen */
580	touchscreen {
581		tma140_skomer_default: tma140_skomer {
582			skomer_cfg1 {
583				pins = "GPIO218_AH11";
584				ste,config = <&gpio_in_nopull>;
585			};
586		};
587	};
588};
589
590&ab8505_gpio {
591	/* Hog a few default settings */
592	pinctrl-names = "default";
593	pinctrl-0 = <&gpio_default>;
594
595	gpio {
596		gpio_default: gpio_default {
597			skomer_mux {
598				/* Change unused pins to GPIO mode */
599				function = "gpio";
600				groups = "gpio3_a_1",	/* default: SysClkReq4 */
601					 "gpio14_a_1";	/* default: PWMOut1 */
602			};
603			skomer_cfg1 {
604				pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
605				bias-disable;
606			};
607		};
608	};
609};
610