aboutsummaryrefslogtreecommitdiff
path: root/target/linux/d1/patches-6.1/0036-riscv-dts-allwinner-Add-Bluetooth-PCM-audio.patch
blob: 0ef4b3c56be206c49ead2867d162e1060e2b48fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From bf83f1dc034111aac1f23b98d7205d08c7c83208 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Wed, 17 Aug 2022 02:33:25 -0500
Subject: [PATCH 036/117] riscv: dts: allwinner: Add Bluetooth PCM audio

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 .../allwinner/sun20i-d1-clockworkpi-v3.14.dts | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)

--- a/arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts
+++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts
@@ -22,6 +22,32 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	bt_sco_codec: bt-sco-codec {
+		#sound-dai-cells = <0>;
+		compatible = "linux,bt-sco";
+	};
+
+	bt-sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "Bluetooth";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		simple-audio-card,dai-link@0 {
+			format = "dsp_a";
+			frame-master = <&bt_sound_cpu>;
+			bitclock-master = <&bt_sound_cpu>;
+
+			bt_sound_cpu: cpu {
+				sound-dai = <&i2s1>;
+			};
+
+			codec {
+				sound-dai = <&bt_sco_codec>;
+			};
+		};
+	};
+
 	/*
 	 * This regulator is PWM-controlled, but the PWM controller is not
 	 * yet supported, so fix the regulator to its default voltage.
@@ -169,6 +195,12 @@
 	};
 };
 
+&i2s1 {
+	pinctrl-0 = <&i2s1_clk_pins>, <&i2s1_din_pin>, <&i2s1_dout_pin>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
 &mmc0 {
 	broken-cd;
 	bus-width = <4>;
@@ -205,6 +237,21 @@
 
 &pio {
 	vcc-pg-supply = <&reg_ldoa>;
+
+	i2s1_clk_pins: i2s1-clk-pins {
+		pins = "PG12", "PG13";
+		function = "i2s1";
+	};
+
+	i2s1_din_pin: i2s1-din-pin {
+		pins = "PG14";
+		function = "i2s1_din";
+	};
+
+	i2s1_dout_pin: i2s1-dout-pin {
+		pins = "PG15";
+		function = "i2s1_dout";
+	};
 };
 
 &uart0 {