aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-06-18 10:00:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:04 -0400
commit66cb6957d338383157d4fdafef7c85e488e9e535 (patch)
treed00a295053113c2b2abb001759f779910aad98b2 /drivers/media/video/em28xx
parent71d7d83edc5129509a2cba1cf9848579cf9619e5 (diff)
[media] em28xx-audio: add debug info for the volume control
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.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 302553a7f83f..56739a462169 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -464,6 +464,13 @@ static int em28xx_vol_put(struct snd_kcontrol *kcontrol,
464 val |= rc & 0x8000; /* Preserve the mute flag */ 464 val |= rc & 0x8000; /* Preserve the mute flag */
465 465
466 rc = em28xx_write_ac97(dev, kcontrol->private_value, val); 466 rc = em28xx_write_ac97(dev, kcontrol->private_value, val);
467 if (rc < 0)
468 goto err;
469
470 dprintk("%sleft vol %d, right vol %d (0x%04x) to ac97 volume control 0x%04x\n",
471 (val & 0x8000) ? "muted " : "",
472 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
473 val, (int)kcontrol->private_value);
467 474
468err: 475err:
469 mutex_unlock(&dev->lock); 476 mutex_unlock(&dev->lock);
@@ -482,6 +489,11 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol,
482 if (val < 0) 489 if (val < 0)
483 return val; 490 return val;
484 491
492 dprintk("%sleft vol %d, right vol %d (0x%04x) from ac97 volume control 0x%04x\n",
493 (val & 0x8000) ? "muted " : "",
494 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
495 val, (int)kcontrol->private_value);
496
485 value->value.integer.value[0] = 0x1f - (val & 0x1f); 497 value->value.integer.value[0] = 0x1f - (val & 0x1f);
486 value->value.integer.value[1] = 0x1f - ((val << 8) & 0x1f); 498 value->value.integer.value[1] = 0x1f - ((val << 8) & 0x1f);
487 499
@@ -506,6 +518,13 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol,
506 rc |= 0x8000; 518 rc |= 0x8000;
507 519
508 rc = em28xx_write_ac97(dev, kcontrol->private_value, rc); 520 rc = em28xx_write_ac97(dev, kcontrol->private_value, rc);
521 if (rc < 0)
522 goto err;
523
524 dprintk("%sleft vol %d, right vol %d (0x%04x) to ac97 volume control 0x%04x\n",
525 (val & 0x8000) ? "muted " : "",
526 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
527 val, (int)kcontrol->private_value);
509 528
510err: 529err:
511 mutex_unlock(&dev->lock); 530 mutex_unlock(&dev->lock);
@@ -529,6 +548,11 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol,
529 else 548 else
530 value->value.integer.value[0] = 1; 549 value->value.integer.value[0] = 1;
531 550
551 dprintk("%sleft vol %d, right vol %d (0x%04x) from ac97 volume control 0x%04x\n",
552 (val & 0x8000) ? "muted " : "",
553 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
554 val, (int)kcontrol->private_value);
555
532 return 0; 556 return 0;
533} 557}
534 558
@@ -556,6 +580,8 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
556 err = snd_ctl_add(card, kctl); 580 err = snd_ctl_add(card, kctl);
557 if (err < 0) 581 if (err < 0)
558 return err; 582 return err;
583 dprintk("Added control %s for ac97 volume control 0x%04x\n",
584 ctl_name, id);
559 585
560 memset (&tmp, 0, sizeof(tmp)); 586 memset (&tmp, 0, sizeof(tmp));
561 tmp.iface = SNDRV_CTL_ELEM_IFACE_MIXER, 587 tmp.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -572,6 +598,8 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
572 err = snd_ctl_add(card, kctl); 598 err = snd_ctl_add(card, kctl);
573 if (err < 0) 599 if (err < 0)
574 return err; 600 return err;
601 dprintk("Added control %s for ac97 volume control 0x%04x\n",
602 ctl_name, id);
575 603
576 return 0; 604 return 0;
577} 605}