ASoC: msm: Register common sound controls
Add logic to register common sound controls to ALSA SoC in both internal and external codec machine drivers. CRs-Fixed: 1106498 Change-Id: If5e210fb1f4a5684da4dab7ef567a588e0166d83 Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
parent
bc6d0c8cdd
commit
ba9ce1c9fb
4 changed files with 33 additions and 1 deletions
|
@ -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) &&
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue