summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-09-12 21:29:45 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-12 21:29:45 -0700
commit643a59d98bbc3c0685421162926400a36e5c4db2 (patch)
tree87d852c929d0021acb46c2a5f13df2b1e34cc6eb
parentbff6b51c07f86b33da4c4f82fa44a426ad6a4242 (diff)
parentf2cfc3849c9bff35b0d4ca95c0a5c97c9c2cdb2a (diff)
Merge "ASoC: wcd9335: Fix kctl_put and get functionality for SLIM RXX MUX"
-rw-r--r--sound/soc/codecs/wcd9335.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 158b9ae08642..b5126351dda0 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -793,7 +793,7 @@ struct tasha_priv {
struct wcd_swr_ctrl_platform_data swr_plat_data;
/* Port values for Rx and Tx codec_dai */
- unsigned int rx_port_value;
+ unsigned int rx_port_value[TASHA_RX_MAX];
unsigned int tx_port_value;
unsigned int vi_feed_value;
@@ -2597,7 +2597,8 @@ static int slim_rx_mux_get(struct snd_kcontrol *kcontrol,
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(widget->dapm);
struct tasha_priv *tasha_p = snd_soc_codec_get_drvdata(codec);
- ucontrol->value.enumerated.item[0] = tasha_p->rx_port_value;
+ ucontrol->value.enumerated.item[0] =
+ tasha_p->rx_port_value[widget->shift];
return 0;
}
@@ -2616,25 +2617,27 @@ static int slim_rx_mux_put(struct snd_kcontrol *kcontrol,
struct wcd9xxx *core = dev_get_drvdata(codec->dev->parent);
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
struct snd_soc_dapm_update *update = NULL;
+ unsigned int rx_port_value;
u32 port_id = widget->shift;
+ tasha_p->rx_port_value[port_id] = ucontrol->value.enumerated.item[0];
+ rx_port_value = tasha_p->rx_port_value[port_id];
+
pr_debug("%s: wname %s cname %s value %u shift %d item %ld\n", __func__,
- widget->name, ucontrol->id.name, tasha_p->rx_port_value,
+ widget->name, ucontrol->id.name, rx_port_value,
widget->shift, ucontrol->value.integer.value[0]);
- tasha_p->rx_port_value = ucontrol->value.enumerated.item[0];
-
mutex_lock(&tasha_p->codec_mutex);
if (tasha_p->intf_type != WCD9XXX_INTERFACE_TYPE_SLIMBUS) {
- if (tasha_p->rx_port_value > 2) {
+ if (rx_port_value > 2) {
dev_err(codec->dev, "%s: invalid AIF for I2C mode\n",
__func__);
goto err;
}
}
/* value need to match the Virtual port and AIF number */
- switch (tasha_p->rx_port_value) {
+ switch (rx_port_value) {
case 0:
list_del_init(&core->rx_chs[port_id].list);
break;
@@ -2694,13 +2697,13 @@ static int slim_rx_mux_put(struct snd_kcontrol *kcontrol,
&tasha_p->dai[AIF_MIX1_PB].wcd9xxx_ch_list);
break;
default:
- pr_err("Unknown AIF %d\n", tasha_p->rx_port_value);
+ pr_err("Unknown AIF %d\n", rx_port_value);
goto err;
}
rtn:
mutex_unlock(&tasha_p->codec_mutex);
snd_soc_dapm_mux_update_power(widget->dapm, kcontrol,
- tasha_p->rx_port_value, e, update);
+ rx_port_value, e, update);
return 0;
err: