Linux Audio

Check our new training course

Loading...
v6.2
  1/*
  2 * Copyright 2016 Free Electrons
  3 * Copyright 2016 NextThing Co
  4 *
  5 * Mylène Josserand <mylene.josserand@free-electrons.com>
  6 *
  7 * This file is dual-licensed: you can use it either under the terms
  8 * of the GPL or the X11 license, at your option. Note that this dual
  9 * licensing only applies to this file, and not this project as a
 10 * whole.
 11 *
 12 *  a) This file is free software; you can redistribute it and/or
 13 *     modify it under the terms of the GNU General Public License as
 14 *     published by the Free Software Foundation; either version 2 of the
 15 *     License, or (at your option) any later version.
 16 *
 17 *     This file is distributed in the hope that it will be useful,
 18 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 19 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 20 *     GNU General Public License for more details.
 21 *
 22 * Or, alternatively,
 23 *
 24 *  b) Permission is hereby granted, free of charge, to any person
 25 *     obtaining a copy of this software and associated documentation
 26 *     files (the "Software"), to deal in the Software without
 27 *     restriction, including without limitation the rights to use,
 28 *     copy, modify, merge, publish, distribute, sublicense, and/or
 29 *     sell copies of the Software, and to permit persons to whom the
 30 *     Software is furnished to do so, subject to the following
 31 *     conditions:
 32 *
 33 *     The above copyright notice and this permission notice shall be
 34 *     included in all copies or substantial portions of the Software.
 35 *
 36 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 37 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 38 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 39 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 40 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 41 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 42 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 43 *     OTHER DEALINGS IN THE SOFTWARE.
 44 */
 45
 46/dts-v1/;
 47#include "sun5i-gr8.dtsi"
 48#include "sunxi-common-regulators.dtsi"
 49
 50#include <dt-bindings/gpio/gpio.h>
 51#include <dt-bindings/input/input.h>
 52#include <dt-bindings/interrupt-controller/irq.h>
 53
 54/ {
 55	model = "NextThing GR8-EVB";
 56	compatible = "nextthing,gr8-evb", "nextthing,gr8";
 57
 58	aliases {
 59		i2c0 = &i2c0;
 60		i2c1 = &i2c1;
 61		i2c2 = &i2c2;
 62		serial0 = &uart1;
 63		serial1 = &uart2;
 64	};
 65
 66	chosen {
 67		stdout-path = "serial0:115200n8";
 68	};
 69
 70	backlight: backlight {
 71		compatible = "pwm-backlight";
 72		pwms = <&pwm 0 10000 0>;
 73		enable-gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>;
 74		power-supply = <&reg_vcc3v3>;
 75		brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
 76		default-brightness-level = <8>;
 77	};
 78
 79	sound-analog {
 80		compatible = "simple-audio-card";
 81		simple-audio-card,name = "gr8-evb-wm8978";
 82		simple-audio-card,format = "i2s";
 83		simple-audio-card,mclk-fs = <512>;
 84
 85		simple-audio-card,cpu {
 86			sound-dai = <&i2s0>;
 87		};
 88
 89		simple-audio-card,codec {
 90			sound-dai = <&wm8978>;
 91		};
 92	};
 93
 94	sound-spdif {
 95		compatible = "simple-audio-card";
 96		simple-audio-card,name = "On-board SPDIF";
 97
 98		simple-audio-card,cpu {
 99			sound-dai = <&spdif>;
100		};
101
102		simple-audio-card,codec {
103			sound-dai = <&spdif_out>;
104		};
105	};
106
107	spdif_out: spdif-out {
108		#sound-dai-cells = <0>;
109		compatible = "linux,spdif-dit";
110	};
111};
112
113&be0 {
114	status = "okay";
115};
116
117&codec {
118	status = "okay";
119};
120
121&ehci0 {
122	status = "okay";
123};
124
125&i2c0 {
 
 
126	status = "okay";
127
128	axp209: pmic@34 {
129		reg = <0x34>;
130
131		/*
132		* The interrupt is routed through the "External Fast
133		* Interrupt Request" pin (ball G13 of the module)
134		* directly to the main interrupt controller, without
135		* any other controller interfering.
136		*/
137		interrupts = <0>;
138	};
139};
140
141#include "axp209.dtsi"
142
143&i2c1 {
 
 
144	status = "okay";
145
146	wm8978: codec@1a {
147		#sound-dai-cells = <0>;
148		compatible = "wlf,wm8978";
149		reg = <0x1a>;
150	};
151
152	pcf8563: rtc@51 {
153		compatible = "nxp,pcf8563";
154		reg = <0x51>;
155	};
156};
157
158&i2c2 {
 
 
159	status = "okay";
160};
161
162&i2s0 {
163	pinctrl-names = "default";
164	pinctrl-0 = <&i2s0_mclk_pin>, <&i2s0_data_pins>;
165	status = "okay";
166};
167
168&ir0 {
169	pinctrl-names = "default";
170	pinctrl-0 = <&ir0_rx_pin>;
171	status = "okay";
172};
173
174&lradc {
175	vref-supply = <&reg_ldo2>;
176	status = "okay";
177
178	button-190 {
179		label = "Volume Up";
180		linux,code = <KEY_VOLUMEUP>;
181		channel = <0>;
182		voltage = <190000>;
183	};
184
185	button-390 {
186		label = "Volume Down";
187		linux,code = <KEY_VOLUMEDOWN>;
188		channel = <0>;
189		voltage = <390000>;
190	};
191
192	button-600 {
193		label = "Menu";
194		linux,code = <KEY_MENU>;
195		channel = <0>;
196		voltage = <600000>;
197	};
198
199	button-800 {
200		label = "Search";
201		linux,code = <KEY_SEARCH>;
202		channel = <0>;
203		voltage = <800000>;
204	};
205
206	button-980 {
207		label = "Home";
208		linux,code = <KEY_HOMEPAGE>;
209		channel = <0>;
210		voltage = <980000>;
211	};
212
213	button-1180 {
214		label = "Esc";
215		linux,code = <KEY_ESC>;
216		channel = <0>;
217		voltage = <1180000>;
218	};
219
220	button-1400 {
221		label = "Enter";
222		linux,code = <KEY_ENTER>;
223		channel = <0>;
224		voltage = <1400000>;
225	};
226};
227
228&mmc0 {
 
 
229	vmmc-supply = <&reg_vcc3v3>;
230	bus-width = <4>;
231	cd-gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
 
232	status = "okay";
233};
234
235&nfc {
236	pinctrl-names = "default";
237	pinctrl-0 = <&nand_pins &nand_cs0_pin &nand_rb0_pin>;
238
239	/* MLC Support sucks for now */
240	status = "disabled";
241};
242
243&ohci0 {
244	status = "okay";
245};
246
247&otg_sram {
248	status = "okay";
249};
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251&pwm {
252	pinctrl-names = "default";
253	pinctrl-0 = <&pwm0_pin>;
254	status = "okay";
255};
256
257&reg_dcdc2 {
258	regulator-min-microvolt = <1000000>;
259	regulator-max-microvolt = <1400000>;
260	regulator-name = "vdd-cpu";
261	regulator-always-on;
262};
263
264&reg_dcdc3 {
265	regulator-min-microvolt = <1000000>;
266	regulator-max-microvolt = <1300000>;
267	regulator-name = "vdd-sys";
268	regulator-always-on;
269};
270
271&reg_ldo1 {
272	regulator-name = "vdd-rtc";
273};
274
275&reg_ldo2 {
276	regulator-min-microvolt = <2700000>;
277	regulator-max-microvolt = <3300000>;
278	regulator-name = "avcc";
279	regulator-always-on;
280};
281
282&reg_usb1_vbus {
 
283	gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
284	status = "okay";
285};
286
287&rtp {
288	allwinner,ts-attached;
289};
290
291&spdif {
292	pinctrl-names = "default";
293	pinctrl-0 = <&spdif_tx_pin>;
294	status = "okay";
295};
296
297&tve0 {
298	status = "okay";
299};
300
301&uart1 {
302	pinctrl-names = "default";
303	pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pins>;
304	status = "okay";
305};
306
307&usb_otg {
308	/*
309	 * The GR8-EVB has a somewhat interesting design. There's a
310	 * pin supposed to control VBUS, an ID pin, a VBUS detect pin,
311	 * so everything should work just fine.
312	 *
313	 * Except that the pin supposed to control VBUS is not
314	 * connected to any controllable output, neither to the SoC
315	 * through a GPIO or to the PMIC, and it is pulled down,
316	 * meaning that we will never be able to enable VBUS on this
317	 * board.
318	 */
319	dr_mode = "otg";
320	status = "okay";
321};
322
323&usb_power_supply {
324	status = "okay";
325};
326
327&usbphy {
328	usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
329	usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
 
 
330	usb0_vbus_power-supply = <&usb_power_supply>;
331	usb1_vbus-supply = <&reg_usb1_vbus>;
332	status = "okay";
333};
v4.10.11
  1/*
  2 * Copyright 2016 Free Electrons
  3 * Copyright 2016 NextThing Co
  4 *
  5 * Mylène Josserand <mylene.josserand@free-electrons.com>
  6 *
  7 * This file is dual-licensed: you can use it either under the terms
  8 * of the GPL or the X11 license, at your option. Note that this dual
  9 * licensing only applies to this file, and not this project as a
 10 * whole.
 11 *
 12 *  a) This file is free software; you can redistribute it and/or
 13 *     modify it under the terms of the GNU General Public License as
 14 *     published by the Free Software Foundation; either version 2 of the
 15 *     License, or (at your option) any later version.
 16 *
 17 *     This file is distributed in the hope that it will be useful,
 18 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 19 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 20 *     GNU General Public License for more details.
 21 *
 22 * Or, alternatively,
 23 *
 24 *  b) Permission is hereby granted, free of charge, to any person
 25 *     obtaining a copy of this software and associated documentation
 26 *     files (the "Software"), to deal in the Software without
 27 *     restriction, including without limitation the rights to use,
 28 *     copy, modify, merge, publish, distribute, sublicense, and/or
 29 *     sell copies of the Software, and to permit persons to whom the
 30 *     Software is furnished to do so, subject to the following
 31 *     conditions:
 32 *
 33 *     The above copyright notice and this permission notice shall be
 34 *     included in all copies or substantial portions of the Software.
 35 *
 36 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 37 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 38 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 39 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 40 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 41 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 42 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 43 *     OTHER DEALINGS IN THE SOFTWARE.
 44 */
 45
 46/dts-v1/;
 47#include "sun5i-gr8.dtsi"
 48#include "sunxi-common-regulators.dtsi"
 49
 50#include <dt-bindings/gpio/gpio.h>
 51#include <dt-bindings/input/input.h>
 52#include <dt-bindings/interrupt-controller/irq.h>
 53
 54/ {
 55	model = "NextThing GR8-EVB";
 56	compatible = "nextthing,gr8-evb", "nextthing,gr8";
 57
 58	aliases {
 59		i2c0 = &i2c0;
 60		i2c1 = &i2c1;
 61		i2c2 = &i2c2;
 62		serial0 = &uart1;
 63		serial1 = &uart2;
 64	};
 65
 66	chosen {
 67		stdout-path = "serial0:115200n8";
 68	};
 69
 70	backlight: backlight {
 71		compatible = "pwm-backlight";
 72		pwms = <&pwm 0 10000 0>;
 73		enable-gpios = <&axp_gpio 1 GPIO_ACTIVE_HIGH>;
 74
 75		brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
 76		default-brightness-level = <8>;
 77	};
 78
 79	sound-analog {
 80		compatible = "simple-audio-card";
 81		simple-audio-card,name = "gr8-evb-wm8978";
 82		simple-audio-card,format = "i2s";
 83		simple-audio-card,mclk-fs = <512>;
 84
 85		simple-audio-card,cpu {
 86			sound-dai = <&i2s0>;
 87		};
 88
 89		simple-audio-card,codec {
 90			sound-dai = <&wm8978>;
 91		};
 92	};
 93
 94	sound-spdif {
 95		compatible = "simple-audio-card";
 96		simple-audio-card,name = "On-board SPDIF";
 97
 98		simple-audio-card,cpu {
 99			sound-dai = <&spdif>;
100		};
101
102		simple-audio-card,codec {
103			sound-dai = <&spdif_out>;
104		};
105	};
106
107	spdif_out: spdif-out {
108		#sound-dai-cells = <0>;
109		compatible = "linux,spdif-dit";
110	};
111};
112
113&be0 {
114	status = "okay";
115};
116
117&codec {
118	status = "okay";
119};
120
121&ehci0 {
122	status = "okay";
123};
124
125&i2c0 {
126	pinctrl-names = "default";
127	pinctrl-0 = <&i2c0_pins_a>;
128	status = "okay";
129
130	axp209: pmic@34 {
131		reg = <0x34>;
132
133		/*
134		* The interrupt is routed through the "External Fast
135		* Interrupt Request" pin (ball G13 of the module)
136		* directly to the main interrupt controller, without
137		* any other controller interfering.
138		*/
139		interrupts = <0>;
140	};
141};
142
143#include "axp209.dtsi"
144
145&i2c1 {
146	pinctrl-names = "default";
147	pinctrl-0 = <&i2c1_pins_a>;
148	status = "okay";
149
150	wm8978: codec@1a {
151		#sound-dai-cells = <0>;
152		compatible = "wlf,wm8978";
153		reg = <0x1a>;
154	};
155
156	pcf8563: rtc@51 {
157		compatible = "phg,pcf8563";
158		reg = <0x51>;
159	};
160};
161
162&i2c2 {
163	pinctrl-names = "default";
164	pinctrl-0 = <&i2c2_pins_a>;
165	status = "okay";
166};
167
168&i2s0 {
169	pinctrl-names = "default";
170	pinctrl-0 = <&i2s0_mclk_pins_a>, <&i2s0_data_pins_a>;
171	status = "okay";
172};
173
174&ir0 {
175	pinctrl-names = "default";
176	pinctrl-0 = <&ir0_rx_pins_a>;
177	status = "okay";
178};
179
180&lradc {
181	vref-supply = <&reg_ldo2>;
182	status = "okay";
183
184	button@190 {
185		label = "Volume Up";
186		linux,code = <KEY_VOLUMEUP>;
187		channel = <0>;
188		voltage = <190000>;
189	};
190
191	button@390 {
192		label = "Volume Down";
193		linux,code = <KEY_VOLUMEDOWN>;
194		channel = <0>;
195		voltage = <390000>;
196	};
197
198	button@600 {
199		label = "Menu";
200		linux,code = <KEY_MENU>;
201		channel = <0>;
202		voltage = <600000>;
203	};
204
205	button@800 {
206		label = "Search";
207		linux,code = <KEY_SEARCH>;
208		channel = <0>;
209		voltage = <800000>;
210	};
211
212	button@980 {
213		label = "Home";
214		linux,code = <KEY_HOMEPAGE>;
215		channel = <0>;
216		voltage = <980000>;
217	};
218
219	button@1180 {
220		label = "Esc";
221		linux,code = <KEY_ESC>;
222		channel = <0>;
223		voltage = <1180000>;
224	};
225
226	button@1400 {
227		label = "Enter";
228		linux,code = <KEY_ENTER>;
229		channel = <0>;
230		voltage = <1400000>;
231	};
232};
233
234&mmc0 {
235	pinctrl-names = "default";
236	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gr8_evb>;
237	vmmc-supply = <&reg_vcc3v3>;
238	bus-width = <4>;
239	cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
240	cd-inverted;
241	status = "okay";
242};
243
244&nfc {
245	pinctrl-names = "default";
246	pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>;
247
248	/* MLC Support sucks for now */
249	status = "disabled";
250};
251
252&ohci0 {
253	status = "okay";
254};
255
256&otg_sram {
257	status = "okay";
258};
259
260&pio {
261	mmc0_cd_pin_gr8_evb: mmc0-cd-pin@0 {
262		allwinner,pins = "PG0";
263		allwinner,function = "gpio_in";
264		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
265		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
266	};
267
268	usb0_id_pin_gr8_evb: usb0-id-pin@0 {
269		allwinner,pins = "PG2";
270		allwinner,function = "gpio_in";
271		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
272		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
273	};
274
275	usb0_vbus_det_pin_gr8_evb: usb0-vbus-det-pin@0 {
276		allwinner,pins = "PG1";
277		allwinner,function = "gpio_in";
278		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
279		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
280	};
281
282	usb1_vbus_pin_gr8_evb: usb1-vbus-pin@0 {
283		allwinner,pins = "PG13";
284		allwinner,function = "gpio_out";
285		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
286		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
287	};
288};
289
290&pwm {
291	pinctrl-names = "default";
292	pinctrl-0 = <&pwm0_pins_a>;
293	status = "okay";
294};
295
296&reg_dcdc2 {
297	regulator-min-microvolt = <1000000>;
298	regulator-max-microvolt = <1400000>;
299	regulator-name = "vdd-cpu";
300	regulator-always-on;
301};
302
303&reg_dcdc3 {
304	regulator-min-microvolt = <1000000>;
305	regulator-max-microvolt = <1300000>;
306	regulator-name = "vdd-sys";
307	regulator-always-on;
308};
309
310&reg_ldo1 {
311	regulator-name = "vdd-rtc";
312};
313
314&reg_ldo2 {
315	regulator-min-microvolt = <2700000>;
316	regulator-max-microvolt = <3300000>;
317	regulator-name = "avcc";
318	regulator-always-on;
319};
320
321&reg_usb1_vbus {
322	pinctrl-0 = <&usb1_vbus_pin_gr8_evb>;
323	gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
324	status = "okay";
325};
326
327&rtp {
328	allwinner,ts-attached;
329};
330
331&spdif {
332	pinctrl-names = "default";
333	pinctrl-0 = <&spdif_tx_pins_a>;
334	status = "okay";
335};
336
337&tve0 {
338	status = "okay";
339};
340
341&uart1 {
342	pinctrl-names = "default";
343	pinctrl-0 = <&uart1_pins_a>, <&uart1_cts_rts_pins_a>;
344	status = "okay";
345};
346
347&usb_otg {
348	/*
349	 * The GR8-EVB has a somewhat interesting design. There's a
350	 * pin supposed to control VBUS, an ID pin, a VBUS detect pin,
351	 * so everything should work just fine.
352	 *
353	 * Except that the pin supposed to control VBUS is not
354	 * connected to any controllable output, neither to the SoC
355	 * through a GPIO or to the PMIC, and it is pulled down,
356	 * meaning that we will never be able to enable VBUS on this
357	 * board.
358	 */
359	dr_mode = "otg";
360	status = "okay";
361};
362
363&usb_power_supply {
364	status = "okay";
365};
366
367&usbphy {
368	pinctrl-names = "default";
369	pinctrl-0 = <&usb0_id_pin_gr8_evb>, <&usb0_vbus_det_pin_gr8_evb>;
370	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
371	usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
372	usb0_vbus_power-supply = <&usb_power_supply>;
373	usb1_vbus-supply = <&reg_usb1_vbus>;
374	status = "okay";
375};