1// SPDX-License-Identifier: GPL-2.0 or MIT
2//
3// Device Tree Source for General Electric B1x5Pv2
4// patient monitor series
5//
6// Copyright 2018-2021 General Electric Company
7// Copyright 2018-2021 Collabora
8
9#include <dt-bindings/input/input.h>
10#include "imx6dl-qmx6.dtsi"
11
12/ {
13	chosen {
14		stdout-path = &uart3;
15	};
16
17	/* Do not allow frequencies above 800MHz */
18	cpus {
19		cpu@0 {
20			operating-points = <
21				/* kHz    uV */
22				792000  1175000
23				396000  1150000
24			>;
25			fsl,soc-operating-points = <
26				/* ARM kHz	SOC-PU uV */
27				792000	1175000
28				396000	1175000
29			>;
30		};
31
32		cpu@1 {
33			operating-points = <
34				/* kHz    uV */
35				792000  1175000
36				396000  1150000
37			>;
38			fsl,soc-operating-points = <
39				/* ARM kHz	SOC-PU uV */
40				792000	1175000
41				396000	1175000
42			>;
43		};
44	};
45
46	reg_syspwr: regulator-12v {
47		compatible = "regulator-fixed";
48		regulator-name = "SYS_PWR";
49		regulator-min-microvolt = <12000000>;
50		regulator-max-microvolt = <12000000>;
51	};
52
53	reg_5v_pmc: regulator-5v-pmc {
54		compatible = "regulator-fixed";
55		regulator-name = "5V PMC";
56		regulator-min-microvolt = <5000000>;
57		regulator-max-microvolt = <5000000>;
58		vin-supply = <&reg_syspwr>;
59	};
60
61	reg_5v: regulator-5v {
62		compatible = "regulator-fixed";
63		regulator-name = "5V";
64		regulator-min-microvolt = <5000000>;
65		regulator-max-microvolt = <5000000>;
66		vin-supply = <&reg_syspwr>;
67	};
68
69	reg_3v3: regulator-3v3 {
70		compatible = "regulator-fixed";
71		regulator-name = "3V3";
72		regulator-min-microvolt = <3300000>;
73		regulator-max-microvolt = <3300000>;
74		vin-supply = <&reg_syspwr>;
75	};
76
77	reg_5v0_audio: regulator-5v0-audio {
78		compatible = "regulator-fixed";
79		regulator-name = "5V0_AUDIO";
80		regulator-min-microvolt = <5000000>;
81		regulator-max-microvolt = <5000000>;
82		vin-supply = <&reg_5v>;
83		gpio = <&tca6424a 16 GPIO_ACTIVE_HIGH>;
84		enable-active-high;
85		/*
86		 * This must be always-on for da7212, which has some not
87		 * properly documented dependencies for it's speaker supply
88		 * pin. The issue manifests as speaker volume being very low.
89		 */
90		regulator-always-on;
91	};
92
93
94	reg_3v3_audio: regulator-3v3-audio {
95		compatible = "regulator-fixed";
96		regulator-name = "3V3_AUDIO";
97		regulator-min-microvolt = <3300000>;
98		regulator-max-microvolt = <3300000>;
99		vin-supply = <&reg_3v3>;
100		pinctrl-0 = <&pinctrl_q7_hda_reset>;
101		pinctrl-names = "default";
102		gpio = <&gpio6 8 GPIO_ACTIVE_HIGH>;
103		enable-active-high;
104	};
105
106	reg_2v5_audio: regulator-2v5-audio {
107		compatible = "regulator-fixed";
108		regulator-name = "2V5_AUDIO";
109		regulator-min-microvolt = <2500000>;
110		regulator-max-microvolt = <2500000>;
111		regulator-always-on;
112		vin-supply = <&reg_3v3_audio>;
113
114	};
115
116	reg_wlan: regulator-wlan {
117		compatible = "regulator-fixed";
118		regulator-name = "WLAN";
119		regulator-min-microvolt = <3300000>;
120		regulator-max-microvolt = <3300000>;
121		vin-supply = <&reg_3v3>;
122		pinctrl-names = "default";
123		pinctrl-0 = <&pinctrl_q7_sdio_power>;
124		gpio = <&gpio4 30 GPIO_ACTIVE_HIGH>;
125		enable-active-high;
126		startup-delay-us = <70000>;
127	};
128
129	reg_bl: regulator-backlight {
130		compatible = "regulator-fixed";
131		regulator-name = "LED_VCC";
132		regulator-min-microvolt = <12000000>;
133		regulator-max-microvolt = <12000000>;
134		vin-supply = <&reg_syspwr>;
135		pinctrl-0 = <&pinctrl_q7_lcd_power>;
136		pinctrl-names = "default";
137		gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
138		enable-active-high;
139	};
140
141	reg_lcd: regulator-lcd {
142		compatible = "regulator-fixed";
143		regulator-name = "LCD_5V";
144		regulator-min-microvolt = <5000000>;
145		regulator-max-microvolt = <5000000>;
146		vin-supply = <&reg_5v>;
147	};
148
149	usb_power: regulator-usb-power {
150		compatible = "regulator-fixed";
151		regulator-name = "USB POWER";
152		regulator-min-microvolt = <5000000>;
153		regulator-max-microvolt = <5000000>;
154		vin-supply = <&reg_5v>;
155	};
156
157	charger: battery-charger {
158		compatible = "gpio-charger"; /* ti,bq24172 */
159		charger-type = "mains";
160		gpios = <&tca6424a 3 GPIO_ACTIVE_LOW>;
161		charge-current-limit-gpios = <&tca6424a 11 GPIO_ACTIVE_HIGH>,
162					     <&tca6424a 12 GPIO_ACTIVE_HIGH>;
163		charge-current-limit-mapping = <1300000 0x0>,
164					       <700000 0x1>,
165					       <0 0x2>;
166		charge-status-gpios = <&tca6424a 6 GPIO_ACTIVE_HIGH>;
167	};
168
169	poweroff {
170		compatible = "gpio-poweroff";
171		pinctrl-names = "default";
172		pinctrl-0 = <&pinctrl_q7_spi_cs1>;
173		gpios = <&gpio4 25 GPIO_ACTIVE_LOW>;
174	};
175
176	power-button-key {
177		compatible = "gpio-keys";
178		pinctrl-names = "default";
179		pinctrl-0 = <&pinctrl_q7_sleep_button>;
180
181		power-button {
182			label = "power button";
183			gpios = <&gpio4 7 GPIO_ACTIVE_LOW>;
184			linux,code = <KEY_POWER>;
185		};
186	};
187
188	rotary-encoder-key {
189		compatible = "gpio-keys";
190
191		rotary-encoder-event {
192			label = "rotary-encoder press";
193			gpios = <&tca6424a 0 GPIO_ACTIVE_HIGH>;
194			linux,code = <KEY_ENTER>;
195			linux,can-disable;
196		};
197	};
198
199	rotary-encoder {
200		compatible = "rotary-encoder";
201		pinctrl-names = "default";
202		pinctrl-0 = <&pinctrl_q7_gpio2 &pinctrl_q7_gpio4>;
203		gpios = <&gpio4 26 GPIO_ACTIVE_LOW>, <&gpio1 0 GPIO_ACTIVE_LOW>;
204		rotary-encoder,relative-axis;
205		rotary-encoder,steps-per-period = <2>;
206		wakeup-source;
207	};
208
209	leds {
210		compatible = "gpio-leds";
211		pinctrl-names = "default";
212		pinctrl-0 = <&pinctrl_q7_gpio1 &pinctrl_q7_gpio3 &pinctrl_q7_gpio5>;
213
214		led-alarm1 {
215			label = "alarm:red";
216			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
217		};
218
219		led-alarm2 {
220			label = "alarm:yellow";
221			gpios = <&gpio4 27 GPIO_ACTIVE_HIGH>;
222		};
223
224		led-alarm3 {
225			label = "alarm:blue";
226			gpios = <&gpio4 15 GPIO_ACTIVE_HIGH>;
227		};
228	};
229
230	backlight: backlight {
231		compatible = "pwm-backlight";
232		pinctrl-names = "default";
233		pinctrl-0 = <&pinctrl_q7_backlight_enable>;
234		power-supply = <&reg_bl>;
235		pwms = <&pwm4 0 5000000 0>;
236		brightness-levels = <0 255>;
237		num-interpolated-steps = <255>;
238		default-brightness-level = <179>;
239		enable-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
240	};
241
242	panel {
243		backlight = <&backlight>;
244		power-supply = <&reg_lcd>;
245
246		port {
247			panel_in: endpoint {
248				remote-endpoint = <&lvds0_out>;
249			};
250		};
251	};
252
253	sound {
254		compatible = "simple-audio-card";
255		simple-audio-card,name = "audio-card";
256		simple-audio-card,format = "i2s";
257		simple-audio-card,bitclock-master = <&dailink_master>;
258		simple-audio-card,frame-master = <&dailink_master>;
259		simple-audio-card,widgets = "Speaker", "Ext Spk";
260		simple-audio-card,audio-routing = "Ext Spk", "LINE";
261
262		simple-audio-card,cpu {
263			sound-dai = <&ssi1>;
264		};
265
266		dailink_master: simple-audio-card,codec {
267			sound-dai = <&codec>;
268		};
269	};
270
271	clk_ext_audio_codec: clock-codec {
272		compatible = "fixed-clock";
273		#clock-cells = <0>;
274		clock-frequency = <12288000>;
275	};
276};
277
278&audmux {
279	status = "okay";
280};
281
282&fec {
283	status = "okay";
284};
285
286&hdmi {
287	status = "okay";
288};
289
290&i2c1 {
291	battery: battery@b {
292		compatible = "ti,bq20z65", "sbs,sbs-battery";
293		reg = <0x0b>;
294		sbs,battery-detect-gpios = <&tca6424a 5 GPIO_ACTIVE_LOW>;
295		sbs,i2c-retry-count = <5>;
296		power-supplies = <&charger>;
297	};
298
299	codec: audio-codec@1a {
300		compatible = "dlg,da7212";
301		reg = <0x1a>;
302		#sound-dai-cells = <0>;
303		VDDA-supply = <&reg_2v5_audio>;
304		VDDSP-supply = <&reg_5v0_audio>;
305		VDDMIC-supply = <&reg_3v3_audio>;
306		VDDIO-supply = <&reg_3v3_audio>;
307		clocks = <&clk_ext_audio_codec>;
308		clock-names = "mclk";
309	};
310};
311
312&i2c5 {
313	tca6424a: gpio-controller@22 {
314		compatible = "ti,tca6424";
315		reg = <0x22>;
316		gpio-controller;
317		#gpio-cells = <2>;
318		vcc-supply = <&reg_3v3>;
319		interrupt-parent = <&gpio7>;
320		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
321		pinctrl-names = "default";
322		pinctrl-0 = <&pinctrl_q7_gpio6>;
323		interrupt-controller;
324		#interrupt-cells = <2>;
325		gpio-line-names = "GPIO_ROTOR#", "ACM_IO_INT", "TMP_SENSOR_IRQ", "AC_IN",
326				  "TF_S", "BATT_T", "LED_INC_CHAR", "ACM1_OCF",
327				  "ACM2_OCF", "ACM_IO_RST", "USB1_POWER_EN", "EGPIO_CC_CTL0",
328				  "EGPIO_CC_CTL1", "12V_OEMNBP_EN", "CP2105_RST", "",
329				  "SPEAKER_PA_EN", "ARM7_UPI_RESET", "ARM7_PWR_RST", "NURSE_CALL",
330				  "MARKER_EN", "EGPIO_TOUCH_RST", "PRESSURE_INT1", "PRESSURE_INT2";
331
332	};
333
334	tmp75: temperature-sensor@48 {
335		compatible = "ti,tmp75";
336		reg = <0x48>;
337		vs-supply = <&reg_3v3>;
338		interrupt-parent = <&tca6424a>;
339		interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
340	};
341};
342
343&ldb {
344	status = "okay";
345
346	lvds0: lvds-channel@0 {
347		status = "okay";
348		fsl,data-mapping = "spwg";
349		fsl,data-width = <24>;
350
351		port@4 {
352			reg = <4>;
353
354			lvds0_out: endpoint {
355				remote-endpoint = <&panel_in>;
356			};
357		};
358	};
359};
360
361&pwm4 {
362	status = "okay";
363};
364
365&ssi1 {
366	fsl,mode = "i2s-slave";
367	status = "okay";
368};
369
370&usbotg {
371	vbus-supply = <&usb_power>;
372	disable-over-current;
373	dr_mode = "host";
374	status = "okay";
375
376	/*
377	 * TPS2051BDGN fault-gpio is connected to Q7[86] USB_0_1_OC_N.
378	 * On QMX6 this is not connceted to the i.MX6, but to the USB Hub
379	 * from &usbh1. This means, that we cannot easily detect and handle
380	 * over-current events. Fortunately the regulator limits the current
381	 * automatically, so the hardware is still protected.
382	 */
383};
384
385&usdhc4 {
386	/* WiFi module */
387	pinctrl-names = "default";
388	pinctrl-0 = <&pinctrl_usdhc4>;
389	bus-width = <4>;
390	no-1-8-v;
391	non-removable;
392	wakeup-source;
393	keep-power-in-suspend;
394	cap-power-off-card;
395	max-frequency = <25000000>;
396	vmmc-supply = <&reg_wlan>;
397	#address-cells = <1>;
398	#size-cells = <0>;
399	status = "okay";
400
401	wlcore: wlcore@2 {
402		compatible = "ti,wl1837";
403		reg = <2>;
404
405		pinctrl-names = "default";
406		pinctrl-0 = <&pinctrl_q7_gpio7>;
407
408		interrupt-parent = <&gpio4>;
409		interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
410
411		tcxo-clock-frequency = <26000000>;
412	};
413};
414