diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-06-19 18:14:07 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 22:53:03 +0200 |
commit | 71d7d83edc5129509a2cba1cf9848579cf9619e5 (patch) | |
tree | 9704421b5d80492febbc424ae500f27c23bcdb71 /drivers/media/video/em28xx/em28xx-audio.c | |
parent | [media] em28xx-audio: add support for mute controls (diff) | |
download | linux-71d7d83edc5129509a2cba1cf9848579cf9619e5.tar.xz linux-71d7d83edc5129509a2cba1cf9848579cf9619e5.zip |
[media] em28xx-audio: volumes are inverted
While here, fix volume mask to 5 bits
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index c7b96b46d346..302553a7f83f 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -452,8 +452,8 @@ static int em28xx_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *value) { struct em28xx *dev = snd_kcontrol_chip(kcontrol); - u16 val = (value->value.integer.value[0] & 0x1f) | - (value->value.integer.value[1] & 0x1f) << 8; + u16 val = (0x1f - (value->value.integer.value[0] & 0x1f)) | + (0x1f - (value->value.integer.value[1] & 0x1f)) << 8; int rc; mutex_lock(&dev->lock); @@ -482,8 +482,8 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol, if (val < 0) return val; - value->value.integer.value[0] = val & 0x1f; - value->value.integer.value[1] = (val << 8) & 0x1f; + value->value.integer.value[0] = 0x1f - (val & 0x1f); + value->value.integer.value[1] = 0x1f - ((val << 8) & 0x1f); return 0; } @@ -501,9 +501,9 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol, goto err; if (val) - rc |= 0x8000; + rc &= 0x1f1f; else - rc &= 0x7f7f; + rc |= 0x8000; rc = em28xx_write_ac97(dev, kcontrol->private_value, rc); @@ -525,9 +525,9 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol, return val; if (val & 0x8000) - value->value.integer.value[0] = 1; - else value->value.integer.value[0] = 0; + else + value->value.integer.value[0] = 1; return 0; } |