Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316281
b: refs/heads/master
c: da602ab
h: refs/heads/master
i:
  316279: f24633a
v: v3
  • Loading branch information
Benoît Thébaudeau authored and Mark Brown committed Jul 3, 2012
1 parent d15851f commit a1fa884
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c9acc91561221c30a530c9b84056609d0307c7c
refs/heads/master: da602ab8a10e47c59be1a7ce524aaa76b77c23b6
22 changes: 12 additions & 10 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2464,23 +2464,20 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
(struct soc_mixer_control *)kcontrol->private_value;
unsigned int reg = mc->reg;
unsigned int shift = mc->shift;
unsigned int rshift = mc->rshift;
int max = mc->max;
unsigned int invert = mc->invert;
unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert;

if (snd_soc_volsw_is_stereo(mc))
dev_warn(widget->dapm->dev,
"Control '%s' is stereo, which is not supported\n",
kcontrol->id.name);

ucontrol->value.integer.value[0] =
(snd_soc_read(widget->codec, reg) >> shift) & mask;
if (shift != rshift)
ucontrol->value.integer.value[1] =
(snd_soc_read(widget->codec, reg) >> rshift) & mask;
if (invert) {
if (invert)
ucontrol->value.integer.value[0] =
max - ucontrol->value.integer.value[0];
if (shift != rshift)
ucontrol->value.integer.value[1] =
max - ucontrol->value.integer.value[1];
}

return 0;
}
Expand Down Expand Up @@ -2514,6 +2511,11 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_update update;
int wi;

if (snd_soc_volsw_is_stereo(mc))
dev_warn(widget->dapm->dev,
"Control '%s' is stereo, which is not supported\n",
kcontrol->id.name);

val = (ucontrol->value.integer.value[0] & mask);
connect = !!val;

Expand Down

0 comments on commit a1fa884

Please sign in to comment.