diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-03 08:43:35 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-03 08:43:35 -0800 |
| commit | bbfa187279d30a9d2e644a6ff765d26845116d9e (patch) | |
| tree | 3d7c31339bdd5ad787c10e7e08aa5e929b93ae7f | |
| parent | 8d0f36c59c0b0c7f3df2ec788279039db5c0c942 (diff) | |
| parent | ba9ce1c9fb43145632edb5f027d96f9a1866b1cc (diff) | |
Merge "ASoC: msm: Register common sound controls"
| -rw-r--r-- | sound/soc/msm/sdm660-common.c | 11 | ||||
| -rw-r--r-- | sound/soc/msm/sdm660-common.h | 1 | ||||
| -rw-r--r-- | sound/soc/msm/sdm660-external.c | 8 | ||||
| -rw-r--r-- | sound/soc/msm/sdm660-internal.c | 14 |
4 files changed, 33 insertions, 1 deletions
diff --git a/sound/soc/msm/sdm660-common.c b/sound/soc/msm/sdm660-common.c index ee3cf62ee2c2..1497ddcca61f 100644 --- a/sound/soc/msm/sdm660-common.c +++ b/sound/soc/msm/sdm660-common.c @@ -1683,6 +1683,17 @@ const struct snd_kcontrol_new msm_common_snd_controls[] = { tdm_tx_ch_put), }; +/** + * msm_common_snd_controls_size - to return controls size + * + * Return: returns size of common controls array + */ +int msm_common_snd_controls_size(void) +{ + return ARRAY_SIZE(msm_common_snd_controls); +} +EXPORT_SYMBOL(msm_common_snd_controls_size); + static inline int param_is_mask(int p) { return (p >= SNDRV_PCM_HW_PARAM_FIRST_MASK) && diff --git a/sound/soc/msm/sdm660-common.h b/sound/soc/msm/sdm660-common.h index aa760ba71de2..36c2d9b7ca4e 100644 --- a/sound/soc/msm/sdm660-common.h +++ b/sound/soc/msm/sdm660-common.h @@ -113,4 +113,5 @@ int msm_aux_pcm_snd_startup(struct snd_pcm_substream *substream); void msm_aux_pcm_snd_shutdown(struct snd_pcm_substream *substream); int msm_mi2s_snd_startup(struct snd_pcm_substream *substream); void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream); +int msm_common_snd_controls_size(void); #endif diff --git a/sound/soc/msm/sdm660-external.c b/sound/soc/msm/sdm660-external.c index a741499b2a73..c900ce1a0fe9 100644 --- a/sound/soc/msm/sdm660-external.c +++ b/sound/soc/msm/sdm660-external.c @@ -1530,6 +1530,14 @@ int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) return ret; } + ret = snd_soc_add_codec_controls(codec, msm_common_snd_controls, + msm_common_snd_controls_size()); + if (ret < 0) { + pr_err("%s: add_common_snd_controls failed: %d\n", + __func__, ret); + return ret; + } + snd_soc_dapm_new_controls(dapm, msm_dapm_widgets, ARRAY_SIZE(msm_dapm_widgets)); diff --git a/sound/soc/msm/sdm660-internal.c b/sound/soc/msm/sdm660-internal.c index 4ecf6c996e69..5d3ec356343e 100644 --- a/sound/soc/msm/sdm660-internal.c +++ b/sound/soc/msm/sdm660-internal.c @@ -1300,8 +1300,20 @@ static int msm_audrx_init(struct snd_soc_pcm_runtime *rtd) pr_debug("%s(),dev_name%s\n", __func__, dev_name(cpu_dai->dev)); - snd_soc_add_codec_controls(ana_cdc, msm_snd_controls, + ret = snd_soc_add_codec_controls(ana_cdc, msm_snd_controls, ARRAY_SIZE(msm_snd_controls)); + if (ret < 0) { + pr_err("%s: add_codec_controls failed: %d\n", + __func__, ret); + return ret; + } + ret = snd_soc_add_codec_controls(ana_cdc, msm_common_snd_controls, + msm_common_snd_controls_size()); + if (ret < 0) { + pr_err("%s: add common snd controls failed: %d\n", + __func__, ret); + return ret; + } snd_soc_dapm_new_controls(dapm, msm_int_dapm_widgets, ARRAY_SIZE(msm_int_dapm_widgets)); |
