Commit 19a2557b authored by Jeeja KP's avatar Jeeja KP Committed by Mark Brown

ASoC: dapm: Add kcontrol support for PGAs

For DSPs we can define processing blocks as DAPM PGA widgets.
Some of these proceesing blocks can be configured by usermode
like EQ etc. So we need to add support of kcontrol for PGA
widgets.
Signed-off-by: default avatarJeeja KP <jeeja.kp@intel.com>
Signed-off-by: default avatarMythri P K <mythri.p.k@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6ff33f39
...@@ -779,7 +779,7 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, ...@@ -779,7 +779,7 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm,
* Determine if a kcontrol is shared. If it is, look it up. If it isn't, * Determine if a kcontrol is shared. If it is, look it up. If it isn't,
* create it. Either way, add the widget into the control's widget list * create it. Either way, add the widget into the control's widget list
*/ */
static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
int kci) int kci)
{ {
struct snd_soc_dapm_context *dapm = w->dapm; struct snd_soc_dapm_context *dapm = w->dapm;
...@@ -810,6 +810,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, ...@@ -810,6 +810,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
switch (w->id) { switch (w->id) {
case snd_soc_dapm_switch: case snd_soc_dapm_switch:
case snd_soc_dapm_mixer: case snd_soc_dapm_mixer:
case snd_soc_dapm_pga:
wname_in_long_name = true; wname_in_long_name = true;
kcname_in_long_name = true; kcname_in_long_name = true;
break; break;
...@@ -899,7 +900,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w) ...@@ -899,7 +900,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
continue; continue;
if (!w->kcontrols[i]) { if (!w->kcontrols[i]) {
ret = dapm_create_or_share_mixmux_kcontrol(w, i); ret = dapm_create_or_share_kcontrol(w, i);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
...@@ -952,7 +953,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w) ...@@ -952,7 +953,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
return -EINVAL; return -EINVAL;
} }
ret = dapm_create_or_share_mixmux_kcontrol(w, 0); ret = dapm_create_or_share_kcontrol(w, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -967,9 +968,13 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w) ...@@ -967,9 +968,13 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
/* create new dapm volume control */ /* create new dapm volume control */
static int dapm_new_pga(struct snd_soc_dapm_widget *w) static int dapm_new_pga(struct snd_soc_dapm_widget *w)
{ {
if (w->num_kcontrols) int i, ret;
dev_err(w->dapm->dev,
"ASoC: PGA controls not supported: '%s'\n", w->name); for (i = 0; i < w->num_kcontrols; i++) {
ret = dapm_create_or_share_kcontrol(w, i);
if (ret < 0)
return ret;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment