|
|
|
|
@@ -1,10 +1,14 @@
|
|
|
|
|
From 1739c0e34dacde91c4ff9e0d32e430d30d2572f7 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 050de33c37da9f6ef591036362b588bb8b68de10 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Stephen Graf <stephen.graf@gmail.com>
|
|
|
|
|
Date: Thu, 9 May 2024 20:59:34 -0700
|
|
|
|
|
Subject: Sound for H616, H618 Allwinner SOCs
|
|
|
|
|
Subject: [PATCH] Sound for H616, H618 Allwinner SOCs
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Stephen Graf <stephen.graf@gmail.com>
|
|
|
|
|
|
|
|
|
|
Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
|
|
|
|
|
Fix error: incompatible pointer type
|
|
|
|
|
Fix warning: no previous prototype
|
|
|
|
|
For v6.13.7
|
|
|
|
|
---
|
|
|
|
|
.../allwinner/sun50i-h616-orangepi-zero.dtsi | 18 +
|
|
|
|
|
.../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 65 +-
|
|
|
|
|
@@ -19,17 +23,17 @@ Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
|
|
|
|
|
sound/soc/sunxi_v2/Makefile | 11 +
|
|
|
|
|
sound/soc/sunxi_v2/drv_hdmi.h | 63 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_ahub.c | 1475 +++++++++++++++++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_ahub.h | 67 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_ahub.h | 74 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_ahub_dam.c | 532 ++++++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h | 291 ++++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h | 294 ++++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_common.c | 267 +++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_common.h | 67 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_log.h | 29 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_mach.c | 479 ++++++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_mach.h | 17 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_mach.h | 20 +
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_mach_utils.c | 422 +++++
|
|
|
|
|
sound/soc/sunxi_v2/snd_sunxi_mach_utils.h | 116 ++
|
|
|
|
|
23 files changed, 5104 insertions(+), 3 deletions(-)
|
|
|
|
|
23 files changed, 5117 insertions(+), 3 deletions(-)
|
|
|
|
|
create mode 100644 sound/soc/sunxi/sun50iw9-codec.c
|
|
|
|
|
create mode 100644 sound/soc/sunxi_v2/Kconfig
|
|
|
|
|
create mode 100644 sound/soc/sunxi_v2/Makefile
|
|
|
|
|
@@ -165,7 +169,7 @@ index 668ed3b9090a..8f992bd4a9d2 100644
|
|
|
|
|
compatible = "allwinner,sun50i-h616-musb",
|
|
|
|
|
"allwinner,sun8i-h3-musb";
|
|
|
|
|
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
|
|
|
|
|
index aab57c19f62b..2a4da00141bb 100644
|
|
|
|
|
index aab57c19f62b..91309f090e27 100644
|
|
|
|
|
--- a/include/sound/soc-dai.h
|
|
|
|
|
+++ b/include/sound/soc-dai.h
|
|
|
|
|
@@ -410,6 +410,15 @@ struct snd_soc_dai_driver {
|
|
|
|
|
@@ -176,7 +180,7 @@ index aab57c19f62b..2a4da00141bb 100644
|
|
|
|
|
+ int (*probe)(struct snd_soc_dai *dai);
|
|
|
|
|
+ int (*remove)(struct snd_soc_dai *dai);
|
|
|
|
|
+ /* compress dai */
|
|
|
|
|
+ int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num);
|
|
|
|
|
+ int (*compress_new)(struct snd_soc_pcm_runtime *rtd);
|
|
|
|
|
+ /* Optional Callback used at pcm creation*/
|
|
|
|
|
+ int (*pcm_new)(struct snd_soc_pcm_runtime *rtd,
|
|
|
|
|
+ struct snd_soc_dai *dai);
|
|
|
|
|
@@ -3013,10 +3017,10 @@ index 000000000000..6d4a847a928f
|
|
|
|
|
+MODULE_DESCRIPTION("sunxi soundcard platform of ahub");
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_ahub.h b/sound/soc/sunxi_v2/snd_sunxi_ahub.h
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 000000000000..b3c1cc592844
|
|
|
|
|
index 000000000000..cd4be46b6ebf
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/sound/soc/sunxi_v2/snd_sunxi_ahub.h
|
|
|
|
|
@@ -0,0 +1,67 @@
|
|
|
|
|
@@ -0,0 +1,74 @@
|
|
|
|
|
+/* sound\soc\sunxi\snd_sunxi_ahub.h
|
|
|
|
|
+ * (C) Copyright 2021-2025
|
|
|
|
|
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
|
|
|
|
@@ -3083,6 +3087,13 @@ index 000000000000..b3c1cc592844
|
|
|
|
|
+ unsigned int bclk_freq;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+int sunxi_loopback_debug_get(struct snd_kcontrol *kcontrol,
|
|
|
|
|
+ struct snd_ctl_elem_value *ucontrol);
|
|
|
|
|
+int sunxi_loopback_debug_set(struct snd_kcontrol *kcontrol,
|
|
|
|
|
+ struct snd_ctl_elem_value *ucontrol);
|
|
|
|
|
+int __init sunxi_ahub_dev_init(void);
|
|
|
|
|
+void __exit sunxi_ahub_dev_exit(void);
|
|
|
|
|
+
|
|
|
|
|
+#endif /* __SND_SUNXI_AHUB_H */
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.c b/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
@@ -3624,10 +3635,10 @@ index 000000000000..f3c7bb3c7cd2
|
|
|
|
|
+MODULE_DESCRIPTION("sunxi soundcard platform of ahub_dam");
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h b/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 000000000000..b7679bf545e9
|
|
|
|
|
index 000000000000..436742d87e8f
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/sound/soc/sunxi_v2/snd_sunxi_ahub_dam.h
|
|
|
|
|
@@ -0,0 +1,291 @@
|
|
|
|
|
@@ -0,0 +1,294 @@
|
|
|
|
|
+/* sound\soc\sunxi\snd_sunxi_ahub_dam.h
|
|
|
|
|
+ * (C) Copyright 2021-2025
|
|
|
|
|
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
|
|
|
|
@@ -3918,8 +3929,10 @@ index 000000000000..b7679bf545e9
|
|
|
|
|
+extern int snd_soc_sunxi_ahub_mem_get(struct sunxi_ahub_mem_info *mem_info);
|
|
|
|
|
+extern int snd_soc_sunxi_ahub_clk_get(struct sunxi_ahub_clk_info *clk_info);
|
|
|
|
|
+
|
|
|
|
|
+int __init sunxi_ahub_dam_dev_init(void);
|
|
|
|
|
+void __exit sunxi_ahub_dam_dev_exit(void);
|
|
|
|
|
+
|
|
|
|
|
+#endif /* __SND_SUNXI_AHUB_DAM_H */
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_common.c b/sound/soc/sunxi_v2/snd_sunxi_common.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 000000000000..410ab75aea5a
|
|
|
|
|
@@ -4304,7 +4317,7 @@ index 000000000000..89ad9fe71936
|
|
|
|
|
+#endif /* __SND_SUNXI_LOG_H */
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_mach.c b/sound/soc/sunxi_v2/snd_sunxi_mach.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 000000000000..ea73eced251e
|
|
|
|
|
index 000000000000..74d276a2da92
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/sound/soc/sunxi_v2/snd_sunxi_mach.c
|
|
|
|
|
@@ -0,0 +1,479 @@
|
|
|
|
|
@@ -4353,8 +4366,8 @@ index 000000000000..ea73eced251e
|
|
|
|
|
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
|
|
|
|
+
|
|
|
|
|
+ struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
|
|
|
|
+ struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, rtd->num);
|
|
|
|
|
+ struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num);
|
|
|
|
|
+ struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, rtd->id);
|
|
|
|
|
+ struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->id);
|
|
|
|
|
+ struct asoc_simple_dai *dais = priv->dais;
|
|
|
|
|
+ unsigned int mclk;
|
|
|
|
|
+ unsigned int cpu_pll_clk, codec_pll_clk;
|
|
|
|
|
@@ -4789,10 +4802,10 @@ index 000000000000..ea73eced251e
|
|
|
|
|
+MODULE_DESCRIPTION("sunxi soundcard machine");
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_mach.h b/sound/soc/sunxi_v2/snd_sunxi_mach.h
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 000000000000..ab429c8841ab
|
|
|
|
|
index 000000000000..6f9ea8ccf8b5
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/sound/soc/sunxi_v2/snd_sunxi_mach.h
|
|
|
|
|
@@ -0,0 +1,17 @@
|
|
|
|
|
@@ -0,0 +1,20 @@
|
|
|
|
|
+/* sound\soc\sunxi\snd_sunxi_mach.h
|
|
|
|
|
+ * (C) Copyright 2021-2025
|
|
|
|
|
+ * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
|
|
|
|
@@ -4809,6 +4822,9 @@ index 000000000000..ab429c8841ab
|
|
|
|
|
+
|
|
|
|
|
+#include "snd_sunxi_mach_utils.h"
|
|
|
|
|
+
|
|
|
|
|
+int __init sunxi_soundcard_machine_dev_init(void);
|
|
|
|
|
+void __exit sunxi_soundcard_machine_dev_exit(void);
|
|
|
|
|
+
|
|
|
|
|
+#endif /* __SND_SUNXI_MACH_H */
|
|
|
|
|
diff --git a/sound/soc/sunxi_v2/snd_sunxi_mach_utils.c b/sound/soc/sunxi_v2/snd_sunxi_mach_utils.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
|