Linux Audio

Check our new training course

Linux BSP upgrade and security maintenance

Need help to get security updates for your Linux BSP?
Loading...
v6.2
  1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  2
  3/dts-v1/;
  4#include <dt-bindings/input/input.h>
  5#include "rk3288-rock2-som.dtsi"
  6
  7/ {
  8	model = "Radxa Rock 2 Square";
  9	compatible = "radxa,rock2-square", "rockchip,rk3288";
 10
 11	chosen {
 12		stdout-path = "serial2:115200n8";
 13	};
 14
 15	adc-keys {
 16		compatible = "adc-keys";
 17		io-channels = <&saradc 1>;
 18		io-channel-names = "buttons";
 19		keyup-threshold-microvolt = <1800000>;
 20
 21		button-recovery {
 22			label = "Recovery";
 23			linux,code = <KEY_VENDOR>;
 24			press-threshold-microvolt = <0>;
 25		};
 26	};
 27
 28	gpio-keys {
 29		compatible = "gpio-keys";
 30
 31		key-power {
 32			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
 33			label = "GPIO Power";
 34			linux,code = <KEY_POWER>;
 35			pinctrl-names = "default";
 36			pinctrl-0 = <&pwr_key>;
 37			wakeup-source;
 38		};
 39	};
 40
 41	gpio-leds {
 42		compatible = "gpio-leds";
 43
 44		heartbeat_led: led-0 {
 45			gpios = <&gpio7 RK_PB7 GPIO_ACTIVE_LOW>;
 46			label = "rock2:green:state1";
 47			linux,default-trigger = "heartbeat";
 48		};
 49
 50		mmc_led: led-1 {
 51			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>;
 52			label = "rock2:blue:state2";
 53			linux,default-trigger = "mmc0";
 54		};
 55	};
 56
 57	ir: ir-receiver {
 58		compatible = "gpio-ir-receiver";
 59		gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>;
 60		pinctrl-names = "default";
 61		pinctrl-0 = <&ir_int>;
 62	};
 63
 64	sound {
 65		compatible = "simple-audio-card";
 66		simple-audio-card,name = "SPDIF";
 67		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
 68			cpu { sound-dai = <&spdif>; };
 69			codec { sound-dai = <&spdif_out>; };
 70		};
 71	};
 72
 73	sata_pwr: sata-prw-regulator {
 74		compatible = "regulator-fixed";
 75		enable-active-high;
 76		gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
 77		pinctrl-names = "default";
 78		pinctrl-0 = <&sata_pwr_en>;
 79		/* Always turn on the 5V sata power connector */
 80		regulator-always-on;
 81		regulator-name = "sata_pwr";
 82	};
 83
 84	spdif_out: spdif-out {
 85		compatible = "linux,spdif-dit";
 86		#sound-dai-cells = <0>;
 87	};
 88
 89	sound-i2s {
 90		compatible = "rockchip,rk3288-hdmi-analog";
 91		pinctrl-names = "default";
 92		pinctrl-0 = <&phone_ctl>, <&hp_det>;
 93		rockchip,audio-codec = <&es8388>;
 94		rockchip,hp-det-gpios = <&gpio7 7 GPIO_ACTIVE_HIGH>;
 95		rockchip,hp-en-gpios = <&gpio8 0 GPIO_ACTIVE_HIGH>;
 96		rockchip,i2s-controller = <&i2s>;
 97		rockchip,model = "I2S";
 98		rockchip,routing = "Analog", "LOUT2",
 99				   "Analog", "ROUT2";
100	};
101
102	sdio_pwrseq: sdio-pwrseq {
103		compatible = "mmc-pwrseq-simple";
104		clocks = <&hym8563>;
105		clock-names = "ext_clock";
106		pinctrl-names = "default";
107		pinctrl-0 = <&wifi_enable>;
108		reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
109	};
110
111	vcc_usb_host: vcc-host-regulator {
112		compatible = "regulator-fixed";
113		enable-active-high;
114		gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
115		pinctrl-names = "default";
116		pinctrl-0 = <&host_vbus_drv>;
117		regulator-name = "vcc_host";
118	};
119
120	vcc_sd: sdmmc-regulator {
121		compatible = "regulator-fixed";
122		gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>;
123		pinctrl-names = "default";
124		pinctrl-0 = <&sdmmc_pwr>;
125		regulator-name = "vcc_sd";
126		regulator-min-microvolt = <3300000>;
127		regulator-max-microvolt = <3300000>;
128		vin-supply = <&vcc_io>;
129	};
130};
131
132&sdio0 {
133	bus-width = <4>;
134	cap-sd-highspeed;
135	cap-sdio-irq;
 
136	mmc-pwrseq = <&sdio_pwrseq>;
137	non-removable;
138	pinctrl-names = "default";
139	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
140	vmmc-supply = <&vcc_io>;
141	vqmmc-supply = <&vcc_18>;
142	status = "okay";
143};
144
145&sdmmc {
146	bus-width = <4>;
147	cap-mmc-highspeed;
148	cap-sd-highspeed;
149	card-detect-delay = <200>;
150	disable-wp;	/* wp not hooked up */
151	pinctrl-names = "default";
152	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
153	vmmc-supply = <&vcc_sd>;
154	vqmmc-supply = <&vccio_sd>;
155	status = "okay";
156};
157
158&gmac {
159	status = "okay";
160};
161
162&hdmi {
163	ddc-i2c-bus = <&i2c5>;
164	status = "okay";
165};
166
167&i2c0 {
168	hym8563: rtc@51 {
169		compatible = "haoyu,hym8563";
170		reg = <0x51>;
171		#clock-cells = <0>;
 
172		clock-output-names = "xin32k";
173		interrupt-parent = <&gpio0>;
174		interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
175		pinctrl-names = "default";
176		pinctrl-0 = <&pmic_int>;
177
178	};
179};
180
181&i2c2 {
182	status = "okay";
183
184	es8388: es8388@10 {
185		compatible = "everest,es8388", "everest,es8328";
186		reg = <0x10>;
187		AVDD-supply = <&vccio_codec>;
188		DVDD-supply = <&vccio_codec>;
189		HPVDD-supply = <&vccio_codec>;
190		PVDD-supply = <&vccio_codec>;
191		clocks = <&cru SCLK_I2S0_OUT>;
192	};
193};
194
195&i2c5 {
196	status = "okay";
197};
198
199&i2s {
200	status = "okay";
201};
202
203&pinctrl {
204	ir {
205		ir_int: ir-int {
206			rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
207		};
208	};
209
210	keys {
211		pwr_key: pwr-key {
212			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
213		};
214	};
215
216	pmic {
217		pmic_int: pmic-int {
218			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
219		};
220	};
221
222	headphone {
223		hp_det: hp-det {
224			rockchip,pins = <7 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
225		};
226
227		phone_ctl: phone-ctl {
228			rockchip,pins = <8 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
229		};
230	};
231
232	usb {
233		host_vbus_drv: host-vbus-drv {
234			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
235		};
236	};
237
238	sata {
239		sata_pwr_en: sata-pwr-en {
240			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
241		};
242	};
243
244	sdmmc {
245		sdmmc_pwr: sdmmc-pwr {
246			rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
247		};
248	};
249
250	sdio {
251		wifi_enable: wifi-enable {
252			rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
253		};
254	};
255};
256
257&saradc {
258	status = "okay";
259};
260
261&spdif {
262	status = "okay";
263};
264
265&uart2 {
266	status = "okay";
267};
268
269&usbphy {
270	status = "okay";
271};
272
273&usbphy1 {
274	vbus-supply = <&vcc_usb_host>;
275};
276
277&usb_host0_ehci {
278	status = "okay";
279};
280
281&usb_host1 {
282	status = "okay";
283};
284
285&usb_otg {
286	status = "okay";
287};
v4.17
  1/*
  2 * This file is dual-licensed: you can use it either under the terms
  3 * of the GPL or the X11 license, at your option. Note that this dual
  4 * licensing only applies to this file, and not this project as a
  5 * whole.
  6 *
  7 *  a) This file is free software; you can redistribute it and/or
  8 *     modify it under the terms of the GNU General Public License as
  9 *     published by the Free Software Foundation; either version 2 of the
 10 *     License, or (at your option) any later version.
 11 *
 12 *     This file is distributed in the hope that it will be useful,
 13 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 14 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15 *     GNU General Public License for more details.
 16 *
 17 * Or, alternatively,
 18 *
 19 *  b) Permission is hereby granted, free of charge, to any person
 20 *     obtaining a copy of this software and associated documentation
 21 *     files (the "Software"), to deal in the Software without
 22 *     restriction, including without limitation the rights to use,
 23 *     copy, modify, merge, publish, distribute, sublicense, and/or
 24 *     sell copies of the Software, and to permit persons to whom the
 25 *     Software is furnished to do so, subject to the following
 26 *     conditions:
 27 *
 28 *     The above copyright notice and this permission notice shall be
 29 *     included in all copies or substantial portions of the Software.
 30 *
 31 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 32 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 33 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 34 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 35 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 36 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 37 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 38 *     OTHER DEALINGS IN THE SOFTWARE.
 39 */
 40
 41/dts-v1/;
 42#include <dt-bindings/input/input.h>
 43#include "rk3288-rock2-som.dtsi"
 44
 45/ {
 46	model = "Radxa Rock 2 Square";
 47	compatible = "radxa,rock2-square", "rockchip,rk3288";
 48
 49	chosen {
 50		stdout-path = "serial2:115200n8";
 51	};
 52
 53	adc-keys {
 54		compatible = "adc-keys";
 55		io-channels = <&saradc 1>;
 56		io-channel-names = "buttons";
 57		keyup-threshold-microvolt = <1800000>;
 58
 59		button-recovery {
 60			label = "Recovery";
 61			linux,code = <KEY_VENDOR>;
 62			press-threshold-microvolt = <0>;
 63		};
 64	};
 65
 66	gpio-keys {
 67		compatible = "gpio-keys";
 68
 69		power {
 70			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
 71			label = "GPIO Power";
 72			linux,code = <KEY_POWER>;
 73			pinctrl-names = "default";
 74			pinctrl-0 = <&pwr_key>;
 75			wakeup-source;
 76		};
 77	};
 78
 79	gpio-leds {
 80		compatible = "gpio-leds";
 81
 82		heartbeat {
 83			gpios = <&gpio7 RK_PB7 GPIO_ACTIVE_LOW>;
 84			label = "rock2:green:state1";
 85			linux,default-trigger = "heartbeat";
 86		};
 87
 88		mmc {
 89			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>;
 90			label = "rock2:blue:state2";
 91			linux,default-trigger = "mmc0";
 92		};
 93	};
 94
 95	ir: ir-receiver {
 96		compatible = "gpio-ir-receiver";
 97		gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>;
 98		pinctrl-names = "default";
 99		pinctrl-0 = <&ir_int>;
100	};
101
102	sound {
103		compatible = "simple-audio-card";
104		simple-audio-card,name = "SPDIF";
105		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
106			cpu { sound-dai = <&spdif>; };
107			codec { sound-dai = <&spdif_out>; };
108		};
109	};
110
111	sata_pwr: sata-prw-regulator {
112		compatible = "regulator-fixed";
113		enable-active-high;
114		gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
115		pinctrl-names = "default";
116		pinctrl-0 = <&sata_pwr_en>;
117		/* Always turn on the 5V sata power connector */
118		regulator-always-on;
119		regulator-name = "sata_pwr";
120	};
121
122	spdif_out: spdif-out {
123		compatible = "linux,spdif-dit";
124		#sound-dai-cells = <0>;
125	};
126
127	sound-i2s {
128		compatible = "rockchip,rk3288-hdmi-analog";
129		pinctrl-names = "default";
130		pinctrl-0 = <&phone_ctl>, <&hp_det>;
131		rockchip,audio-codec = <&es8388>;
132		rockchip,hp-det-gpios = <&gpio7 7 GPIO_ACTIVE_HIGH>;
133		rockchip,hp-en-gpios = <&gpio8 0 GPIO_ACTIVE_HIGH>;
134		rockchip,i2s-controller = <&i2s>;
135		rockchip,model = "I2S";
136		rockchip,routing = "Analog", "LOUT2",
137				   "Analog", "ROUT2";
138	};
139
140	sdio_pwrseq: sdio-pwrseq {
141		compatible = "mmc-pwrseq-simple";
142		clocks = <&hym8563>;
143		clock-names = "ext_clock";
144		pinctrl-names = "default";
145		pinctrl-0 = <&wifi_enable>;
146		reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>;
147	};
148
149	vcc_usb_host: vcc-host-regulator {
150		compatible = "regulator-fixed";
151		enable-active-high;
152		gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
153		pinctrl-names = "default";
154		pinctrl-0 = <&host_vbus_drv>;
155		regulator-name = "vcc_host";
156	};
157
158	vcc_sd: sdmmc-regulator {
159		compatible = "regulator-fixed";
160		gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>;
161		pinctrl-names = "default";
162		pinctrl-0 = <&sdmmc_pwr>;
163		regulator-name = "vcc_sd";
164		regulator-min-microvolt = <3300000>;
165		regulator-max-microvolt = <3300000>;
166		vin-supply = <&vcc_io>;
167	};
168};
169
170&sdio0 {
171	bus-width = <4>;
172	cap-sd-highspeed;
173	cap-sdio-irq;
174	disable-wp;
175	mmc-pwrseq = <&sdio_pwrseq>;
176	non-removable;
177	pinctrl-names = "default";
178	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
179	vmmc-supply = <&vcc_io>;
180	vqmmc-supply = <&vcc_18>;
181	status = "okay";
182};
183
184&sdmmc {
185	bus-width = <4>;
186	cap-mmc-highspeed;
187	cap-sd-highspeed;
188	card-detect-delay = <200>;
189	disable-wp;	/* wp not hooked up */
190	pinctrl-names = "default";
191	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
192	vmmc-supply = <&vcc_sd>;
193	vqmmc-supply = <&vccio_sd>;
194	status = "okay";
195};
196
197&gmac {
198	status = "ok";
199};
200
201&hdmi {
202	ddc-i2c-bus = <&i2c5>;
203	status = "okay";
204};
205
206&i2c0 {
207	hym8563: hym8563@51 {
208		compatible = "haoyu,hym8563";
209		reg = <0x51>;
210		#clock-cells = <0>;
211		clock-frequency = <32768>;
212		clock-output-names = "xin32k";
213		interrupt-parent = <&gpio0>;
214		interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
215		pinctrl-names = "default";
216		pinctrl-0 = <&pmic_int>;
217
218	};
219};
220
221&i2c2 {
222	status = "okay";
223
224	es8388: es8388@10 {
225		compatible = "everest,es8388", "everest,es8328";
226		reg = <0x10>;
227		AVDD-supply = <&vccio_codec>;
228		DVDD-supply = <&vccio_codec>;
229		HPVDD-supply = <&vccio_codec>;
230		PVDD-supply = <&vccio_codec>;
231		clocks = <&cru SCLK_I2S0_OUT>;
232	};
233};
234
235&i2c5 {
236	status = "okay";
237};
238
239&i2s {
240	status = "okay";
241};
242
243&pinctrl {
244	ir {
245		ir_int: ir-int {
246			rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_up>;
247		};
248	};
249
250	keys {
251		pwr_key: pwr-key {
252			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
253		};
254	};
255
256	pmic {
257		pmic_int: pmic-int {
258			rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
259		};
260	};
261
262	headphone {
263		hp_det: hp-det {
264			rockchip,pins = <7 7 RK_FUNC_GPIO &pcfg_pull_none>;
265		};
266
267		phone_ctl: phone-ctl {
268			rockchip,pins = <8 0 RK_FUNC_GPIO &pcfg_pull_up>;
269		};
270	};
271
272	usb {
273		host_vbus_drv: host-vbus-drv {
274			rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
275		};
276	};
277
278	sata {
279		sata_pwr_en: sata-pwr-en {
280			rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>;
281		};
282	};
283
284	sdmmc {
285		sdmmc_pwr: sdmmc-pwr {
286			rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
287		};
288	};
289
290	sdio {
291		wifi_enable: wifi-enable {
292			rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
293		};
294	};
295};
296
297&saradc {
298	status = "okay";
299};
300
301&spdif {
302	status = "okay";
303};
304
305&uart2 {
306	status = "okay";
307};
308
309&usbphy {
310	status = "okay";
311};
312
313&usbphy1 {
314	vbus-supply = <&vcc_usb_host>;
315};
316
317&usb_host0_ehci {
318	status = "okay";
319};
320
321&usb_host1 {
322	status = "okay";
323};
324
325&usb_otg {
326	status = "okay";
327};