1
- From 1739c0e34dacde91c4ff9e0d32e430d30d2572f7 Mon Sep 17 00:00:00 2001
1
+ From 050de33c37da9f6ef591036362b588bb8b68de10 Mon Sep 17 00:00:00 2001
2
2
From: Stephen Graf <stephen.graf@gmail.com>
3
3
Date: Thu, 9 May 2024 20:59:34 -0700
4
- Subject: Sound for H616, H618 Allwinner SOCs
4
+ Subject: [PATCH] Sound for H616, H618 Allwinner SOCs
5
5
6
6
Signed-off-by: Stephen Graf <stephen.graf@gmail.com>
7
+
7
8
Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
9
+ Fix error: incompatible pointer type
10
+ Fix warning: no previous prototype
11
+ For v6.13.7
8
12
---
9
13
.../allwinner/sun50i-h616-orangepi-zero.dtsi | 18 +
10
14
.../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 65 +-
@@ -19,17 +23,17 @@ Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
19
23
sound/soc/sunxi_v2/Makefile | 11 +
20
24
sound/soc/sunxi_v2/drv_hdmi.h | 63 +
21
25
sound/soc/sunxi_v2/snd_sunxi_ahub.c | 1475 +++++++++++++++++
22
- sound/soc/sunxi_v2/snd_sunxi_ahub.h | 67 +
26
+ sound/soc/sunxi_v2/snd_sunxi_ahub.h | 74 +
23
27
sound/soc/sunxi_v2/snd_sunxi_ahub_dam.c | 532 ++++++
24
- sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h | 291 ++++
28
+ sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h | 294 ++++
25
29
sound/soc/sunxi_v2/snd_sunxi_common.c | 267 +++
26
30
sound/soc/sunxi_v2/snd_sunxi_common.h | 67 +
27
31
sound/soc/sunxi_v2/snd_sunxi_log.h | 29 +
28
32
sound/soc/sunxi_v2/snd_sunxi_mach.c | 479 ++++++
29
- sound/soc/sunxi_v2/snd_sunxi_mach.h | 17 +
33
+ sound/soc/sunxi_v2/snd_sunxi_mach.h | 20 +
30
34
sound/soc/sunxi_v2/snd_sunxi_mach_utils.c | 422 +++++
31
35
sound/soc/sunxi_v2/snd_sunxi_mach_utils.h | 116 ++
32
- 23 files changed, 5104 insertions(+), 3 deletions(-)
36
+ 23 files changed, 5117 insertions(+), 3 deletions(-)
33
37
create mode 100644 sound/soc/sunxi/sun50iw9-codec.c
34
38
create mode 100644 sound/soc/sunxi_v2/Kconfig
35
39
create mode 100644 sound/soc/sunxi_v2/Makefile
@@ -165,7 +169,7 @@ index 668ed3b9090a..8f992bd4a9d2 100644
165
169
compatible = "allwinner,sun50i-h616-musb",
166
170
"allwinner,sun8i-h3-musb";
167
171
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
168
- index aab57c19f62b..2a4da00141bb 100644
172
+ index aab57c19f62b..91309f090e27 100644
169
173
--- a/include/sound/soc-dai.h
170
174
+++ b/include/sound/soc-dai.h
171
175
@@ -410,6 +410,15 @@ struct snd_soc_dai_driver {
@@ -176,7 +180,7 @@ index aab57c19f62b..2a4da00141bb 100644
176
180
+ int (*probe)(struct snd_soc_dai *dai);
177
181
+ int (*remove)(struct snd_soc_dai *dai);
178
182
+ /* compress dai */
179
- + int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num );
183
+ + int (*compress_new)(struct snd_soc_pcm_runtime *rtd);
180
184
+ /* Optional Callback used at pcm creation*/
181
185
+ int (*pcm_new)(struct snd_soc_pcm_runtime *rtd,
182
186
+ struct snd_soc_dai *dai);
@@ -3013,10 +3017,10 @@ index 000000000000..6d4a847a928f
3013
3017
+ MODULE_DESCRIPTION("sunxi soundcard platform of ahub");
3014
3018
diff --git a/sound/soc/sunxi_v2/snd_sunxi_ahub.h b/sound/soc/sunxi_v2/snd_sunxi_ahub.h
3015
3019
new file mode 100644
3016
- index 000000000000..b3c1cc592844
3020
+ index 000000000000..cd4be46b6ebf
3017
3021
--- /dev/null
3018
3022
+++ b/sound/soc/sunxi_v2/snd_sunxi_ahub.h
3019
- @@ -0,0 +1,67 @@
3023
+ @@ -0,0 +1,74 @@
3020
3024
+ /* sound\soc\sunxi\snd_sunxi_ahub.h
3021
3025
+ * (C) Copyright 2021-2025
3022
3026
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
@@ -3083,6 +3087,13 @@ index 000000000000..b3c1cc592844
3083
3087
+ unsigned int bclk_freq;
3084
3088
+ };
3085
3089
+
3090
+ + int sunxi_loopback_debug_get(struct snd_kcontrol *kcontrol,
3091
+ + struct snd_ctl_elem_value *ucontrol);
3092
+ + int sunxi_loopback_debug_set(struct snd_kcontrol *kcontrol,
3093
+ + struct snd_ctl_elem_value *ucontrol);
3094
+ + int __init sunxi_ahub_dev_init(void);
3095
+ + void __exit sunxi_ahub_dev_exit(void);
3096
+ +
3086
3097
+ #endif /* __SND_SUNXI_AHUB_H */
3087
3098
diff --git a/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.c b/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.c
3088
3099
new file mode 100644
@@ -3624,10 +3635,10 @@ index 000000000000..f3c7bb3c7cd2
3624
3635
+ MODULE_DESCRIPTION("sunxi soundcard platform of ahub_dam");
3625
3636
diff --git a/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h b/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h
3626
3637
new file mode 100644
3627
- index 000000000000..b7679bf545e9
3638
+ index 000000000000..436742d87e8f
3628
3639
--- /dev/null
3629
3640
+++ b/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h
3630
- @@ -0,0 +1,291 @@
3641
+ @@ -0,0 +1,294 @@
3631
3642
+ /* sound\soc\sunxi\snd_sunxi_ahub_dam.h
3632
3643
+ * (C) Copyright 2021-2025
3633
3644
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
@@ -3918,8 +3929,10 @@ index 000000000000..b7679bf545e9
3918
3929
+ extern int snd_soc_sunxi_ahub_mem_get(struct sunxi_ahub_mem_info *mem_info);
3919
3930
+ extern int snd_soc_sunxi_ahub_clk_get(struct sunxi_ahub_clk_info *clk_info);
3920
3931
+
3932
+ + int __init sunxi_ahub_dam_dev_init(void);
3933
+ + void __exit sunxi_ahub_dam_dev_exit(void);
3934
+ +
3921
3935
+ #endif /* __SND_SUNXI_AHUB_DAM_H */
3922
- \ No newline at end of file
3923
3936
diff --git a/sound/soc/sunxi_v2/snd_sunxi_common.c b/sound/soc/sunxi_v2/snd_sunxi_common.c
3924
3937
new file mode 100644
3925
3938
index 000000000000..410ab75aea5a
@@ -4304,7 +4317,7 @@ index 000000000000..89ad9fe71936
4304
4317
+ #endif /* __SND_SUNXI_LOG_H */
4305
4318
diff --git a/sound/soc/sunxi_v2/snd_sunxi_mach.c b/sound/soc/sunxi_v2/snd_sunxi_mach.c
4306
4319
new file mode 100644
4307
- index 000000000000..ea73eced251e
4320
+ index 000000000000..74d276a2da92
4308
4321
--- /dev/null
4309
4322
+++ b/sound/soc/sunxi_v2/snd_sunxi_mach.c
4310
4323
@@ -0,0 +1,479 @@
@@ -4353,8 +4366,8 @@ index 000000000000..ea73eced251e
4353
4366
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
4354
4367
+
4355
4368
+ struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
4356
- + struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, rtd->num );
4357
- + struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num );
4369
+ + struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, rtd->id );
4370
+ + struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->id );
4358
4371
+ struct asoc_simple_dai *dais = priv->dais;
4359
4372
+ unsigned int mclk;
4360
4373
+ unsigned int cpu_pll_clk, codec_pll_clk;
@@ -4789,10 +4802,10 @@ index 000000000000..ea73eced251e
4789
4802
+ MODULE_DESCRIPTION("sunxi soundcard machine");
4790
4803
diff --git a/sound/soc/sunxi_v2/snd_sunxi_mach.h b/sound/soc/sunxi_v2/snd_sunxi_mach.h
4791
4804
new file mode 100644
4792
- index 000000000000..ab429c8841ab
4805
+ index 000000000000..6f9ea8ccf8b5
4793
4806
--- /dev/null
4794
4807
+++ b/sound/soc/sunxi_v2/snd_sunxi_mach.h
4795
- @@ -0,0 +1,17 @@
4808
+ @@ -0,0 +1,20 @@
4796
4809
+ /* sound\soc\sunxi\snd_sunxi_mach.h
4797
4810
+ * (C) Copyright 2021-2025
4798
4811
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
@@ -4809,6 +4822,9 @@ index 000000000000..ab429c8841ab
4809
4822
+
4810
4823
+ #include "snd_sunxi_mach_utils.h"
4811
4824
+
4825
+ + int __init sunxi_soundcard_machine_dev_init(void);
4826
+ + void __exit sunxi_soundcard_machine_dev_exit(void);
4827
+ +
4812
4828
+ #endif /* __SND_SUNXI_MACH_H */
4813
4829
diff --git a/sound/soc/sunxi_v2/snd_sunxi_mach_utils.c b/sound/soc/sunxi_v2/snd_sunxi_mach_utils.c
4814
4830
new file mode 100644
0 commit comments