From f289f5586e7860bed71f442c3266b2430fd43a63 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 7 Apr 2021 20:13:31 +0100 Subject: [PATCH] backport patch for 5.8 --- dkms.conf | 2 ++ patches/back-to-v5.8.diff | 71 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 patches/back-to-v5.8.diff diff --git a/dkms.conf b/dkms.conf index 6722310..3079ecb 100644 --- a/dkms.conf +++ b/dkms.conf @@ -8,6 +8,8 @@ DEST_MODULE_LOCATION[1]="/kernel/sound/soc/codecs" DEST_MODULE_LOCATION[2]="/kernel/sound/soc/bcm" PATCH[0]="back-to-v4.19.diff" PATCH[1]="back-to-v5.4.diff" +PATCH[2]="back-to-v5.8.diff" PATCH_MATCH[0]="4\.19\.*" PATCH_MATCH[1]="5\.4\.*" +PATCH_MATCH[2]="5\.8\.*" AUTOINSTALL="yes" diff --git a/patches/back-to-v5.8.diff b/patches/back-to-v5.8.diff new file mode 100644 index 0000000..4b4b4d4 --- /dev/null +++ b/patches/back-to-v5.8.diff @@ -0,0 +1,71 @@ +diff --git a/ac108.c b/ac108.c +index 4663df0..67edeae 100644 +--- a/ac108.c ++++ b/ac108.c +@@ -1124,7 +1124,7 @@ void ac108_aif_shutdown(struct snd_pcm_substream *substream, + } + } + +-int ac108_aif_mute(struct snd_soc_dai *dai, int mute, int direction) { ++int ac108_aif_mute(struct snd_soc_dai *dai, int mute) { + struct snd_soc_codec *codec = dai->codec; + struct ac10x_priv *ac10x = snd_soc_codec_get_drvdata(codec); + +@@ -1145,13 +1145,12 @@ static const struct snd_soc_dai_ops ac108_dai_ops = { + .hw_params = ac108_hw_params, + .prepare = ac108_prepare, + .trigger = ac108_trigger, +- .mute_stream = ac108_aif_mute, ++ .digital_mute = ac108_aif_mute, + + /*DAI format configuration*/ + .set_fmt = ac108_set_fmt, + + // .hw_free = ac108_hw_free, +- .no_capture_mute = 1, + }; + + static struct snd_soc_dai_driver ac108_dai0 = { +diff --git a/sound-compatible-4.18.h b/sound-compatible-4.18.h +index 080325b..faed848 100644 +--- a/sound-compatible-4.18.h ++++ b/sound-compatible-4.18.h +@@ -31,11 +31,7 @@ + #define snd_soc_codec_get_dapm snd_soc_component_get_dapm + #define snd_soc_codec_get_bias_level snd_soc_component_get_bias_level + #define snd_soc_kcontrol_codec snd_soc_kcontrol_component +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) +-#define snd_soc_read snd_soc_component_read +-#else + #define snd_soc_read snd_soc_component_read32 +-#endif + #define snd_soc_register_codec snd_soc_register_component + #define snd_soc_unregister_codec snd_soc_unregister_component + #define snd_soc_update_bits snd_soc_component_update_bits +diff --git a/wm8960.c b/wm8960.c +index 465c6dc..34d4dad 100644 +--- a/wm8960.c ++++ b/wm8960.c +@@ -796,7 +796,7 @@ static int wm8960_hw_free(struct snd_pcm_substream *substream, + return 0; + } + +-static int wm8960_mute(struct snd_soc_dai *dai, int mute, int direction) ++static int wm8960_mute(struct snd_soc_dai *dai, int mute) + { + struct snd_soc_codec *codec = dai->codec; + +@@ -1236,12 +1236,11 @@ static int wm8960_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, + static const struct snd_soc_dai_ops wm8960_dai_ops = { + .hw_params = wm8960_hw_params, + .hw_free = wm8960_hw_free, +- .mute_stream = wm8960_mute, ++ .digital_mute = wm8960_mute, + .set_fmt = wm8960_set_dai_fmt, + .set_clkdiv = wm8960_set_dai_clkdiv, + .set_pll = wm8960_set_dai_pll, + .set_sysclk = wm8960_set_dai_sysclk, +- .no_capture_mute = 1, + }; + + static struct snd_soc_dai_driver wm8960_dai = {