From af484de3af24344ca2d56052e0ca8ae888af5c79 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Mon, 19 Apr 2021 11:26:10 +0100 Subject: [PATCH] v4.17: replace codec to component https://www.alsa-project.org/pipermail/alsa-devel/2018-January/thread.html#131069 https://www.alsa-project.org/pipermail/alsa-devel/2018-January/131070.html [alsa-devel] [PATCH v2 00/39] ASoC: replace platform/codec component Kuninori Morimoto https://www.alsa-project.org/pipermail/alsa-devel/2018-January/131111.html [alsa-devel] [PATCH v2 000/186] ASoC: replace codec component Kuninori Morimoto --- ac108.c | 6 ++++++ patches/back-to-v4.19.diff | 2 +- patches/back-to-v5.4.diff | 2 +- patches/back-to-v5.8.diff | 2 +- sound-compatible-4.18.h | 4 ++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ac108.c b/ac108.c index 97a438a..6d51833 100644 --- a/ac108.c +++ b/ac108.c @@ -1323,6 +1323,12 @@ static struct snd_soc_codec_driver ac10x_soc_codec_driver = { .set_bias_level = ac108_set_bias_level, .read = ac108_codec_read, .write = ac108_codec_write, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0) + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, +#endif }; static ssize_t ac108_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { diff --git a/patches/back-to-v4.19.diff b/patches/back-to-v4.19.diff index 4ee79f6..74426de 100644 --- a/patches/back-to-v4.19.diff +++ b/patches/back-to-v4.19.diff @@ -508,7 +508,7 @@ index 080325b..eefa7de 100644 -#else #define snd_soc_read snd_soc_component_read32 -#endif - #define snd_soc_register_codec snd_soc_register_component + #define snd_soc_register_codec devm_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 diff --git a/patches/back-to-v5.4.diff b/patches/back-to-v5.4.diff index 6596d4c..6322382 100644 --- a/patches/back-to-v5.4.diff +++ b/patches/back-to-v5.4.diff @@ -204,7 +204,7 @@ index 080325b..eefa7de 100644 -#else #define snd_soc_read snd_soc_component_read32 -#endif - #define snd_soc_register_codec snd_soc_register_component + #define snd_soc_register_codec devm_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 diff --git a/patches/back-to-v5.8.diff b/patches/back-to-v5.8.diff index 4b4b4d4..8abb836 100644 --- a/patches/back-to-v5.8.diff +++ b/patches/back-to-v5.8.diff @@ -39,7 +39,7 @@ index 080325b..faed848 100644 -#else #define snd_soc_read snd_soc_component_read32 -#endif - #define snd_soc_register_codec snd_soc_register_component + #define snd_soc_register_codec devm_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 diff --git a/sound-compatible-4.18.h b/sound-compatible-4.18.h index 080325b..550b3a7 100644 --- a/sound-compatible-4.18.h +++ b/sound-compatible-4.18.h @@ -9,7 +9,7 @@ #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0) #define __NO_SND_SOC_CODEC_DRV 1 #else #define __NO_SND_SOC_CODEC_DRV 0 @@ -36,7 +36,7 @@ #else #define snd_soc_read snd_soc_component_read32 #endif -#define snd_soc_register_codec snd_soc_register_component +#define snd_soc_register_codec devm_snd_soc_register_component #define snd_soc_unregister_codec snd_soc_unregister_component #define snd_soc_update_bits snd_soc_component_update_bits #define snd_soc_write snd_soc_component_write