aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tvaudio.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-23 14:11:09 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-23 14:11:09 -0500
commit8a4b275f9c192921797f45c2d4b5e4bc3875500a (patch)
treeda12ba774968078df22718a58221e87b71387fca /drivers/media/video/tvaudio.c
parent9aeb4b051b65c0248ea6589096950413c4da9d63 (diff)
V4L/DVB (3427): audmode and rxsubchans fixes (VIDIOC_G/S_TUNER)
- Audmode and rxsubchans fixes in msp3400, tuner, tvaudio and cx25840. - msp3400 cleanups Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tvaudio.c')
-rw-r--r--drivers/media/video/tvaudio.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index c8e5ad0e8185..4efb01bb44ac 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -130,6 +130,7 @@ struct CHIPSTATE {
130 struct timer_list wt; 130 struct timer_list wt;
131 int done; 131 int done;
132 int watch_stereo; 132 int watch_stereo;
133 int audmode;
133}; 134};
134 135
135/* ---------------------------------------------------------------------- */ 136/* ---------------------------------------------------------------------- */
@@ -1514,6 +1515,7 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind)
1514 chip->type = desc-chiplist; 1515 chip->type = desc-chiplist;
1515 chip->shadow.count = desc->registers+1; 1516 chip->shadow.count = desc->registers+1;
1516 chip->prevmode = -1; 1517 chip->prevmode = -1;
1518 chip->audmode = V4L2_TUNER_MODE_LANG1;
1517 /* register */ 1519 /* register */
1518 i2c_attach_client(&chip->c); 1520 i2c_attach_client(&chip->c);
1519 1521
@@ -1671,6 +1673,8 @@ static int chip_command(struct i2c_client *client,
1671 struct v4l2_tuner *vt = arg; 1673 struct v4l2_tuner *vt = arg;
1672 int mode = 0; 1674 int mode = 0;
1673 1675
1676 if (chip->radio)
1677 break;
1674 switch (vt->audmode) { 1678 switch (vt->audmode) {
1675 case V4L2_TUNER_MODE_MONO: 1679 case V4L2_TUNER_MODE_MONO:
1676 mode = VIDEO_SOUND_MONO; 1680 mode = VIDEO_SOUND_MONO;
@@ -1685,8 +1689,9 @@ static int chip_command(struct i2c_client *client,
1685 mode = VIDEO_SOUND_LANG2; 1689 mode = VIDEO_SOUND_LANG2;
1686 break; 1690 break;
1687 default: 1691 default:
1688 break; 1692 return -EINVAL;
1689 } 1693 }
1694 chip->audmode = vt->audmode;
1690 1695
1691 if (desc->setmode && mode) { 1696 if (desc->setmode && mode) {
1692 chip->watch_stereo = 0; 1697 chip->watch_stereo = 0;
@@ -1704,7 +1709,7 @@ static int chip_command(struct i2c_client *client,
1704 1709
1705 if (chip->radio) 1710 if (chip->radio)
1706 break; 1711 break;
1707 vt->audmode = 0; 1712 vt->audmode = chip->audmode;
1708 vt->rxsubchans = 0; 1713 vt->rxsubchans = 0;
1709 vt->capability = V4L2_TUNER_CAP_STEREO | 1714 vt->capability = V4L2_TUNER_CAP_STEREO |
1710 V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; 1715 V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
@@ -1716,19 +1721,12 @@ static int chip_command(struct i2c_client *client,
1716 vt->rxsubchans |= V4L2_TUNER_SUB_MONO; 1721 vt->rxsubchans |= V4L2_TUNER_SUB_MONO;
1717 if (mode & VIDEO_SOUND_STEREO) 1722 if (mode & VIDEO_SOUND_STEREO)
1718 vt->rxsubchans |= V4L2_TUNER_SUB_STEREO; 1723 vt->rxsubchans |= V4L2_TUNER_SUB_STEREO;
1724 /* Note: for SAP it should be mono/lang2 or stereo/lang2.
1725 When this module is converted fully to v4l2, then this
1726 should change for those chips that can detect SAP. */
1719 if (mode & VIDEO_SOUND_LANG1) 1727 if (mode & VIDEO_SOUND_LANG1)
1720 vt->rxsubchans |= V4L2_TUNER_SUB_LANG1 | 1728 vt->rxsubchans = V4L2_TUNER_SUB_LANG1 |
1721 V4L2_TUNER_SUB_LANG2; 1729 V4L2_TUNER_SUB_LANG2;
1722
1723 mode = chip->mode;
1724 if (mode & VIDEO_SOUND_MONO)
1725 vt->audmode = V4L2_TUNER_MODE_MONO;
1726 if (mode & VIDEO_SOUND_STEREO)
1727 vt->audmode = V4L2_TUNER_MODE_STEREO;
1728 if (mode & VIDEO_SOUND_LANG1)
1729 vt->audmode = V4L2_TUNER_MODE_LANG1;
1730 if (mode & VIDEO_SOUND_LANG2)
1731 vt->audmode = V4L2_TUNER_MODE_LANG2;
1732 break; 1730 break;
1733 } 1731 }
1734 1732