From 840bc44849b9d7f8eaae34ac7b434e17c4cf7368 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 20 Sep 2017 06:08:42 +0000 Subject: [PATCH 1/2] ASoC: add missing snd_soc_component_set_jack commit 44c07365e9e2 ("ASoC: add Component level set_jack") added new snd_soc_component_set_jack(), but it didn't add definition on soc.h. This patch adds it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sound/soc.h b/include/sound/soc.h index d22de9712c45..996bdbc125a5 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1487,6 +1487,8 @@ int snd_soc_component_set_sysclk(struct snd_soc_component *component, int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, int source, unsigned int freq_in, unsigned int freq_out); +int snd_soc_component_set_jack(struct snd_soc_component *component, + struct snd_soc_jack *jack, void *data); #ifdef CONFIG_REGMAP From e0dac41b8c21d41534b04d520c1927c2b0ac9b5e Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 2 Oct 2017 05:10:17 +0000 Subject: [PATCH 2/2] ASoC: soc-core: add snd_soc_add_component() ALSA SoC platform/codec will be replaced to component soon. But, some function exist in "platform" doesn't exist in "component". Current soc-core has snd_soc_register_component(), but doesn't have snd_soc_add_component() like snd_soc_add_platform(). This patch adds it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 5 +++++ sound/soc/soc-core.c | 34 +++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 996bdbc125a5..580da1e4f141 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -468,6 +468,11 @@ int snd_soc_register_codec(struct device *dev, const struct snd_soc_codec_driver *codec_drv, struct snd_soc_dai_driver *dai_drv, int num_dai); void snd_soc_unregister_codec(struct device *dev); +int snd_soc_add_component(struct device *dev, + struct snd_soc_component *component, + const struct snd_soc_component_driver *component_driver, + struct snd_soc_dai_driver *dai_drv, + int num_dai); int snd_soc_register_component(struct device *dev, const struct snd_soc_component_driver *component_driver, struct snd_soc_dai_driver *dai_drv, int num_dai); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index fee4b0ef5566..3a1c3b44de5e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3371,20 +3371,14 @@ static void snd_soc_component_del_unlocked(struct snd_soc_component *component) list_del(&component->list); } -int snd_soc_register_component(struct device *dev, - const struct snd_soc_component_driver *component_driver, - struct snd_soc_dai_driver *dai_drv, - int num_dai) +int snd_soc_add_component(struct device *dev, + struct snd_soc_component *component, + const struct snd_soc_component_driver *component_driver, + struct snd_soc_dai_driver *dai_drv, + int num_dai) { - struct snd_soc_component *component; int ret; - component = kzalloc(sizeof(*component), GFP_KERNEL); - if (!component) { - dev_err(dev, "ASoC: Failed to allocate memory\n"); - return -ENOMEM; - } - ret = snd_soc_component_initialize(component, component_driver, dev); if (ret) goto err_free; @@ -3408,6 +3402,24 @@ err_free: kfree(component); return ret; } +EXPORT_SYMBOL_GPL(snd_soc_add_component); + +int snd_soc_register_component(struct device *dev, + const struct snd_soc_component_driver *component_driver, + struct snd_soc_dai_driver *dai_drv, + int num_dai) +{ + struct snd_soc_component *component; + + component = kzalloc(sizeof(*component), GFP_KERNEL); + if (!component) { + dev_err(dev, "ASoC: Failed to allocate memory\n"); + return -ENOMEM; + } + + return snd_soc_add_component(dev, component, component_driver, + dai_drv, num_dai); +} EXPORT_SYMBOL_GPL(snd_soc_register_component); /**