aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>2007-10-26 17:21:30 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 19:00:59 -0200
commit40c6e683a238c561db00c4fdfead43cb3b19d75f (patch)
treefbdd4c62e304758ce72eece8e25dcc583444acb8 /drivers/media/video/bt8xx/bttv-driver.c
parentde5bec6bb57e88db7efa49c6f7de0794ae67d06a (diff)
V4L/DVB (6415): Restructurize volume hook and drop unused mute hook
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 28b3a3efb84..13221da6e40 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1434,23 +1434,13 @@ static void bttv_reinit_bt848(struct bttv *btv)
static int get_control(struct bttv *btv, struct v4l2_control *c)
{
- int i;
-
- for (i = 0; i < BTTV_CTLS; i++)
- if (bttv_ctls[i].id == c->id)
- break;
- if (i == BTTV_CTLS)
- return -EINVAL;
#ifdef CONFIG_VIDEO_V4L1
- if (btv->audio_hook && i >= 4 && i <= 8) {
+ if (btv->audio_hook && (c->id == V4L2_CID_AUDIO_VOLUME)) {
struct video_audio va;
memset(&va,0,sizeof(va));
btv->audio_hook(btv,&va,0);
switch (c->id) {
- case V4L2_CID_AUDIO_MUTE:
- c->value = (VIDEO_AUDIO_MUTE & va.flags) ? 1 : 0;
- break;
case V4L2_CID_AUDIO_VOLUME:
c->value = va.volume;
break;
@@ -1521,30 +1511,15 @@ static int get_control(struct bttv *btv, struct v4l2_control *c)
static int set_control(struct bttv *btv, struct v4l2_control *c)
{
- int i,val;
+ int val;
- for (i = 0; i < BTTV_CTLS; i++)
- if (bttv_ctls[i].id == c->id)
- break;
- if (i == BTTV_CTLS)
- return -EINVAL;
#ifdef CONFIG_VIDEO_V4L1
- if (btv->audio_hook && i >= 4 && i <= 8) {
+ if (btv->audio_hook && (c->id == V4L2_CID_AUDIO_VOLUME)) {
struct video_audio va;
memset(&va,0,sizeof(va));
btv->audio_hook(btv,&va,0);
switch (c->id) {
- case V4L2_CID_AUDIO_MUTE:
- if (c->value) {
- va.flags |= VIDEO_AUDIO_MUTE;
- audio_mute(btv, 1);
- } else {
- va.flags &= ~VIDEO_AUDIO_MUTE;
- audio_mute(btv, 0);
- }
- break;
-
case V4L2_CID_AUDIO_VOLUME:
va.volume = c->value;
break;