Loading sound/soc/codecs/tlv320aic3x.c +16 −33 Original line number Diff line number Diff line Loading @@ -147,10 +147,9 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, int max = mc->max; unsigned int mask = (1 << fls(max)) - 1; unsigned int invert = mc->invert; unsigned short val, val_mask; int ret; struct snd_soc_dapm_path *path; int found = 0; unsigned short val; struct snd_soc_dapm_update update; int connect, change; val = (ucontrol->value.integer.value[0] & mask); Loading @@ -158,42 +157,26 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, if (val) val = mask; connect = !!val; if (invert) val = mask - val; val_mask = mask << shift; val = val << shift; mutex_lock(&widget->codec->mutex); if (snd_soc_test_bits(widget->codec, reg, val_mask, val)) { /* find dapm widget path assoc with kcontrol */ list_for_each_entry(path, &widget->dapm->card->paths, list) { if (path->kcontrol != kcontrol) continue; /* found, now check type */ found = 1; if (val) /* new connection */ path->connect = invert ? 0 : 1; else /* old connection must be powered down */ path->connect = invert ? 1 : 0; mask <<= shift; val <<= shift; dapm_mark_dirty(path->source, "tlv320aic3x source"); dapm_mark_dirty(path->sink, "tlv320aic3x sink"); change = snd_soc_test_bits(widget->codec, val, mask, reg); if (change) { update.kcontrol = kcontrol; update.reg = reg; update.mask = mask; update.val = val; break; } snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, connect, &update); } mutex_unlock(&widget->codec->mutex); if (found) snd_soc_dapm_sync(widget->dapm); ret = snd_soc_update_bits_locked(widget->codec, reg, val_mask, val); return ret; return change; } /* Loading Loading
sound/soc/codecs/tlv320aic3x.c +16 −33 Original line number Diff line number Diff line Loading @@ -147,10 +147,9 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, int max = mc->max; unsigned int mask = (1 << fls(max)) - 1; unsigned int invert = mc->invert; unsigned short val, val_mask; int ret; struct snd_soc_dapm_path *path; int found = 0; unsigned short val; struct snd_soc_dapm_update update; int connect, change; val = (ucontrol->value.integer.value[0] & mask); Loading @@ -158,42 +157,26 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, if (val) val = mask; connect = !!val; if (invert) val = mask - val; val_mask = mask << shift; val = val << shift; mutex_lock(&widget->codec->mutex); if (snd_soc_test_bits(widget->codec, reg, val_mask, val)) { /* find dapm widget path assoc with kcontrol */ list_for_each_entry(path, &widget->dapm->card->paths, list) { if (path->kcontrol != kcontrol) continue; /* found, now check type */ found = 1; if (val) /* new connection */ path->connect = invert ? 0 : 1; else /* old connection must be powered down */ path->connect = invert ? 1 : 0; mask <<= shift; val <<= shift; dapm_mark_dirty(path->source, "tlv320aic3x source"); dapm_mark_dirty(path->sink, "tlv320aic3x sink"); change = snd_soc_test_bits(widget->codec, val, mask, reg); if (change) { update.kcontrol = kcontrol; update.reg = reg; update.mask = mask; update.val = val; break; } snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, connect, &update); } mutex_unlock(&widget->codec->mutex); if (found) snd_soc_dapm_sync(widget->dapm); ret = snd_soc_update_bits_locked(widget->codec, reg, val_mask, val); return ret; return change; } /* Loading