summaryrefslogtreecommitdiffstats
path: root/arch/arm/dts/imx7d-gome-e143_01.kernel.dts
blob: 19c7a3d4260e6fc9cb3bb9802d8aeb5be0cc2c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
// SPDX-License-Identifier: GPL-2.0-only
/**
 * Copyright (C) 2022 Gossen Metrawatt GmbH
 * Copyright (C) 2022 Marco Felsch, Pengutronix
 * Copyright (C) 2022 Philipp Zabel, Pengutronix
 * Copyright (C) 2022 Roland Hieber, Pengutronix
 */
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include "imx7d-var-som-mx7.dtsi"

/ {
	model = "Gossen Metrawatt Profitest MF (e143_01)";
	compatible = "gome,e143_01", "variscite,var-som-mx7", "fsl,imx7d";

	aliases {
		gpio7 = &gpio8;
		rtc0 = &rtc0;
	};

	max98357a: audio-codec {
		compatible = "maxim,max98357a";
		#sound-dai-cells = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_sdmode>;
		sdmode-gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>; // Pin 60 AUDIO_SHDN_B
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_keys>, <&pinctrl_gpio_keys_2>;
		autorepeat;

		button-0 {
			label = "S0";
			gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; // Pin 183 BTN_S0_ESC
			linux,code = <KEY_ESC>;
			wakeup-source;
		};

		button-1 {
			label = "S1";
			gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; // Pin 185 BTN_S1_MEM
			linux,code = <KEY_DOCUMENTS>;
			wakeup-source;
		};

		button-2 {
			label = "S2";
			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; // Pin 181 BTN_S2_HLP
			linux,code = <KEY_HELP>;
			wakeup-source;
		};

		button-3 {
			label = "S3";
			gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; // Pin 1 BTN_S3_STA
			linux,code = <KEY_PROG1>;
			wakeup-source;
		};

		button-4 {
			label = "S4";
			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; // Pin 168 BTN_S4_IDN
			linux,code = <KEY_PROG2>;
			wakeup-source;
		};

		button-5 {
			label = "S5";
			gpios = <&gpio3 24 GPIO_ACTIVE_LOW>; // Pin 28 BTN_S5
			linux,code = <KEY_F5>;
		};

		button-6 {
			label = "S6";
			gpios = <&gpio3 5 GPIO_ACTIVE_LOW>; // Pin 40 BTN_S6
			linux,code = <KEY_F6>;
		};

		button-7 {
			label = "S7";
			gpios = <&gpio3 22 GPIO_ACTIVE_LOW>; // Pin 38 BTN_S7
			linux,code = <KEY_F7>;
		};

		button-8 {
			label = "S8";
			gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; // Pin 36 BTN_S8
			linux,code = <KEY_F8>;
		};

		button-9 {
			label = "S9";
			gpios = <&gpio3 27 GPIO_ACTIVE_LOW>; // Pin 20 BTN_S9
			linux,code = <KEY_F9>;
		};
	};

	gpio-poweroff {
		compatible = "gpio-poweroff";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_poweroff>;
		gpios = <&gpio7 14 GPIO_ACTIVE_LOW>; // Pin 7 POWER_OFF_B
		input;
	};

	iio-hwmon {
		compatible = "iio-hwmon";
		io-channels = <&adc2 0>, // ARS_VAL
			      <&adc2 1>, // VBAT_VAL
			      <&adc2 2>, // LCD_BACKLIGHT_VAL
			      <&adc2 3>; // VCC_5V0_FB
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_debug_led>;

		test-led-1 {
			label = "test-led-1:red";
			gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; // Pin 44 LED_TEST1_B
			color = <LED_COLOR_ID_RED>;
			linux,default-trigger = "disk-activity";
		};

		test-led-2 {
			label = "test-led-2:red";
			gpios = <&gpio3 3 GPIO_ACTIVE_LOW>; // Pin 46 LED_TEST2_B
			color = <LED_COLOR_ID_RED>;
			linux,default-trigger = "heartbeat";
		};
	};

	leds2 {
		compatible = "gpio-leds";

		led_netz_gn {
			label = "mains:green";
			gpios = <&gpio8 9 GPIO_ACTIVE_LOW>; // LED_NETZ_GN
			color = <LED_COLOR_ID_GREEN>;
		};

		led_netz_rt {
			label = "mains:red";
			gpios = <&gpio8 8 GPIO_ACTIVE_LOW>; // LED_NETZ_RT
			color = <LED_COLOR_ID_RED>;
			default-state = "on";
		};

		led_debug_gn {
			label = "debug:green";
			gpios = <&gpio8 0 GPIO_ACTIVE_LOW>; // LED_DEBUG_GN
			color = <LED_COLOR_ID_GREEN>;
		};

		led_debug_rt {
			label = "debug:red";
			gpios = <&gpio8 1 GPIO_ACTIVE_LOW>; // LED_DEBUG_RT
			color = <LED_COLOR_ID_RED>;
		};

		led_ul_gn {
			label = "ulrl:green";
			gpios = <&gpio8 2 GPIO_ACTIVE_LOW>; // LED_UL_GN
			color = <LED_COLOR_ID_GREEN>;
		};

		led_ul_rt {
			label = "ulrl:red";
			gpios = <&gpio8 6 GPIO_ACTIVE_LOW>; // LED_UL_RT
			color = <LED_COLOR_ID_RED>;
			default-state = "on";
		};

		led_rcd_gn {
			label = "rcd:green";
			gpios = <&gpio8 3 GPIO_ACTIVE_LOW>; // LED_RCD_GN
			color = <LED_COLOR_ID_GREEN>;
		};

		led_rcd_rt {
			label = "rcd:red";
			gpios = <&gpio8 7 GPIO_ACTIVE_LOW>; // LED_RCD_RT
			color = <LED_COLOR_ID_RED>;
			default-state = "on";
		};
	};

	reg_vled_backlight: regulator-vled-backlight {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mipi_backlight>;
		regulator-name = "VLED_BACKLIGHT";
		gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
		regulator-min-microvolt = <20000000>;
		regulator-max-microvolt = <20000000>;
		enable-active-high;
	};

	reg_vcc_3v3_per: regulator-vcc-3v3-per {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_reg_vcc_3v3_per>;
		regulator-name = "VCC_3V3_PER";
		gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; // Pin 83 VCC_3V3_PER_EN
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-enable-ramp-delay = <30000>;
		enable-active-high;
		regulator-always-on;
	};

	reg_vcc_5v0_per: regulator-vcc-5v0-per {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_reg_vcc_5v0_per>;
		regulator-name = "VCC_5V0_PER";
		gpio = <&gpio2 29 GPIO_ACTIVE_HIGH>; // Pin 75 VCC_5V0_PER_EN
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		enable-active-high;
		regulator-always-on;
	};

	reg_imt: regulator-imt {
		compatible = "regulator-fixed";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_reg_imt>;
		regulator-name = "VCC_IMT";
		gpio = <&gpio3 10 GPIO_ACTIVE_HIGH>; // Pin 66 MT_EN
		regulator-min-microvolt = <9000000>;
		regulator-max-microvolt = <9000000>;
		enable-active-high;
	};

	reg_vcc_1v8_alg: regulator-vcc-1v8-alg {
		compatible = "regulator-fixed";
		regulator-name = "VCC_1V8_ALG";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&reg_vcc_3v3_per>;
	};

	sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "max98357aaudio";
		/delete-property/ simple-audio-card,widgets;
		/delete-property/ simple-audio-card,routing;
		simple-audio-card,format = "i2s";

		simple-audio-card,cpu {
			sound-dai = <&sai3>;
		};

		simple-audio-card,codec {
			sound-dai = <&max98357a>;
		};
	};

	uc-imt-power {
		compatible = "reg-userspace-consumer";
		regulator-name = "reg_imt-consumer";
		regulator-supplies = "vcc";
		vcc-supply = <&reg_imt>;
	};
};

&adc2 {
	status = "okay";
};

&fec1 {
	status = "okay";
};

&i2c2 {
	/delete-node/ wm8731@1a;

	/* DS1339 RTC module */
	rtc0: rtc@68 {
		compatible = "dallas,ds1339";
		reg = <0x68>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_rtc>;
		trickle-resistor-ohms = <250>;
		interrupt-parent = <&gpio1>;
		interrupts = <13 GPIO_ACTIVE_LOW>; // Pin 120 RTC_INT_B
		wakeup-source;
	};
};

&i2c4 {
	clock-frequency = <400000>;
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_i2c4>;
	pinctrl-1 = <&pinctrl_i2c4_gpio>;
	scl-gpios = <&gpio4 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; // Pin 175 I2C4_SCL
	sda-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; // Pin 173 I2C4_SDA
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	gpio8: max7312@23 {
		compatible = "maxim,max7312";
		reg = <0x23>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "LED_DEBUG_GN", "LED_DEBUG_RT", "LED_UL_GN", "LED_RCD_GN",
				  "", "", "LED_UL_RT", "LED_RCD_RT",
				  "LED_NETZ_RT", "LED_NETZ_GN", "", "",
				  "DP_HW_CODE_1", "DP_HW_CODE_2", "DP_HW_CODE_3", "DP_HW_CODE_4";
		vcc-supply = <&reg_vcc_3v3_per>;
	};
};

&gpio1 {
	gpio-line-names = "GWDOG_RST_B", "BTN_S3_STA", "BTN_S4_IDN", "",
			  "", "", "", "USB_HOST_PWR_EN",
			  "", "", "BTN_S2_HLP", "BTN_S1_MEM",
			  "BTN_S0_ESC", "RTC_INT_B", "SOM: bt reg on";
};

&gpio2 {
	gpio-line-names = "", "", "", "",
			  "DBG_GPIO1", "DBG_GPIO2", "DBG_GPIO3", "DBG_GPIO4",
			  "", "", "", "",
			  "MT_RXD", "MT_TXD", "", "",
			  "", "", "", "",
			  "", "", "", "",
			  "", "", "VCC_3V3_PER_EN", "",
			  "DSI_RESET", "VCC_5V0_PER_EN";
};

&gpio3 {
	gpio-line-names = "", "", "LED_TEST1_B", "LED_TEST2_B",
			  "BTN_S8", "BTN_S6", "MT_RESET", "",
			  "", "", "MT_EN", "",
			  "", "", "", "",
			  "", "", "", "",
			  "AUDIO_SHDN_B", "", "BTN_S7", "",
			  "BTN_S5", "", "", "BTN_S9",
			  "BATT_LOW";
};

&gpio4 {
	gpio-line-names = "", "", "", "",
			  "", "", "", "",
			  "I2C1_SCL", "I2C1_SDA", "I2C2_SCL", "I2C2_SDA",
			  "", "", "I2C4_SCL", "I2C4_SDA",
			  "", "", "", "",
			  "", "", "", "HIL_SPI_CS0";
};

&gpio5 {
	gpio-line-names = "", "", "", "",
			  "", "", "", "",
			  "", "", "", "SOM: ethphy0 reset";
};

&gpio6 {
	gpio-line-names = "", "", "", "",
			  "", "", "", "",
			  "", "", "", "SOM: sd3_pwr (eMMC)";
};

&gpio7 {
	gpio-line-names = "", "", "", "",
			  "", "", "", "",
			  "", "", "", "",
			  "LCD_BACKLIGHT_EN", "", "POWER_OFF_B";
};

&lcdif {
	assigned-clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_SRC>,
			  <&clks IMX7D_PLL_VIDEO_POST_DIV>;
	assigned-clock-parents = <&clks IMX7D_PLL_VIDEO_POST_DIV>;
	assigned-clock-rates = <0>, <128000000>;
	fsl,ocram = <&ocram>;
	fsl,pxp = <&pxp>;
	status = "okay";
};

&mipi_dsi {
	samsung,burst-clock-frequency = <850000000>;
	status = "okay";

	panel@0 {
		compatible = "tianma,tm050jdhg33", "ilitek,ili9881c";
		reg = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mipi_panel>;
		reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; // Pin 73 DSI_RESET
		power-supply = <&reg_vcc_3v3_per>;
		dsi-lanes = <2>;

		rotation = <90>;

		ilitek,enable-internal-backlight;
		default-brightness = <2047>;
		ilitek,pwm-frequency = <50000>;
		ilitek,backlight-supply = <&reg_vled_backlight>;
	};
};

&sai3 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sai3>;
	assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
			  <&clks IMX7D_SAI3_ROOT_CLK>;
	assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
	assigned-clock-rates = <0>, <36864000>;
	status = "okay";
};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart1>;
	status = "okay";
};

&uart7 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart7>;
	status = "okay";
};

&usbotg1 {
	dr_mode = "peripheral";
	status = "okay";
};

&usbotg2 {
	status = "okay";
};

&iomuxc_lpsr {
	pinctrl_gpio_keys_2: pinctrl_gpio_keys_2grp {
		fsl,pins = <
			MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1        0x0C
			MX7D_PAD_LPSR_GPIO1_IO02__GPIO1_IO2        0x0C
		>;
	};

	pinctrl_usbotg2_pwr: pinctrl_usbotg2_pwrgrp {
		fsl,pins = <
			MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7        0x14
		>;
	};
};

&iomuxc {
	pinctrl_gpio_keys: pinctrl-gpio-keysgrp {
		fsl,pins = <
			MX7D_PAD_GPIO1_IO10__GPIO1_IO10            0x0000000C
			MX7D_PAD_GPIO1_IO11__GPIO1_IO11            0x0000000C
			MX7D_PAD_GPIO1_IO12__GPIO1_IO12            0x0000000C
			MX7D_PAD_LCD_DATA00__GPIO3_IO5             0x0000000C
			MX7D_PAD_LCD_DATA17__GPIO3_IO22            0x0000000C
			MX7D_PAD_LCD_DATA19__GPIO3_IO24            0x0000000C
			MX7D_PAD_LCD_DATA22__GPIO3_IO27            0x0000000C
			MX7D_PAD_LCD_RESET__GPIO3_IO4              0x0000000C
		>;
	};

	pinctrl_i2c4: i2c4grp {
		fsl,pins = <
			MX7D_PAD_I2C4_SCL__I2C4_SCL                0x4000007f
			MX7D_PAD_I2C4_SDA__I2C4_SDA                0x4000007f
		>;
	};

	pinctrl_i2c4_gpio: i2c4-gpiogrp {
		fsl,pins = <
			MX7D_PAD_I2C4_SCL__GPIO4_IO14              0x4000007f
			MX7D_PAD_I2C4_SDA__GPIO4_IO15              0x4000007f
		>;
	};

	pinctrl_mipi_backlight: mipi-backlightgrp {
		fsl,pins = <
			MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12          0x0000001B
		>;
	};

	pinctrl_mipi_panel: mipi-panelgrp {
		fsl,pins = <
			MX7D_PAD_EPDC_BDR0__GPIO2_IO28             0x0000001B /* DSI_RESET */
		>;
	};

	pinctrl_poweroff: pinctrl_poweroffgrp {
		fsl,pins = <
			MX7D_PAD_ENET1_CRS__GPIO7_IO14             0x0000001B
		>;
	};

	pinctrl_reg_vcc_3v3_per: pinctrl_reg_vcc_3v3_pergrp {
		fsl,pins = <
			MX7D_PAD_EPDC_GDRL__GPIO2_IO26             0x0000001B
		>;
	};

	pinctrl_reg_vcc_5v0_per: pinctrl_reg_vcc_5v0_pergrp {
		fsl,pins = <
			MX7D_PAD_EPDC_BDR1__GPIO2_IO29             0x0000001B
		>;
	};

	pinctrl_reg_imt: pinctrl_reg_imtgrp {
		fsl,pins = <
			MX7D_PAD_LCD_DATA05__GPIO3_IO10            0x0000001B
		>;
	};

	pinctrl_rtc: pinctrl_rtcgrp {
		fsl,pins = <
			MX7D_PAD_GPIO1_IO13__GPIO1_IO13            0x0000001B
		>;
	};

	pinctrl_sai3: pinctrl_sai3grp {
		fsl,pins = <
			MX7D_PAD_SD1_DATA1__SAI3_TX_BCLK           0x0000001F
			MX7D_PAD_SD1_DATA2__SAI3_TX_SYNC           0x0000001F
			MX7D_PAD_SD1_DATA3__SAI3_TX_DATA0          0x00000030
		>;
	};

	pinctrl_sdmode: pinctrl_sdmodegrp {
		fsl,pins = <
			MX7D_PAD_LCD_DATA15__GPIO3_IO20            0x0000001F
		>;
	};

	pinctrl_uart1: uart1grp {
		fsl,pins = <
			MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX	0x79 /* DEBUG_UART1_TXD */
			MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX	0x79 /* DEBUG_UART1_RXD */
		>;
	};

	pinctrl_uart7: uart7grp {
		fsl,pins = <
			MX7D_PAD_EPDC_DATA12__UART7_DCE_RX	0x79
			MX7D_PAD_EPDC_DATA13__UART7_DCE_TX	0x79
		>;
	};

	pinctrl_debug_led: pinctrl_debug_ledgrp {
		fsl,pins = <
			MX7D_PAD_LCD_HSYNC__GPIO3_IO2              0x00000003
			MX7D_PAD_LCD_VSYNC__GPIO3_IO3              0x00000003
		>;
	};
};