From: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
alsa-devel@alsa-project.org
Subject: [PATCH 07/11] [media] em28xx-audio: add debug info for the volume control
Date: Sun, 19 Jun 2011 14:42:38 -0300 [thread overview]
Message-ID: <20110619144238.213f02d5@pedra> (raw)
In-Reply-To: <cover.1308503857.git.mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 302553a..56739a4 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,
val |= rc & 0x8000; /* Preserve the mute flag */
rc = em28xx_write_ac97(dev, kcontrol->private_value, val);
+ if (rc < 0)
+ goto err;
+
+ dprintk("%sleft vol %d, right vol %d (0x%04x) to ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
err:
mutex_unlock(&dev->lock);
@@ -482,6 +489,11 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol,
if (val < 0)
return val;
+ dprintk("%sleft vol %d, right vol %d (0x%04x) from ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
+
value->value.integer.value[0] = 0x1f - (val & 0x1f);
value->value.integer.value[1] = 0x1f - ((val << 8) & 0x1f);
@@ -506,6 +518,13 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol,
rc |= 0x8000;
rc = em28xx_write_ac97(dev, kcontrol->private_value, rc);
+ if (rc < 0)
+ goto err;
+
+ dprintk("%sleft vol %d, right vol %d (0x%04x) to ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
err:
mutex_unlock(&dev->lock);
@@ -529,6 +548,11 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol,
else
value->value.integer.value[0] = 1;
+ dprintk("%sleft vol %d, right vol %d (0x%04x) from ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
+
return 0;
}
@@ -556,6 +580,8 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
err = snd_ctl_add(card, kctl);
if (err < 0)
return err;
+ dprintk("Added control %s for ac97 volume control 0x%04x\n",
+ ctl_name, id);
memset (&tmp, 0, sizeof(tmp));
tmp.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -572,6 +598,8 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
err = snd_ctl_add(card, kctl);
if (err < 0)
return err;
+ dprintk("Added control %s for ac97 volume control 0x%04x\n",
+ ctl_name, id);
return 0;
}
--
1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: unlisted-recipients:; (no To-header on input)@casper.infradead.org
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
alsa-devel@alsa-project.org
Subject: [PATCH 07/11] [media] em28xx-audio: add debug info for the volume control
Date: Sun, 19 Jun 2011 14:42:38 -0300 [thread overview]
Message-ID: <20110619144238.213f02d5@pedra> (raw)
In-Reply-To: <cover.1308503857.git.mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 302553a..56739a4 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,
val |= rc & 0x8000; /* Preserve the mute flag */
rc = em28xx_write_ac97(dev, kcontrol->private_value, val);
+ if (rc < 0)
+ goto err;
+
+ dprintk("%sleft vol %d, right vol %d (0x%04x) to ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
err:
mutex_unlock(&dev->lock);
@@ -482,6 +489,11 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol,
if (val < 0)
return val;
+ dprintk("%sleft vol %d, right vol %d (0x%04x) from ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
+
value->value.integer.value[0] = 0x1f - (val & 0x1f);
value->value.integer.value[1] = 0x1f - ((val << 8) & 0x1f);
@@ -506,6 +518,13 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol,
rc |= 0x8000;
rc = em28xx_write_ac97(dev, kcontrol->private_value, rc);
+ if (rc < 0)
+ goto err;
+
+ dprintk("%sleft vol %d, right vol %d (0x%04x) to ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
err:
mutex_unlock(&dev->lock);
@@ -529,6 +548,11 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol,
else
value->value.integer.value[0] = 1;
+ dprintk("%sleft vol %d, right vol %d (0x%04x) from ac97 volume control 0x%04x\n",
+ (val & 0x8000) ? "muted " : "",
+ 0x1f - ((val >> 8) & 0x1f), 0x1f - (val & 0x1f),
+ val, (int)kcontrol->private_value);
+
return 0;
}
@@ -556,6 +580,8 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
err = snd_ctl_add(card, kctl);
if (err < 0)
return err;
+ dprintk("Added control %s for ac97 volume control 0x%04x\n",
+ ctl_name, id);
memset (&tmp, 0, sizeof(tmp));
tmp.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -572,6 +598,8 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
err = snd_ctl_add(card, kctl);
if (err < 0)
return err;
+ dprintk("Added control %s for ac97 volume control 0x%04x\n",
+ ctl_name, id);
return 0;
}
--
1.7.1
next prev parent reply other threads:[~2011-06-19 17:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1308503857.git.mchehab@redhat.com>
2011-06-19 17:42 ` [PATCH 10/11] [media] em28xx: Add support for devices with a separate audio interface Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 01/11] [media] em28xx: Don't initialize a var if won't be using it Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 11/11] [media] em28xx: Mark Kworld 305 as validated Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 02/11] [media] em28xx: Fix a wrong enum at the ac97 control tables Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 03/11] [media] em28xx: Allow to compile it without RC/input support Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab [this message]
2011-06-19 17:42 ` [PATCH 07/11] [media] em28xx-audio: add debug info for the volume control Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 08/11] [media] em28xx-audio: Properly report failures to start stream Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 04/11] [media] em28xx-alsa: add mixer support for AC97 volume controls Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 05/11] [media] em28xx-audio: add support for mute controls Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 06/11] [media] em28xx-audio: volumes are inverted Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab
2011-06-19 17:42 ` [PATCH 09/11] [media] em28xx-audio: Some Alsa API fixes Mauro Carvalho Chehab
2011-06-19 17:42 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110619144238.213f02d5@pedra \
--to=mchehab@redhat.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.