Linux Audio

Check our new training course

Linux kernel drivers training

Mar 31-Apr 9, 2025, special US time zones
Register
Loading...
v5.14.15
  1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2/*
  3 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  4 */
  5
  6/dts-v1/;
  7#include <dt-bindings/input/input.h>
  8#include "rk3188.dtsi"
  9
 10/ {
 11	model = "Radxa Rock";
 12	compatible = "radxa,rock", "rockchip,rk3188";
 13
 14	aliases {
 15		mmc0 = &mmc0;
 16	};
 17
 18	memory@60000000 {
 19		device_type = "memory";
 20		reg = <0x60000000 0x80000000>;
 21	};
 22
 23	gpio-keys {
 24		compatible = "gpio-keys";
 
 
 25		autorepeat;
 26
 27		power {
 28			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
 29			linux,code = <KEY_POWER>;
 30			label = "GPIO Key Power";
 31			linux,input-type = <1>;
 32			wakeup-source;
 33			debounce-interval = <100>;
 34		};
 35	};
 36
 37	gpio-leds {
 38		compatible = "gpio-leds";
 39
 40		green_led: led-0 {
 41			label = "rock:green:user1";
 42			gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_LOW>;
 43			default-state = "off";
 44		};
 45
 46		blue_led: led-1 {
 47			label = "rock:blue:user2";
 48			gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
 49			default-state = "off";
 50		};
 51
 52		sleep_led: led-2 {
 53			label = "rock:red:power";
 54			gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
 55			default-state = "off";
 56		};
 57	};
 58
 59	sound {
 60		compatible = "simple-audio-card";
 61		simple-audio-card,name = "SPDIF";
 62
 63		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
 64			cpu { sound-dai = <&spdif>; };
 65			codec { sound-dai = <&spdif_out>; };
 66		};
 67	};
 68
 69	spdif_out: spdif-out {
 70		compatible = "linux,spdif-dit";
 71		#sound-dai-cells = <0>;
 72	};
 73
 74	ir_recv: gpio-ir-receiver {
 75		compatible = "gpio-ir-receiver";
 76		gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
 77		pinctrl-names = "default";
 78		pinctrl-0 = <&ir_recv_pin>;
 79	};
 80
 81	vcc_otg: usb-otg-regulator {
 82		compatible = "regulator-fixed";
 83		enable-active-high;
 84		gpio = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
 85		pinctrl-names = "default";
 86		pinctrl-0 = <&otg_vbus_drv>;
 87		regulator-name = "otg-vbus";
 88		regulator-min-microvolt = <5000000>;
 89		regulator-max-microvolt = <5000000>;
 90		regulator-always-on;
 91		regulator-boot-on;
 92	};
 93
 94	vcc_sd0: sdmmc-regulator {
 95		compatible = "regulator-fixed";
 96		regulator-name = "sdmmc-supply";
 97		regulator-min-microvolt = <3300000>;
 98		regulator-max-microvolt = <3300000>;
 99		gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
100		pinctrl-names = "default";
101		pinctrl-0 = <&sdmmc_pwr>;
102		startup-delay-us = <100000>;
103		vin-supply = <&vcc_io>;
104	};
105
106	vcc_host: usb-host-regulator {
107		compatible = "regulator-fixed";
108		enable-active-high;
109		gpio = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
110		pinctrl-names = "default";
111		pinctrl-0 = <&host_vbus_drv>;
112		regulator-name = "host-pwr";
113		regulator-min-microvolt = <5000000>;
114		regulator-max-microvolt = <5000000>;
115		regulator-always-on;
116		regulator-boot-on;
117	};
118
119	vsys: vsys-regulator {
120		compatible = "regulator-fixed";
121		regulator-name = "vsys";
122		regulator-min-microvolt = <5000000>;
123		regulator-max-microvolt = <5000000>;
124		regulator-boot-on;
125	};
126};
127
128&emac {
129	status = "okay";
130
131	pinctrl-names = "default";
132	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
133
134	phy = <&phy0>;
135	phy-supply = <&vcc_rmii>;
136
137	phy0: ethernet-phy@0 {
138		reg = <0>;
139		interrupt-parent = <&gpio3>;
140		interrupts = <RK_PD2 IRQ_TYPE_LEVEL_LOW>;
141	};
142};
143
144&cpu0 {
145	cpu-supply = <&vdd_arm>;
146};
147
148&cpu1 {
149	cpu-supply = <&vdd_arm>;
150};
151
152&cpu2 {
153	cpu-supply = <&vdd_arm>;
154};
155
156&cpu3 {
157	cpu-supply = <&vdd_arm>;
158};
159
160&gpu {
161	status = "okay";
162};
163
164&i2c1 {
165	status = "okay";
166	clock-frequency = <400000>;
167
168	rtc@51 {
169		compatible = "haoyu,hym8563";
170		reg = <0x51>;
171		interrupt-parent = <&gpio0>;
172		interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
173		pinctrl-names = "default";
174		pinctrl-0 = <&rtc_int>;
175		#clock-cells = <0>;
176		clock-output-names = "xin32k";
177	};
178
179	act8846: act8846@5a {
180		compatible = "active-semi,act8846";
181		reg = <0x5a>;
182		status = "okay";
183		system-power-controller;
184
185		pinctrl-names = "default";
186		pinctrl-0 = <&act8846_dvs0_ctl>;
187
188		vp1-supply = <&vsys>;
189		vp2-supply = <&vsys>;
190		vp3-supply = <&vsys>;
191		vp4-supply = <&vsys>;
192		inl1-supply = <&vcc_io>;
193		inl2-supply = <&vsys>;
194		inl3-supply = <&vsys>;
195
196		regulators {
197			vcc_ddr: REG1 {
198				regulator-name = "VCC_DDR";
199				regulator-min-microvolt = <1200000>;
200				regulator-max-microvolt = <1200000>;
201				regulator-always-on;
202			};
203
204			vdd_log: REG2 {
205				regulator-name = "VDD_LOG";
206				regulator-min-microvolt = <1000000>;
207				regulator-max-microvolt = <1000000>;
208				regulator-always-on;
209			};
210
211			vdd_arm: REG3 {
212				regulator-name = "VDD_ARM";
213				regulator-min-microvolt = <875000>;
214				regulator-max-microvolt = <1350000>;
215				regulator-always-on;
216			};
217
218			vcc_io: REG4 {
219				regulator-name = "VCC_IO";
220				regulator-min-microvolt = <3300000>;
221				regulator-max-microvolt = <3300000>;
222				regulator-always-on;
223			};
224
225			vdd_10: REG5 {
226				regulator-name = "VDD_10";
227				regulator-min-microvolt = <1000000>;
228				regulator-max-microvolt = <1000000>;
229				regulator-always-on;
230			};
231
232			vdd_hdmi: REG6 {
233				regulator-name = "VDD_HDMI";
234				regulator-min-microvolt = <2500000>;
235				regulator-max-microvolt = <2500000>;
236				regulator-always-on;
237			};
238
239			vcc18: REG7 {
240				regulator-name = "VCC_18";
241				regulator-min-microvolt = <1800000>;
242				regulator-max-microvolt = <1800000>;
243				regulator-always-on;
244			};
245
246			vcca_33: REG8 {
247				regulator-name = "VCCA_33";
248				regulator-min-microvolt = <3300000>;
249				regulator-max-microvolt = <3300000>;
250				regulator-always-on;
251			};
252
253			vcc_rmii: REG9 {
254				regulator-name = "VCC_RMII";
255				regulator-min-microvolt = <3300000>;
256				regulator-max-microvolt = <3300000>;
257			};
258
259			vccio_wl: REG10 {
260				regulator-name = "VCCIO_WL";
261				regulator-min-microvolt = <3300000>;
262				regulator-max-microvolt = <3300000>;
263				regulator-always-on;
264			};
265
266			vcc_18: REG11 {
267				regulator-name = "VCC18_IO";
268				regulator-min-microvolt = <1800000>;
269				regulator-max-microvolt = <1800000>;
270				regulator-always-on;
271			};
272
273			vcc28: REG12 {
274				regulator-name = "VCC_28";
275				regulator-min-microvolt = <2800000>;
276				regulator-max-microvolt = <2800000>;
277				regulator-always-on;
278			};
279		};
280	};
281};
282
283&mmc0 {
 
284	status = "okay";
285	pinctrl-names = "default";
286	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
287	vmmc-supply = <&vcc_sd0>;
288
289	bus-width = <4>;
290	cap-mmc-highspeed;
291	cap-sd-highspeed;
292	disable-wp;
293};
294
295&pwm1 {
296	status = "okay";
297};
298
299&pwm2 {
300	status = "okay";
301};
302
303&pwm3 {
304	status = "okay";
305};
306
307&pinctrl {
308	pcfg_output_low: pcfg-output-low {
309		output-low;
310	};
311
312	act8846 {
313		act8846_dvs0_ctl: act8846-dvs0-ctl {
314			rockchip,pins = <3 RK_PD3 RK_FUNC_GPIO &pcfg_output_low>;
315		};
316	};
317
318	hym8563 {
319		rtc_int: rtc-int {
320			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
321		};
322	};
323
324	lan8720a  {
325		phy_int: phy-int {
326			rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
327		};
328	};
329
330	ir-receiver {
331		ir_recv_pin: ir-recv-pin {
332			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
333		};
334	};
335
336	sd0 {
337		sdmmc_pwr: sdmmc-pwr {
338			rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
339		};
340	};
341
342	usb {
343		host_vbus_drv: host-vbus-drv {
344			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
345		};
346		otg_vbus_drv: otg-vbus-drv {
347			rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
348		};
349	};
350};
351
352&spdif {
353	status = "okay";
354};
355
356&uart0 {
357	status = "okay";
358};
359
360&uart1 {
361	status = "okay";
362};
363
364&uart2 {
365	status = "okay";
366};
367
368&uart3 {
369	status = "okay";
370};
371
372&usbphy {
373	status = "okay";
374};
375
376&usb_host {
377	status = "okay";
378};
379
380&usb_otg {
381	status = "okay";
382};
383
384&wdt {
385	status = "okay";
386};
v4.6
 
  1/*
  2 * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
  3 *
  4 * This file is dual-licensed: you can use it either under the terms
  5 * of the GPL or the X11 license, at your option. Note that this dual
  6 * licensing only applies to this file, and not this project as a
  7 * whole.
  8 *
  9 *  a) This file is free software; you can redistribute it and/or
 10 *     modify it under the terms of the GNU General Public License as
 11 *     published by the Free Software Foundation; either version 2 of the
 12 *     License, or (at your option) any later version.
 13 *
 14 *     This file is distributed in the hope that it will be useful,
 15 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 17 *     GNU General Public License for more details.
 18 *
 19 * Or, alternatively,
 20 *
 21 *  b) Permission is hereby granted, free of charge, to any person
 22 *     obtaining a copy of this software and associated documentation
 23 *     files (the "Software"), to deal in the Software without
 24 *     restriction, including without limitation the rights to use,
 25 *     copy, modify, merge, publish, distribute, sublicense, and/or
 26 *     sell copies of the Software, and to permit persons to whom the
 27 *     Software is furnished to do so, subject to the following
 28 *     conditions:
 29 *
 30 *     The above copyright notice and this permission notice shall be
 31 *     included in all copies or substantial portions of the Software.
 32 *
 33 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 34 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 35 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 36 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 37 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 38 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 39 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 40 *     OTHER DEALINGS IN THE SOFTWARE.
 41 */
 42
 43/dts-v1/;
 
 44#include "rk3188.dtsi"
 45
 46/ {
 47	model = "Radxa Rock";
 48	compatible = "radxa,rock", "rockchip,rk3188";
 49
 50	memory {
 
 
 
 
 51		device_type = "memory";
 52		reg = <0x60000000 0x80000000>;
 53	};
 54
 55	gpio-keys {
 56		compatible = "gpio-keys";
 57		#address-cells = <1>;
 58		#size-cells = <0>;
 59		autorepeat;
 60
 61		button@0 {
 62			gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
 63			linux,code = <116>;
 64			label = "GPIO Key Power";
 65			linux,input-type = <1>;
 66			wakeup-source;
 67			debounce-interval = <100>;
 68		};
 69	};
 70
 71	gpio-leds {
 72		compatible = "gpio-leds";
 73
 74		green {
 75			label = "rock:green:user1";
 76			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
 77			default-state = "off";
 78		};
 79
 80		blue {
 81			label = "rock:blue:user2";
 82			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
 83			default-state = "off";
 84		};
 85
 86		sleep {
 87			label = "rock:red:power";
 88			gpios = <&gpio0 15 0>;
 89			default-state = "off";
 90		};
 91	};
 92
 93	sound {
 94		compatible = "simple-audio-card";
 95		simple-audio-card,name = "SPDIF";
 96
 97		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
 98			cpu { sound-dai = <&spdif>; };
 99			codec { sound-dai = <&spdif_out>; };
100		};
101	};
102
103	spdif_out: spdif-out {
104		compatible = "linux,spdif-dit";
105		#sound-dai-cells = <0>;
106	};
107
108	ir_recv: gpio-ir-receiver {
109		compatible = "gpio-ir-receiver";
110		gpios = <&gpio0 10 1>;
111		pinctrl-names = "default";
112		pinctrl-0 = <&ir_recv_pin>;
113	};
114
115	vcc_otg: usb-otg-regulator {
116		compatible = "regulator-fixed";
117		enable-active-high;
118		gpio = <&gpio2 31 GPIO_ACTIVE_HIGH>;
119		pinctrl-names = "default";
120		pinctrl-0 = <&otg_vbus_drv>;
121		regulator-name = "otg-vbus";
122		regulator-min-microvolt = <5000000>;
123		regulator-max-microvolt = <5000000>;
124		regulator-always-on;
125		regulator-boot-on;
126	};
127
128	vcc_sd0: sdmmc-regulator {
129		compatible = "regulator-fixed";
130		regulator-name = "sdmmc-supply";
131		regulator-min-microvolt = <3300000>;
132		regulator-max-microvolt = <3300000>;
133		gpio = <&gpio3 1 GPIO_ACTIVE_LOW>;
 
 
134		startup-delay-us = <100000>;
135		vin-supply = <&vcc_io>;
136	};
137
138	vcc_host: usb-host-regulator {
139		compatible = "regulator-fixed";
140		enable-active-high;
141		gpio = <&gpio0 3 GPIO_ACTIVE_HIGH>;
142		pinctrl-names = "default";
143		pinctrl-0 = <&host_vbus_drv>;
144		regulator-name = "host-pwr";
145		regulator-min-microvolt = <5000000>;
146		regulator-max-microvolt = <5000000>;
147		regulator-always-on;
148		regulator-boot-on;
149	};
150
151	vsys: vsys-regulator {
152		compatible = "regulator-fixed";
153		regulator-name = "vsys";
154		regulator-min-microvolt = <5000000>;
155		regulator-max-microvolt = <5000000>;
156		regulator-boot-on;
157	};
158};
159
160&emac {
161	status = "okay";
162
163	pinctrl-names = "default";
164	pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
165
166	phy = <&phy0>;
167	phy-supply = <&vcc_rmii>;
168
169	phy0: ethernet-phy@0 {
170		reg = <0>;
171		interrupt-parent = <&gpio3>;
172		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
173	};
174};
175
176&cpu0 {
177	cpu0-supply = <&vdd_arm>;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178};
179
180&i2c1 {
181	status = "okay";
182	clock-frequency = <400000>;
183
184	rtc@51 {
185		compatible = "haoyu,hym8563";
186		reg = <0x51>;
187		interrupt-parent = <&gpio0>;
188		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
189		pinctrl-names = "default";
190		pinctrl-0 = <&rtc_int>;
191		#clock-cells = <0>;
192		clock-output-names = "xin32k";
193	};
194
195	act8846: act8846@5a {
196		compatible = "active-semi,act8846";
197		reg = <0x5a>;
198		status = "okay";
199		system-power-controller;
200
201		pinctrl-names = "default";
202		pinctrl-0 = <&act8846_dvs0_ctl>;
203
204		vp1-supply = <&vsys>;
205		vp2-supply = <&vsys>;
206		vp3-supply = <&vsys>;
207		vp4-supply = <&vsys>;
208		inl1-supply = <&vcc_io>;
209		inl2-supply = <&vsys>;
210		inl3-supply = <&vsys>;
211
212		regulators {
213			vcc_ddr: REG1 {
214				regulator-name = "VCC_DDR";
215				regulator-min-microvolt = <1200000>;
216				regulator-max-microvolt = <1200000>;
217				regulator-always-on;
218			};
219
220			vdd_log: REG2 {
221				regulator-name = "VDD_LOG";
222				regulator-min-microvolt = <1000000>;
223				regulator-max-microvolt = <1000000>;
224				regulator-always-on;
225			};
226
227			vdd_arm: REG3 {
228				regulator-name = "VDD_ARM";
229				regulator-min-microvolt = <875000>;
230				regulator-max-microvolt = <1350000>;
231				regulator-always-on;
232			};
233
234			vcc_io: REG4 {
235				regulator-name = "VCC_IO";
236				regulator-min-microvolt = <3300000>;
237				regulator-max-microvolt = <3300000>;
238				regulator-always-on;
239			};
240
241			vdd_10: REG5 {
242				regulator-name = "VDD_10";
243				regulator-min-microvolt = <1000000>;
244				regulator-max-microvolt = <1000000>;
245				regulator-always-on;
246			};
247
248			vdd_hdmi: REG6 {
249				regulator-name = "VDD_HDMI";
250				regulator-min-microvolt = <2500000>;
251				regulator-max-microvolt = <2500000>;
252				regulator-always-on;
253			};
254
255			vcc18: REG7 {
256				regulator-name = "VCC_18";
257				regulator-min-microvolt = <1800000>;
258				regulator-max-microvolt = <1800000>;
259				regulator-always-on;
260			};
261
262			vcca_33: REG8 {
263				regulator-name = "VCCA_33";
264				regulator-min-microvolt = <3300000>;
265				regulator-max-microvolt = <3300000>;
266				regulator-always-on;
267			};
268
269			vcc_rmii: REG9 {
270				regulator-name = "VCC_RMII";
271				regulator-min-microvolt = <3300000>;
272				regulator-max-microvolt = <3300000>;
273			};
274
275			vccio_wl: REG10 {
276				regulator-name = "VCCIO_WL";
277				regulator-min-microvolt = <3300000>;
278				regulator-max-microvolt = <3300000>;
279				regulator-always-on;
280			};
281
282			vcc_18: REG11 {
283				regulator-name = "VCC18_IO";
284				regulator-min-microvolt = <1800000>;
285				regulator-max-microvolt = <1800000>;
286				regulator-always-on;
287			};
288
289			vcc28: REG12 {
290				regulator-name = "VCC_28";
291				regulator-min-microvolt = <2800000>;
292				regulator-max-microvolt = <2800000>;
293				regulator-always-on;
294			};
295		};
296	};
297};
298
299&mmc0 {
300	num-slots = <1>;
301	status = "okay";
302	pinctrl-names = "default";
303	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
304	vmmc-supply = <&vcc_sd0>;
305
306	bus-width = <4>;
307	cap-mmc-highspeed;
308	cap-sd-highspeed;
309	disable-wp;
310};
311
312&pwm1 {
313	status = "okay";
314};
315
316&pwm2 {
317	status = "okay";
318};
319
320&pwm3 {
321	status = "okay";
322};
323
324&pinctrl {
325	pcfg_output_low: pcfg-output-low {
326		output-low;
327	};
328
329	act8846 {
330		act8846_dvs0_ctl: act8846-dvs0-ctl {
331			rockchip,pins = <RK_GPIO3 27 RK_FUNC_GPIO &pcfg_output_low>;
332		};
333	};
334
335	hym8563 {
336		rtc_int: rtc-int {
337			rockchip,pins = <RK_GPIO0 0 RK_FUNC_GPIO &pcfg_pull_up>;
338		};
339	};
340
341	lan8720a  {
342		phy_int: phy-int {
343			rockchip,pins = <RK_GPIO3 26 RK_FUNC_GPIO &pcfg_pull_up>;
344		};
345	};
346
347	ir-receiver {
348		ir_recv_pin: ir-recv-pin {
349			rockchip,pins = <RK_GPIO0 10 RK_FUNC_GPIO &pcfg_pull_none>;
 
 
 
 
 
 
350		};
351	};
352
353	usb {
354		host_vbus_drv: host-vbus-drv {
355			rockchip,pins = <0 3 RK_FUNC_GPIO &pcfg_pull_none>;
356		};
357		otg_vbus_drv: otg-vbus-drv {
358			rockchip,pins = <2 31 RK_FUNC_GPIO &pcfg_pull_none>;
359		};
360	};
361};
362
363&spdif {
364	status = "okay";
365};
366
367&uart0 {
368	status = "okay";
369};
370
371&uart1 {
372	status = "okay";
373};
374
375&uart2 {
376	status = "okay";
377};
378
379&uart3 {
380	status = "okay";
381};
382
383&usbphy {
384	status = "okay";
385};
386
387&usb_host {
388	status = "okay";
389};
390
391&usb_otg {
392	status = "okay";
393};
394
395&wdt {
396	status = "okay";
397};