• 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-dir-cmd;
158			st,sig-dir-dat0;
159			st,sig-dir-dat2;
160			st,sig-dir-dat31;
161			st,sig-pin-fbclk;
162			full-pwr-cycle;
163			vmmc-supply = <&ab8500_ldo_aux3_reg>;
164			vqmmc-supply = <&sd_level_translator>;
165			pinctrl-names = "default", "sleep";
166			pinctrl-0 = <&mc0_a_1_default>;
167			pinctrl-1 = <&mc0_a_1_sleep>;
168			status = "okay";
169		};
170
171		// WLAN SDIO channel
172		sdi1_per2@80118000 {
173			arm,primecell-periphid = <0x10480180>;
174			max-frequency = <50000000>;
175			bus-width = <4>;
176			non-removable;
177			cap-sd-highspeed;
178			vmmc-supply = <&wlan_en>;
179			pinctrl-names = "default", "sleep";
180			pinctrl-0 = <&mc1_a_2_default>;
181			pinctrl-1 = <&mc1_a_2_sleep>;
182			status = "okay";
183			#address-cells = <1>;
184			#size-cells = <0>;
185
186			wifi@1 {
187				compatible = "brcm,bcm4329-fmac";
188				reg = <1>;
189				/* GPIO216 WL_HOST_WAKE */
190				interrupt-parent = <&gpio6>;
191				interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
192				interrupt-names = "host-wake";
193				pinctrl-names = "default";
194				pinctrl-0 = <&wlan_default_mode>;
195			};
196		};
197
198		// eMMC
199		sdi2_per3@80005000 {
200			arm,primecell-periphid = <0x10480180>;
201		        max-frequency = <100000000>;
202			bus-width = <8>;
203			non-removable;
204			cap-mmc-highspeed;
205			mmc-ddr-1_8v;
206			vmmc-supply = <&ldo_3v3_reg>;
207			pinctrl-names = "default", "sleep";
208			pinctrl-0 = <&mc2_a_1_default>;
209			pinctrl-1 = <&mc2_a_1_sleep>;
210
211			status = "okay";
212		};
213
214		/* GBF (Bluetooth) UART */
215		uart@80120000 {
216			pinctrl-names = "default", "sleep";
217			pinctrl-0 = <&u0_a_1_default>;
218			pinctrl-1 = <&u0_a_1_sleep>;
219			status = "okay";
220
221			/* FIXME: not quite working yet, probably needs regulators */
222			bluetooth {
223				compatible = "brcm,bcm4330-bt";
224				shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
225				device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
226				host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
227				pinctrl-names = "default";
228				pinctrl-0 = <&bluetooth_default_mode>;
229			};
230		};
231
232		/* GPF UART */
233		uart@80121000 {
234			status = "okay";
235			pinctrl-names = "default", "sleep";
236			pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
237			pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
238		};
239
240		/* Debugging console UART connected to AB8505 USB */
241		uart@80007000 {
242			status = "okay";
243			pinctrl-names = "default", "sleep";
244			pinctrl-0 = <&u2rxtx_c_1_default>;
245			pinctrl-1 = <&u2rxtx_c_1_sleep>;
246		};
247
248		prcmu@80157000 {
249			ab8505 {
250				ab8500_usb {
251					pinctrl-names = "default", "sleep";
252					pinctrl-0 = <&usb_a_1_default>;
253					pinctrl-1 = <&usb_a_1_sleep>;
254				};
255
256				ab8505-regulators {
257					ab8500_ldo_aux1 {
258						/* Used for VDD for sensors */
259						regulator-name = "AUX1";
260						regulator-min-microvolt = <3000000>;
261						regulator-max-microvolt = <3300000>;
262					};
263
264					ab8500_ldo_aux2 {
265						/* Supplies the Cypress TMA140 touchscreen only with 3.0V */
266						regulator-name = "AUX2";
267						regulator-min-microvolt = <3000000>;
268						regulator-max-microvolt = <3000000>;
269					};
270
271					ab8500_ldo_aux3 {
272						/* Used for voltage for external MMC/SD card */
273						regulator-name = "AUX3";
274						regulator-min-microvolt = <1100000>;
275						regulator-max-microvolt = <3300000>;
276					};
277
278					ab8500_ldo_aux4 {
279						regulator-name = "AUX4";
280						/* Hammer to 3.0V for the display */
281						regulator-min-microvolt = <3000000>;
282						regulator-max-microvolt = <3000000>;
283					};
284
285					ab8500_ldo_aux5 {
286						regulator-name = "AUX5";
287						/* Intended for 1V8 for touchscreen but actually left unused */
288						regulator-min-microvolt = <1050000>;
289						regulator-max-microvolt = <2790000>;
290					};
291
292					ab8500_ldo_aux6 {
293						regulator-name = "AUX6";
294						/* Hammer to 1.8V for the display */
295						regulator-min-microvolt = <1800000>;
296						regulator-max-microvolt = <1800000>;
297					};
298
299					ab8500_ldo_aux8 {
300						/* Mostly VIO for sensors */
301						regulator-name = "AUX8";
302					};
303				};
304			};
305		};
306
307		/* I2C0 */
308		i2c@80004000 {
309			status = "okay";
310
311			pinctrl-names = "default", "sleep";
312			pinctrl-0 = <&i2c0_a_1_default>;
313			pinctrl-1 = <&i2c0_a_1_sleep>;
314
315			proximity@44 {
316				compatible = "sharp,gp2ap002s00f";
317				clock-frequency = <400000>;
318				reg = <0x44>;
319
320				interrupt-parent = <&gpio4>;
321				interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
322				vdd-supply = <&ab8500_ldo_aux1_reg>;
323				vio-supply = <&ab8500_ldo_aux8_reg>;
324				pinctrl-names = "default";
325				pinctrl-0 = <&gp2ap002_skomer_default>;
326				sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
327				sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
328			};
329		};
330
331
332		/* I2C2 */
333		i2c@80128000 {
334			status = "okay";
335
336			pinctrl-names = "default", "sleep";
337			pinctrl-0 = <&i2c2_b_2_default>;
338			pinctrl-1 = <&i2c2_b_2_sleep>;
339
340			accel@18 {
341				compatible = "bosch,bma254";
342				clock-frequency = <400000>;
343				reg = <0x18>;
344
345				/* GPIO224 used as "smart alert" interrupt */
346				interrupt-parent = <&gpio7>;
347				interrupts = <0 IRQ_TYPE_EDGE_RISING>;
348
349				mount-matrix = "0", "-1", "0",
350					      "1", "0", "0",
351					       "0", "0", "1";
352				vdd-supply = <&ab8500_ldo_aux1_reg>;
353				vddio-supply = <&ab8500_ldo_aux8_reg>;
354				pinctrl-names = "default";
355				pinctrl-0 = <&bma254_skomer_default>;
356			};
357		};
358
359		/* I2C3 */
360		i2c@80110000 {
361			status = "okay";
362
363			pinctrl-names = "default", "sleep";
364			pinctrl-0 = <&i2c3_c_2_default>;
365			pinctrl-1 = <&i2c3_c_2_sleep>;
366
367			/* Cypress CY8CTMA140 touchscreen */
368			touchscreen@20 {
369				compatible = "cypress,cy8ctma140";
370				clock-frequency = <400000>;
371				reg = <0x20>;
372
373				touchscreen-size-x = <480>;
374				touchscreen-size-y = <800>;
375				touchscreen-max-pressure = <255>;
376
377				/* GPIO218 for IRQ */
378				interrupt-parent = <&gpio6>;
379				interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
380
381				/* VDD is "digital supply" nominally 1.71-3.6V */
382				vdd-supply = <&ab8500_ldo_aux2_reg>;
383				/* VCPIN is "analog supply", 2.7-3.6 V */
384				vcpin-supply = <&ab8500_ldo_aux2_reg>;
385
386				pinctrl-names = "default";
387				pinctrl-0 = <&tma140_skomer_default>;
388			};
389		};
390
391		mcde@a0350000 {
392			status = "okay";
393			pinctrl-names = "default";
394			pinctrl-0 = <&dsi_default_mode>;
395
396			dsi-controller@a0351000 {
397				panel {
398					/* NT35510-based Hydis HVA40WV1 */
399					compatible = "hydis,hva40wv1", "novatek,nt35510";
400					reg = <0>;
401					/* v_lcd_3v0 2.3-4.8V */
402					vdd-supply = <&ab8500_ldo_aux4_reg>;
403					/* v_lcd_1v8 1.65-3.3V */
404					vddi-supply = <&ab8500_ldo_aux6_reg>;
405					/* GPIO 139 */
406					reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
407					pinctrl-names = "default";
408					pinctrl-0 = <&display_default_mode>;
409					backlight = <&ktd253>;
410				};
411			};
412		};
413	};
414};
415
416&pinctrl {
417	/*
418	 * This extends the MC0 default config to include DAT32DIR
419	 * which is used by this machine. If we don't do this the
420	 * SD card does not work.
421	 */
422	sdi0 {
423		mc0_a_1_default {
424			default_mux {
425				function = "mc0";
426				/* This machine uses the DAT31 pin */
427				groups = "mc0_a_1", "mc0dat31dir_a_1";
428			};
429			default_cfg5 {
430				pins = "GPIO21_AB3"; /* DAT31DIR */
431				ste,config = <&out_hi>;
432			};
433		};
434	};
435
436	mcde {
437		dsi_default_mode: dsi_default {
438			default_mux1 {
439				/* Mux in VSI0 used for DSI TE */
440				function = "lcd";
441				groups = "lcdvsi0_a_1"; /* VSI0 for LCD */
442			};
443			default_cfg1 {
444				pins = "GPIO68_E1"; /* VSI0 */
445				ste,config = <&in_nopull>;
446			};
447		};
448	};
449
450	/* Two GPIO lines used by the display */
451	display {
452		display_default_mode: display_default {
453			skomer_cfg1 {
454				/*
455				 * OLED DETECT or check_pba, this appears to be high
456				 * on "PBA" which I guess is "prototype board A".
457				 */
458				pins = "GPIO93_B7";
459				ste,config = <&gpio_in_nopull>;
460			};
461			skomer_cfg2 {
462				pins = "GPIO139_C9";
463				/*
464				 * MIPI_DSI0_RESET_N resets the display, leave high
465				 * (de-asserted) so we only assert reset explicitly
466				 * from the display driver.
467				 */
468				ste,config = <&gpio_out_hi>;
469			};
470		};
471	};
472	backlight {
473		gpio_backlight_default_mode: backlight_default {
474			skomer_cfg1 {
475				pins = "GPIO69_E2"; /* LCD_BL_CTRL */
476				ste,config = <&gpio_out_lo>;
477			};
478		};
479	};
480	/* GPIO that enables the 2.9V SD card level translator */
481	sd-level-translator {
482		sd_level_translator_default: sd_level_translator_default {
483			/* level shifter on GPIO87 */
484			skomer_cfg1 {
485				pins = "GPIO87_B3";
486				ste,config = <&gpio_out_hi>;
487			};
488		};
489	};
490	/* GPIO that enables the LDO regulator for the eMMC */
491	emmc-ldo {
492		emmc_ldo_en_default_mode: emmc_ldo_default {
493			/* LDO enable on GPIO223 */
494			skomer_cfg1 {
495				pins = "GPIO223_AH9";
496				ste,config = <&gpio_out_hi>;
497			};
498		};
499	};
500	/* GPIO keys */
501	gpio-keys {
502		gpio_keys_default_mode: gpio_keys_default {
503			skomer_cfg1 {
504				pins = "GPIO67_G2", /* VOL UP */
505				       "GPIO91_B6", /* HOME */
506				       "GPIO92_D6", /* VOL DOWN */
507				       "GPIO204_AF23", /* MENU */
508				       "GPIO205_AG23"; /* BACK */
509					ste,config = <&gpio_in_pu>;
510			};
511		};
512	};
513	/* Interrupt line for BMA254 */
514	bma254 {
515		bma254_skomer_default: bma254_skomer {
516			skomer_cfg1 {
517				pins = "GPIO224_AG9";
518				ste,config = <&gpio_in_pd>;
519			};
520		};
521	};
522	/* Interrupt line for light/proximity sensor GP2AP002 */
523	gp2ap002 {
524		gp2ap002_skomer_default: gp2ap002_skomer {
525			skomer_cfg1 {
526				pins = "GPIO146_D13";
527				ste,config = <&gpio_in_nopull>;
528			};
529		};
530	};
531	/* GPIO-based I2C bus for NCP6914 */
532	i2c-gpio-0 {
533		i2c_gpio_0_default: i2c_gpio_0 {
534			skomer_cfg1 {
535				pins = "GPIO143_D12", "GPIO144_B13";
536				ste,config = <&gpio_in_nopull>;
537			};
538		};
539	};
540	/* GPIO-based I2C bus for ALPS HSCD compass */
541	i2c-gpio-1 {
542		i2c_gpio_1_default: i2c_gpio_1 {
543			skomer_cfg1 {
544				pins = "GPIO151_B17", "GPIO152_D16";
545				ste,config = <&gpio_in_nopull>;
546			};
547		};
548	};
549	wlan {
550		wlan_default_mode: wlan_default {
551			skomer_cfg1 {
552				pins = "GPIO216_AG12";
553				ste,config = <&gpio_in_pd>;
554			};
555		};
556		wlan_en_default_mode: wlan_en_default {
557			skomer_cfg2 {
558				pins = "GPIO215_AH13";
559				ste,config = <&gpio_out_lo>;
560			};
561		};
562	};
563	bluetooth {
564		bluetooth_default_mode: bluetooth_default {
565			skomer_cfg1 {
566				pins = "GPIO199_AH23", "GPIO222_AJ9";
567				ste,config = <&gpio_out_lo>;
568			};
569			skomer_cfg2 {
570				pins = "GPIO97_D9";
571				ste,config = <&gpio_in_nopull>;
572			};
573		};
574	};
575	vibrator {
576		vibrator_default: vibrator_default {
577			skomer_cfg1 {
578				pins = "GPIO195_AG28";	/* MOT_EN */
579				ste,config = <&gpio_out_lo>;
580			};
581		};
582	};
583	/* Interrupt line for the Cypress TMA140 touchscreen */
584	touchscreen {
585		tma140_skomer_default: tma140_skomer {
586			skomer_cfg1 {
587				pins = "GPIO218_AH11";
588				ste,config = <&gpio_in_nopull>;
589			};
590		};
591	};
592};
593
594&ab8505_gpio {
595	/* Hog a few default settings */
596	pinctrl-names = "default";
597	pinctrl-0 = <&gpio_default>;
598
599	gpio {
600		gpio_default: gpio_default {
601			skomer_mux {
602				/* Change unused pins to GPIO mode */
603				function = "gpio";
604				groups = "gpio3_a_1",	/* default: SysClkReq4 */
605					 "gpio14_a_1";	/* default: PWMOut1 */
606			};
607			skomer_cfg1 {
608				pins = "GPIO11_B17", "GPIO13_D17", "GPIO50_L4";
609				bias-disable;
610			};
611		};
612	};
613};
614