diff options
author | Nickolay V. Shmyrev <nshmyrev@yandex.ru> | 2007-10-26 16:21:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:00:59 -0500 |
commit | 40c6e683a238c561db00c4fdfead43cb3b19d75f (patch) | |
tree | fbdd4c62e304758ce72eece8e25dcc583444acb8 /drivers/media/video/bt8xx/bttv-driver.c | |
parent | de5bec6bb57e88db7efa49c6f7de0794ae67d06a (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.c | 31 |
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 28b3a3efb84f..13221da6e40f 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) | |||
1434 | 1434 | ||
1435 | static int get_control(struct bttv *btv, struct v4l2_control *c) | 1435 | static int get_control(struct bttv *btv, struct v4l2_control *c) |
1436 | { | 1436 | { |
1437 | int i; | ||
1438 | |||
1439 | for (i = 0; i < BTTV_CTLS; i++) | ||
1440 | if (bttv_ctls[i].id == c->id) | ||
1441 | break; | ||
1442 | if (i == BTTV_CTLS) | ||
1443 | return -EINVAL; | ||
1444 | #ifdef CONFIG_VIDEO_V4L1 | 1437 | #ifdef CONFIG_VIDEO_V4L1 |
1445 | if (btv->audio_hook && i >= 4 && i <= 8) { | 1438 | if (btv->audio_hook && (c->id == V4L2_CID_AUDIO_VOLUME)) { |
1446 | struct video_audio va; | 1439 | struct video_audio va; |
1447 | 1440 | ||
1448 | memset(&va,0,sizeof(va)); | 1441 | memset(&va,0,sizeof(va)); |
1449 | btv->audio_hook(btv,&va,0); | 1442 | btv->audio_hook(btv,&va,0); |
1450 | switch (c->id) { | 1443 | switch (c->id) { |
1451 | case V4L2_CID_AUDIO_MUTE: | ||
1452 | c->value = (VIDEO_AUDIO_MUTE & va.flags) ? 1 : 0; | ||
1453 | break; | ||
1454 | case V4L2_CID_AUDIO_VOLUME: | 1444 | case V4L2_CID_AUDIO_VOLUME: |
1455 | c->value = va.volume; | 1445 | c->value = va.volume; |
1456 | break; | 1446 | break; |
@@ -1521,30 +1511,15 @@ static int get_control(struct bttv *btv, struct v4l2_control *c) | |||
1521 | 1511 | ||
1522 | static int set_control(struct bttv *btv, struct v4l2_control *c) | 1512 | static int set_control(struct bttv *btv, struct v4l2_control *c) |
1523 | { | 1513 | { |
1524 | int i,val; | 1514 | int val; |
1525 | 1515 | ||
1526 | for (i = 0; i < BTTV_CTLS; i++) | ||
1527 | if (bttv_ctls[i].id == c->id) | ||
1528 | break; | ||
1529 | if (i == BTTV_CTLS) | ||
1530 | return -EINVAL; | ||
1531 | #ifdef CONFIG_VIDEO_V4L1 | 1516 | #ifdef CONFIG_VIDEO_V4L1 |
1532 | if (btv->audio_hook && i >= 4 && i <= 8) { | 1517 | if (btv->audio_hook && (c->id == V4L2_CID_AUDIO_VOLUME)) { |
1533 | struct video_audio va; | 1518 | struct video_audio va; |
1534 | 1519 | ||
1535 | memset(&va,0,sizeof(va)); | 1520 | memset(&va,0,sizeof(va)); |
1536 | btv->audio_hook(btv,&va,0); | 1521 | btv->audio_hook(btv,&va,0); |
1537 | switch (c->id) { | 1522 | switch (c->id) { |
1538 | case V4L2_CID_AUDIO_MUTE: | ||
1539 | if (c->value) { | ||
1540 | va.flags |= VIDEO_AUDIO_MUTE; | ||
1541 | audio_mute(btv, 1); | ||
1542 | } else { | ||
1543 | va.flags &= ~VIDEO_AUDIO_MUTE; | ||
1544 | audio_mute(btv, 0); | ||
1545 | } | ||
1546 | break; | ||
1547 | |||
1548 | case V4L2_CID_AUDIO_VOLUME: | 1523 | case V4L2_CID_AUDIO_VOLUME: |
1549 | va.volume = c->value; | 1524 | va.volume = c->value; |
1550 | break; | 1525 | break; |