aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-06-19 12:14:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:03 -0400
commit71d7d83edc5129509a2cba1cf9848579cf9619e5 (patch)
tree9704421b5d80492febbc424ae500f27c23bcdb71 /drivers/media/video/em28xx
parent43131a2ca6afbd8dcc940d5ad4b4b1c3d89a658b (diff)
[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')
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c16
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,
452 struct snd_ctl_elem_value *value) 452 struct snd_ctl_elem_value *value)
453{ 453{
454 struct em28xx *dev = snd_kcontrol_chip(kcontrol); 454 struct em28xx *dev = snd_kcontrol_chip(kcontrol);
455 u16 val = (value->value.integer.value[0] & 0x1f) | 455 u16 val = (0x1f - (value->value.integer.value[0] & 0x1f)) |
456 (value->value.integer.value[1] & 0x1f) << 8; 456 (0x1f - (value->value.integer.value[1] & 0x1f)) << 8;
457 int rc; 457 int rc;
458 458
459 mutex_lock(&dev->lock); 459 mutex_lock(&dev->lock);
@@ -482,8 +482,8 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol,
482 if (val < 0) 482 if (val < 0)
483 return val; 483 return val;
484 484
485 value->value.integer.value[0] = val & 0x1f; 485 value->value.integer.value[0] = 0x1f - (val & 0x1f);
486 value->value.integer.value[1] = (val << 8) & 0x1f; 486 value->value.integer.value[1] = 0x1f - ((val << 8) & 0x1f);
487 487
488 return 0; 488 return 0;
489} 489}
@@ -501,9 +501,9 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol,
501 goto err; 501 goto err;
502 502
503 if (val) 503 if (val)
504 rc |= 0x8000; 504 rc &= 0x1f1f;
505 else 505 else
506 rc &= 0x7f7f; 506 rc |= 0x8000;
507 507
508 rc = em28xx_write_ac97(dev, kcontrol->private_value, rc); 508 rc = em28xx_write_ac97(dev, kcontrol->private_value, rc);
509 509
@@ -525,9 +525,9 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol,
525 return val; 525 return val;
526 526
527 if (val & 0x8000) 527 if (val & 0x8000)
528 value->value.integer.value[0] = 1;
529 else
530 value->value.integer.value[0] = 0; 528 value->value.integer.value[0] = 0;
529 else
530 value->value.integer.value[0] = 1;
531 531
532 return 0; 532 return 0;
533} 533}