[PATCH 0/7] ASoC: codecs: da7219: Do not export da7219_aad_jack_det()
Goal of the series is to drop any usage of the internal function.
First, update all users to utilize component->set_jack() and then remove the relevant EXPORT_SYMBOL_GPL.
Amadeusz Sławiński (2): ASoC: codecs: da7219: Introduce set_jack() callback ASoC: codecs: da7219: Do not export internal symbols
Cezary Rojewski (5): ASoC: Intel: Drop da7219_aad_jack_det() usage ASoC: mediatek: Drop da7219_aad_jack_det() usage ASoC: rockchip: Drop da7219_aad_jack_det() usage ASoC: amd: Drop da7219_aad_jack_det() usage ASoC: Intel: avs: Drop da7219_aad_jack_det() usage
sound/soc/amd/acp-da7219-max98357a.c | 3 +-- sound/soc/codecs/da7219-aad.c | 4 ---- sound/soc/codecs/da7219.c | 9 +++++++++ sound/soc/intel/avs/boards/da7219.c | 3 +-- sound/soc/intel/boards/bxt_da7219_max98357a.c | 3 +-- sound/soc/intel/boards/kbl_da7219_max98357a.c | 3 +-- sound/soc/intel/boards/kbl_da7219_max98927.c | 3 +-- sound/soc/intel/boards/sof_da7219_max98373.c | 4 ++-- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 3 +-- .../soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 4 ++-- sound/soc/rockchip/rk3399_gru_sound.c | 3 +-- 11 files changed, 20 insertions(+), 22 deletions(-)
From: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com
Codec driver for da7219 implements jack detect functionality, but does not integrate it with the framework. Platform component drivers are accessing the functionality through internal da7219_aad_jack_det() instead.
Address this by implementing set_jack() for the codec.
Signed-off-by: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/codecs/da7219.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 4746c8700451..7468ee4af2ea 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -2633,11 +2633,20 @@ static int da7219_resume(struct snd_soc_component *component) #define da7219_resume NULL #endif
+static int da7219_set_jack(struct snd_soc_component *component, struct snd_soc_jack *jack, + void *data) +{ + da7219_aad_jack_det(component, jack); + + return 0; +} + static const struct snd_soc_component_driver soc_component_dev_da7219 = { .probe = da7219_probe, .remove = da7219_remove, .suspend = da7219_suspend, .resume = da7219_resume, + .set_jack = da7219_set_jack, .set_bias_level = da7219_set_bias_level, .controls = da7219_snd_controls, .num_controls = ARRAY_SIZE(da7219_snd_controls),
Do not access the internal function directly, do so through component->set_jack() instead.
Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/intel/boards/bxt_da7219_max98357a.c | 3 +-- sound/soc/intel/boards/kbl_da7219_max98357a.c | 3 +-- sound/soc/intel/boards/kbl_da7219_max98927.c | 3 +-- sound/soc/intel/boards/sof_da7219_max98373.c | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 7c6c95e99ade..c593995facaa 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -19,7 +19,6 @@ #include <sound/soc-acpi.h> #include "../../codecs/hdac_hdmi.h" #include "../../codecs/da7219.h" -#include "../../codecs/da7219-aad.h" #include "../common/soc-intel-quirks.h" #include "hda_dsp_common.h"
@@ -259,7 +258,7 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(broxton_headset.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(component, &broxton_headset); + snd_soc_component_set_jack(component, &broxton_headset, NULL);
snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index 329457e3e3a2..18365ce6bcba 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -19,7 +19,6 @@ #include <sound/soc.h> #include "../../codecs/da7219.h" #include "../../codecs/hdac_hdmi.h" -#include "../../codecs/da7219-aad.h"
#define KBL_DIALOG_CODEC_DAI "da7219-hifi" #define KBL_MAXIM_CODEC_DAI "HiFi" @@ -207,7 +206,7 @@ static int kabylake_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); - da7219_aad_jack_det(component, &ctx->kabylake_headset); + snd_soc_component_set_jack(component, &ctx->kabylake_headset, NULL);
ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC"); if (ret) diff --git a/sound/soc/intel/boards/kbl_da7219_max98927.c b/sound/soc/intel/boards/kbl_da7219_max98927.c index 362579f25835..ad4223fee0c5 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98927.c +++ b/sound/soc/intel/boards/kbl_da7219_max98927.c @@ -19,7 +19,6 @@ #include <sound/soc.h> #include "../../codecs/da7219.h" #include "../../codecs/hdac_hdmi.h" -#include "../../codecs/da7219-aad.h"
#define KBL_DIALOG_CODEC_DAI "da7219-hifi" #define MAX98927_CODEC_DAI "max98927-aif1" @@ -382,7 +381,7 @@ static int kabylake_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(component, &ctx->kabylake_headset); + snd_soc_component_set_jack(component, &ctx->kabylake_headset, NULL);
return 0; } diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c index e048e789e633..740aa11cb019 100644 --- a/sound/soc/intel/boards/sof_da7219_max98373.c +++ b/sound/soc/intel/boards/sof_da7219_max98373.c @@ -7,13 +7,13 @@
#include <linux/input.h> #include <linux/module.h> +#include <sound/jack.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <linux/platform_device.h> #include <sound/soc.h> #include <sound/soc-acpi.h> #include "../../codecs/da7219.h" -#include "../../codecs/da7219-aad.h" #include "hda_dsp_common.h"
#define DIALOG_CODEC_DAI "da7219-hifi" @@ -184,7 +184,7 @@ static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); - da7219_aad_jack_det(component, jack); + snd_soc_component_set_jack(component, jack, NULL);
return ret; }
Do not access the internal function directly, do so through component->set_jack() instead.
Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 3 +-- sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index 9f22d3939818..97dbb31c412e 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -14,7 +14,6 @@ #include <sound/pcm_params.h> #include <sound/soc.h>
-#include "../../codecs/da7219-aad.h" #include "../../codecs/da7219.h" #include "../../codecs/rt1015.h" #include "../common/mtk-afe-platform-driver.h" @@ -592,7 +591,7 @@ mt8183_da7219_max98357_headset_init(struct snd_soc_component *component) snd_jack_set_key( priv->headset_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(component, &priv->headset_jack); + snd_soc_component_set_jack(component, &priv->headset_jack, NULL);
return 0; } diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c index cfca6bdee834..db5d2bec7a95 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.c @@ -11,10 +11,10 @@ #include <linux/module.h> #include <linux/of_device.h> #include <linux/pm_runtime.h> +#include <sound/jack.h> #include <sound/pcm_params.h> #include <sound/soc.h>
-#include "../../codecs/da7219-aad.h" #include "../../codecs/da7219.h" #include "../../codecs/mt6358.h" #include "../common/mtk-afe-platform-driver.h" @@ -100,7 +100,7 @@ static int mt8186_da7219_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(cmpnt_codec, &priv->headset_jack); + snd_soc_component_set_jack(cmpnt_codec, &priv->headset_jack, NULL);
return 0; }
Do not access the internal function directly, do so through component->set_jack() instead.
Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/rockchip/rk3399_gru_sound.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c index 2540b9ba37c8..5e52e9d60d44 100644 --- a/sound/soc/rockchip/rk3399_gru_sound.c +++ b/sound/soc/rockchip/rk3399_gru_sound.c @@ -21,7 +21,6 @@ #include <sound/soc.h> #include "rockchip_i2s.h" #include "../codecs/da7219.h" -#include "../codecs/da7219-aad.h" #include "../codecs/rt5514.h"
#define DRV_NAME "rk3399-gru-sound" @@ -226,7 +225,7 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key( rockchip_sound_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(component, &rockchip_sound_jack); + snd_soc_component_set_jack(component, &rockchip_sound_jack, NULL);
return 0; }
Do not access the internal function directly, do so through component->set_jack() instead.
Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/amd/acp-da7219-max98357a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index ef1b4cefc273..375417bd7d6e 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -21,7 +21,6 @@
#include "acp.h" #include "../codecs/da7219.h" -#include "../codecs/da7219-aad.h" #include "../codecs/rt5682.h"
#define CZ_PLAT_CLK 48000000 @@ -82,7 +81,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(component, &cz_jack); + snd_soc_component_set_jack(component, &cz_jack, NULL);
return 0; }
Do not access the internal function directly, do so through component->set_jack() instead.
Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/intel/avs/boards/da7219.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/intel/avs/boards/da7219.c b/sound/soc/intel/avs/boards/da7219.c index 503a967a1c3a..ad86cef101cc 100644 --- a/sound/soc/intel/avs/boards/da7219.c +++ b/sound/soc/intel/avs/boards/da7219.c @@ -16,7 +16,6 @@ #include <sound/soc-dapm.h> #include <uapi/linux/input-event-codes.h> #include "../../../codecs/da7219.h" -#include "../../../codecs/da7219-aad.h"
#define DA7219_DAI_NAME "da7219-hifi"
@@ -110,7 +109,7 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime) snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
- da7219_aad_jack_det(component, jack); + snd_soc_component_set_jack(component, jack, NULL);
return 0; }
From: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com
With all users utilizing component->set_jack(), there is no need to export da7219_aad_jack_det() function.
While at it, remove exports from all other functions as well.
Signed-off-by: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/soc/codecs/da7219-aad.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c index bba73c44c219..9bf8d73b4f58 100644 --- a/sound/soc/codecs/da7219-aad.c +++ b/sound/soc/codecs/da7219-aad.c @@ -43,7 +43,6 @@ void da7219_aad_jack_det(struct snd_soc_component *component, struct snd_soc_jac DA7219_ACCDET_EN_MASK, (jack ? DA7219_ACCDET_EN_MASK : 0)); } -EXPORT_SYMBOL_GPL(da7219_aad_jack_det);
/* * Button/HPTest work @@ -930,7 +929,6 @@ int da7219_aad_init(struct snd_soc_component *component)
return 0; } -EXPORT_SYMBOL_GPL(da7219_aad_init);
void da7219_aad_exit(struct snd_soc_component *component) { @@ -948,7 +946,6 @@ void da7219_aad_exit(struct snd_soc_component *component) cancel_work_sync(&da7219_aad->btn_det_work); cancel_work_sync(&da7219_aad->hptest_work); } -EXPORT_SYMBOL_GPL(da7219_aad_exit);
/* * AAD related I2C probe handling @@ -972,7 +969,6 @@ int da7219_aad_probe(struct i2c_client *i2c)
return 0; } -EXPORT_SYMBOL_GPL(da7219_aad_probe);
MODULE_DESCRIPTION("ASoC DA7219 AAD Driver"); MODULE_AUTHOR("Adam Thomson Adam.Thomson.Opensource@diasemi.com");
On Mon, 31 Oct 2022 17:02:20 +0100, Cezary Rojewski wrote:
Goal of the series is to drop any usage of the internal function.
First, update all users to utilize component->set_jack() and then remove the relevant EXPORT_SYMBOL_GPL.
Amadeusz Sławiński (2): ASoC: codecs: da7219: Introduce set_jack() callback ASoC: codecs: da7219: Do not export internal symbols
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/7] ASoC: codecs: da7219: Introduce set_jack() callback commit: 4366b7ca88f04237ae654846167db993dbe37397 [2/7] ASoC: Intel: Drop da7219_aad_jack_det() usage commit: 9a1fe79daddbdc57307bd7dd9a29ef06aa7b5f34 [3/7] ASoC: mediatek: Drop da7219_aad_jack_det() usage commit: 922a5e5a6389da46b51075301440d07e53c600ea [4/7] ASoC: rockchip: Drop da7219_aad_jack_det() usage commit: ebe62df7c50e63d11c7fdfbdff701583cd4f1f3a [5/7] ASoC: amd: Drop da7219_aad_jack_det() usage commit: ba54da32ec683692ed69ffbed5b4afb414def7d2 [6/7] ASoC: Intel: avs: Drop da7219_aad_jack_det() usage commit: 7af1ca5bb5e3c2e472a040f8b52382ccc57bb01a [7/7] ASoC: codecs: da7219: Do not export internal symbols commit: c05dff38d21556c532032f63330271b96265d448
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Cezary Rojewski
-
Mark Brown