• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * GNU General Public License for more details.
12 */
13
14#include "msm8916.dtsi"
15#include "pm8916.dtsi"
16#include "apq8016-sbc-soc-pins.dtsi"
17#include "apq8016-sbc-pmic-pins.dtsi"
18#include <dt-bindings/gpio/gpio.h>
19#include <dt-bindings/input/input.h>
20#include <dt-bindings/sound/apq8016-lpass.h>
21
22/ {
23	aliases {
24		serial0 = &blsp1_uart2;
25		serial1 = &blsp1_uart1;
26		usid0 = &pm8916_0;
27		i2c0	= &blsp_i2c2;
28		i2c1	= &blsp_i2c6;
29		i2c3	= &blsp_i2c4;
30		spi0	= &blsp_spi5;
31		spi1	= &blsp_spi3;
32	};
33
34	chosen {
35		stdout-path = "serial0";
36	};
37
38	reserved-memory {
39		ramoops@bff00000{
40			compatible = "ramoops";
41			reg = <0x0 0xbff00000 0x0 0x100000>;
42
43			record-size = <0x20000>;
44			console-size = <0x20000>;
45			ftrace-size = <0x20000>;
46		};
47	};
48
49	soc {
50		dma@7884000 {
51			status = "okay";
52		};
53
54		serial@78af000 {
55			label = "LS-UART0";
56			status = "okay";
57			pinctrl-names = "default", "sleep";
58			pinctrl-0 = <&blsp1_uart1_default>;
59			pinctrl-1 = <&blsp1_uart1_sleep>;
60		};
61
62		serial@78b0000 {
63			label = "LS-UART1";
64			status = "okay";
65			pinctrl-names = "default", "sleep";
66			pinctrl-0 = <&blsp1_uart2_default>;
67			pinctrl-1 = <&blsp1_uart2_sleep>;
68		};
69
70		i2c@78b6000 {
71		/* On Low speed expansion */
72			label = "LS-I2C0";
73			status = "okay";
74		};
75
76		i2c@78b8000 {
77		/* On High speed expansion */
78			label = "HS-I2C2";
79			status = "okay";
80
81			adv_bridge: bridge@39 {
82				status = "okay";
83
84				compatible = "adi,adv7533";
85				reg = <0x39>;
86
87				interrupt-parent = <&msmgpio>;
88				interrupts = <31 2>;
89
90				adi,dsi-lanes = <4>;
91				clocks = <&rpmcc RPM_SMD_BB_CLK2>;
92				clock-names = "cec";
93
94				pd-gpios = <&msmgpio 32 0>;
95
96				avdd-supply = <&pm8916_l6>;
97				v1p2-supply = <&pm8916_l6>;
98				v3p3-supply = <&pm8916_l17>;
99
100				pinctrl-names = "default","sleep";
101				pinctrl-0 = <&adv7533_int_active &adv7533_switch_active>;
102				pinctrl-1 = <&adv7533_int_suspend &adv7533_switch_suspend>;
103				#sound-dai-cells = <1>;
104
105				ports {
106					#address-cells = <1>;
107					#size-cells = <0>;
108
109					port@0 {
110						reg = <0>;
111						adv7533_in: endpoint {
112							remote-endpoint = <&dsi0_out>;
113						};
114					};
115
116					port@1 {
117						reg = <1>;
118						adv7533_out: endpoint {
119							remote-endpoint = <&hdmi_con>;
120						};
121					};
122				};
123			};
124		};
125
126		i2c@78ba000 {
127		/* On Low speed expansion */
128			label = "LS-I2C1";
129			status = "okay";
130		};
131
132		spi@78b7000 {
133		/* On High speed expansion */
134			label = "HS-SPI1";
135			status = "okay";
136		};
137
138		spi@78b9000 {
139		/* On Low speed expansion */
140			label = "LS-SPI0";
141			status = "okay";
142		};
143
144		leds {
145			pinctrl-names = "default";
146			pinctrl-0 = <&msmgpio_leds>,
147				    <&pm8916_gpios_leds>,
148				    <&pm8916_mpps_leds>;
149
150			compatible = "gpio-leds";
151
152			led@1 {
153				label = "apq8016-sbc:green:user1";
154				gpios = <&msmgpio 21 GPIO_ACTIVE_HIGH>;
155				linux,default-trigger = "heartbeat";
156				default-state = "off";
157			};
158
159			led@2 {
160				label = "apq8016-sbc:green:user2";
161				gpios = <&msmgpio 120 GPIO_ACTIVE_HIGH>;
162				linux,default-trigger = "mmc0";
163				default-state = "off";
164			};
165
166			led@3 {
167				label = "apq8016-sbc:green:user3";
168				gpios = <&pm8916_gpios 1 GPIO_ACTIVE_HIGH>;
169				linux,default-trigger = "mmc1";
170				default-state = "off";
171			};
172
173			led@4 {
174				label = "apq8016-sbc:green:user4";
175				gpios = <&pm8916_gpios 2 GPIO_ACTIVE_HIGH>;
176				linux,default-trigger = "none";
177				default-state = "off";
178			};
179
180			led@5 {
181				label = "apq8016-sbc:yellow:wlan";
182				gpios = <&pm8916_mpps 2 GPIO_ACTIVE_HIGH>;
183				linux,default-trigger = "phy0tx";
184				default-state = "off";
185			};
186
187			led@6 {
188				label = "apq8016-sbc:blue:bt";
189				gpios = <&pm8916_mpps 3 GPIO_ACTIVE_HIGH>;
190				linux,default-trigger = "bluetooth-power";
191				default-state = "off";
192			};
193		};
194
195		sdhci@07824000 {
196			vmmc-supply = <&pm8916_l8>;
197			vqmmc-supply = <&pm8916_l5>;
198
199			pinctrl-names = "default", "sleep";
200			pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
201			pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
202			status = "okay";
203		};
204
205		sdhci@07864000 {
206			vmmc-supply = <&pm8916_l11>;
207			vqmmc-supply = <&pm8916_l12>;
208
209			pinctrl-names = "default", "sleep";
210			pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
211			pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
212
213			cd-gpios = <&msmgpio 38 0x1>;
214			status = "okay";
215		};
216
217		usb@78d9000 {
218			extcon = <&usb_id>;
219			status = "okay";
220			adp-disable;
221			hnp-disable;
222			srp-disable;
223			dr_mode = "host";
224			pinctrl-names = "default";
225			pinctrl-0 = <&usb_sw_sel_pm>;
226			ulpi {
227				phy {
228					v1p8-supply = <&pm8916_l7>;
229					v3p3-supply = <&pm8916_l13>;
230					extcon = <&usb_id>;
231				};
232			};
233		};
234
235		lpass@07708000 {
236			status = "okay";
237		};
238
239		mdss@1a00000 {
240			status = "okay";
241
242			mdp@1a01000 {
243				status = "okay";
244			};
245
246			dsi@1a98000 {
247				status = "okay";
248
249				vdda-supply = <&pm8916_l2>;
250				vddio-supply = <&pm8916_l6>;
251
252				ports {
253					port@1 {
254						endpoint {
255							remote-endpoint = <&adv7533_in>;
256							data-lanes = <0 1 2 3>;
257						};
258					};
259				};
260			};
261
262			dsi-phy@1a98300 {
263				status = "okay";
264
265				vddio-supply = <&pm8916_l6>;
266			};
267		};
268
269		lpass_codec: codec{
270			status = "okay";
271		};
272
273		/*
274		Internal Codec
275			playback - Primary MI2S
276			capture - Ter MI2S
277
278		External Primary:
279			playback - secondary MI2S
280			capture - Quat MI2S
281
282		External Secondary:
283			playback - Quat MI2S
284			capture - Quat MI2S
285
286		*/
287
288                sound: sound {
289                        compatible = "qcom,apq8016-sbc-sndcard";
290                        reg = <0x07702000 0x4>, <0x07702004 0x4>;
291                        reg-names = "mic-iomux", "spkr-iomux";
292
293                        status = "okay";
294                        pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
295                        pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
296                        pinctrl-names = "default", "sleep";
297                        qcom,model = "DB410c";
298                        qcom,audio-routing =
299                                "AMIC2", "MIC BIAS Internal2",
300                                "AMIC3", "MIC BIAS External1";
301			external-dai-link@0 {
302				link-name = "ADV7533";
303				cpu { /* QUAT */
304					sound-dai = <&lpass MI2S_QUATERNARY>;
305				};
306				codec {
307					sound-dai = <&adv_bridge 0>;
308				};
309			};
310
311                        internal-codec-playback-dai-link@0 {            /* I2S - Internal codec */
312                                link-name = "WCD";
313                                cpu { /* PRIMARY */
314                                        sound-dai = <&lpass MI2S_PRIMARY>;
315                                };
316                                codec {
317                                        sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
318                                };
319                        };
320
321                        internal-codec-capture-dai-link@0 {             /* I2S - Internal codec */
322                                link-name = "WCD-Capture";
323                                cpu { /* PRIMARY */
324                                        sound-dai = <&lpass MI2S_TERTIARY>;
325                                };
326                                codec {
327                                        sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
328                                };
329                        };
330                };
331
332		wcnss@a21b000 {
333			status = "okay";
334		};
335	};
336
337	usb2513 {
338		compatible = "smsc,usb3503";
339		reset-gpios = <&pm8916_gpios 3 GPIO_ACTIVE_LOW>;
340		initial-mode = <1>;
341	};
342
343	usb_id: usb-id {
344		compatible = "linux,extcon-usb-gpio";
345		vbus-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>;
346		pinctrl-names = "default";
347		pinctrl-0 = <&usb_id_default>;
348	};
349
350	hdmi-out {
351		compatible = "hdmi-connector";
352		type = "a";
353
354		port {
355			hdmi_con: endpoint {
356				remote-endpoint = <&adv7533_out>;
357			};
358		};
359	};
360
361	gpio_keys {
362		compatible = "gpio-keys";
363		#address-cells = <1>;
364		#size-cells = <0>;
365		autorepeat;
366
367		pinctrl-names = "default";
368		pinctrl-0 = <&msm_key_volp_n_default>;
369
370		button@0 {
371			label = "Volume Up";
372			linux,code = <KEY_VOLUMEUP>;
373			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
374		};
375	};
376};
377
378&wcd_codec {
379        status = "okay";
380        clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
381        clock-names = "mclk";
382};
383
384&smd_rpm_regulators {
385	vdd_l1_l2_l3-supply = <&pm8916_s3>;
386	vdd_l5-supply = <&pm8916_s3>;
387	vdd_l4_l5_l6-supply = <&pm8916_s4>;
388	vdd_l7-supply = <&pm8916_s4>;
389
390	s1 {
391		regulator-min-microvolt = <375000>;
392		regulator-max-microvolt = <1562000>;
393	};
394
395	s3 {
396		regulator-min-microvolt = <375000>;
397		regulator-max-microvolt = <1562000>;
398	};
399
400	s4 {
401		regulator-min-microvolt = <1800000>;
402		regulator-max-microvolt = <1800000>;
403
404		regulator-always-on;
405		regulator-boot-on;
406	};
407
408	l1 {
409		regulator-min-microvolt = <375000>;
410		regulator-max-microvolt = <1525000>;
411	};
412
413	l2 {
414		regulator-min-microvolt = <1200000>;
415		regulator-max-microvolt = <1200000>;
416	};
417
418	l3 {
419		regulator-min-microvolt = <375000>;
420		regulator-max-microvolt = <1525000>;
421	};
422
423	l4 {
424		regulator-min-microvolt = <1750000>;
425		regulator-max-microvolt = <3337000>;
426	};
427
428	l5 {
429		regulator-min-microvolt = <1750000>;
430		regulator-max-microvolt = <3337000>;
431	};
432
433	l6 {
434		regulator-min-microvolt = <1800000>;
435		regulator-max-microvolt = <1800000>;
436	};
437
438	l7 {
439		regulator-min-microvolt = <1750000>;
440		regulator-max-microvolt = <3337000>;
441	};
442
443	l8 {
444		regulator-min-microvolt = <1750000>;
445		regulator-max-microvolt = <3337000>;
446	};
447
448	l9 {
449		regulator-min-microvolt = <1750000>;
450		regulator-max-microvolt = <3337000>;
451	};
452
453	l10 {
454		regulator-min-microvolt = <1750000>;
455		regulator-max-microvolt = <3337000>;
456	};
457
458	l11 {
459		regulator-min-microvolt = <1750000>;
460		regulator-max-microvolt = <3337000>;
461		regulator-allow-set-load;
462		regulator-system-load = <200000>;
463	};
464
465	l12 {
466		regulator-min-microvolt = <1750000>;
467		regulator-max-microvolt = <3337000>;
468	};
469
470	l13 {
471		regulator-min-microvolt = <1750000>;
472		regulator-max-microvolt = <3337000>;
473	};
474
475	l14 {
476		regulator-min-microvolt = <1750000>;
477		regulator-max-microvolt = <3337000>;
478	};
479
480	/**
481	 * 1.8v required on LS expansion
482	 * for mezzanine boards
483	 */
484	l15 {
485		regulator-min-microvolt = <1750000>;
486		regulator-max-microvolt = <3337000>;
487		regulator-always-on;
488	};
489
490	l16 {
491		regulator-min-microvolt = <1750000>;
492		regulator-max-microvolt = <3337000>;
493	};
494
495	l17 {
496		regulator-min-microvolt = <3300000>;
497		regulator-max-microvolt = <3300000>;
498	};
499
500	l18 {
501		regulator-min-microvolt = <1750000>;
502		regulator-max-microvolt = <3337000>;
503	};
504};
505