aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-03-18 15:15:00 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-03-24 14:26:58 -0500
commit301e22d69140898eddd38a9134da711cb5dfc170 (patch)
tree27a7d8df45f703a30cc983829e427d803a297d86
parent2474ed444b475614ef795523076be7cc8437ae00 (diff)
V4L/DVB (3584): Implement V4L2_TUNER_MODE_LANG1_LANG2 audio mode
Add a new audio mode V4L2_TUNER_MODE_LANG1_LANG2 (used by VIDIOC_G/S_TUNER). This mode allows the user to select both languages of a bilingual transmission, one language on the left, one on the right audio channel. If there is no bilingual transmission, or it is not supported, then this mode should act like V4L2_TUNER_MODE_STEREO. This mode is introduced for PVR-like drivers where it is useful to be able to record both languages of a bilingual broadcast. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c5
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c3
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c5
-rw-r--r--drivers/media/video/cx88/cx88-tvaudio.c3
-rw-r--r--drivers/media/video/msp3400-kthreads.c8
-rw-r--r--drivers/media/video/mxb.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c2
-rw-r--r--drivers/media/video/tvaudio.c1
-rw-r--r--include/linux/videodev2.h1
9 files changed, 29 insertions, 5 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index 2f23ceab8d44..603a22e4bfe2 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -369,6 +369,11 @@ static int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
369 fm_matrix = 0x3001; // stereo 369 fm_matrix = 0x3001; // stereo
370 src = 0x0020; 370 src = 0x0020;
371 break; 371 break;
372 case V4L2_TUNER_MODE_LANG1_LANG2:
373 dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1_LANG2\n");
374 fm_matrix = 0x3000; // bilingual
375 src = 0x0020;
376 break;
372 case V4L2_TUNER_MODE_LANG1: 377 case V4L2_TUNER_MODE_LANG1:
373 dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n"); 378 dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n");
374 fm_matrix = 0x3000; // mono 379 fm_matrix = 0x3000; // mono
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 80e4a7406ac2..74def9c23952 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1878,7 +1878,8 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1878 bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va); 1878 bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va);
1879 if (t->audmode == V4L2_TUNER_MODE_MONO) 1879 if (t->audmode == V4L2_TUNER_MODE_MONO)
1880 va.mode = VIDEO_SOUND_MONO; 1880 va.mode = VIDEO_SOUND_MONO;
1881 else if (t->audmode == V4L2_TUNER_MODE_STEREO) 1881 else if (t->audmode == V4L2_TUNER_MODE_STEREO ||
1882 t->audmode == V4L2_TUNER_MODE_LANG1_LANG2)
1882 va.mode = VIDEO_SOUND_STEREO; 1883 va.mode = VIDEO_SOUND_STEREO;
1883 else if (t->audmode == V4L2_TUNER_MODE_LANG1) 1884 else if (t->audmode == V4L2_TUNER_MODE_LANG1)
1884 va.mode = VIDEO_SOUND_LANG1; 1885 va.mode = VIDEO_SOUND_LANG1;
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 7aee37645d63..a65b3cc4bf03 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -810,13 +810,14 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
810 bilingual -> lang1 */ 810 bilingual -> lang1 */
811 cx25840_and_or(client, 0x809, ~0xf, 0x00); 811 cx25840_and_or(client, 0x809, ~0xf, 0x00);
812 break; 812 break;
813 case V4L2_TUNER_MODE_STEREO:
813 case V4L2_TUNER_MODE_LANG1: 814 case V4L2_TUNER_MODE_LANG1:
814 /* mono -> mono 815 /* mono -> mono
815 stereo -> stereo 816 stereo -> stereo
816 bilingual -> lang1 */ 817 bilingual -> lang1 */
817 cx25840_and_or(client, 0x809, ~0xf, 0x04); 818 cx25840_and_or(client, 0x809, ~0xf, 0x04);
818 break; 819 break;
819 case V4L2_TUNER_MODE_STEREO: 820 case V4L2_TUNER_MODE_LANG1_LANG2:
820 /* mono -> mono 821 /* mono -> mono
821 stereo -> stereo 822 stereo -> stereo
822 bilingual -> lang1/lang2 */ 823 bilingual -> lang1/lang2 */
@@ -824,7 +825,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
824 break; 825 break;
825 case V4L2_TUNER_MODE_LANG2: 826 case V4L2_TUNER_MODE_LANG2:
826 /* mono -> mono 827 /* mono -> mono
827 stereo ->stereo 828 stereo -> stereo
828 bilingual -> lang2 */ 829 bilingual -> lang2 */
829 cx25840_and_or(client, 0x809, ~0xf, 0x01); 830 cx25840_and_or(client, 0x809, ~0xf, 0x01);
830 break; 831 break;
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index da8d97ce0c4b..641a0c5a6490 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -885,6 +885,7 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
885 set_audio_standard_BTSC(core, 1, EN_BTSC_FORCE_SAP); 885 set_audio_standard_BTSC(core, 1, EN_BTSC_FORCE_SAP);
886 break; 886 break;
887 case V4L2_TUNER_MODE_STEREO: 887 case V4L2_TUNER_MODE_STEREO:
888 case V4L2_TUNER_MODE_LANG1_LANG2:
888 set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_STEREO); 889 set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_STEREO);
889 break; 890 break;
890 } 891 }
@@ -905,6 +906,7 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
905 EN_NICAM_FORCE_MONO2); 906 EN_NICAM_FORCE_MONO2);
906 break; 907 break;
907 case V4L2_TUNER_MODE_STEREO: 908 case V4L2_TUNER_MODE_STEREO:
909 case V4L2_TUNER_MODE_LANG1_LANG2:
908 set_audio_standard_NICAM(core, 910 set_audio_standard_NICAM(core,
909 EN_NICAM_FORCE_STEREO); 911 EN_NICAM_FORCE_STEREO);
910 break; 912 break;
@@ -926,6 +928,7 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
926 EN_A2_FORCE_MONO2); 928 EN_A2_FORCE_MONO2);
927 break; 929 break;
928 case V4L2_TUNER_MODE_STEREO: 930 case V4L2_TUNER_MODE_STEREO:
931 case V4L2_TUNER_MODE_LANG1_LANG2:
929 set_audio_standard_A2(core, 932 set_audio_standard_A2(core,
930 EN_A2_FORCE_STEREO); 933 EN_A2_FORCE_STEREO);
931 break; 934 break;
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c
index 1c794c3b9f21..c3984ea9ca07 100644
--- a/drivers/media/video/msp3400-kthreads.c
+++ b/drivers/media/video/msp3400-kthreads.c
@@ -223,9 +223,9 @@ void msp3400c_set_mode(struct i2c_client *client, int mode)
223 nor do they support stereo BTSC. */ 223 nor do they support stereo BTSC. */
224static void msp3400c_set_audmode(struct i2c_client *client) 224static void msp3400c_set_audmode(struct i2c_client *client)
225{ 225{
226 static char *strmode[] = { "mono", "stereo", "lang2", "lang1" }; 226 static char *strmode[] = { "mono", "stereo", "lang2", "lang1", "lang1+lang2" };
227 struct msp_state *state = i2c_get_clientdata(client); 227 struct msp_state *state = i2c_get_clientdata(client);
228 char *modestr = (state->audmode >= 0 && state->audmode < 4) ? 228 char *modestr = (state->audmode >= 0 && state->audmode < 5) ?
229 strmode[state->audmode] : "unknown"; 229 strmode[state->audmode] : "unknown";
230 int src = 0; /* channel source: FM/AM, nicam or SCART */ 230 int src = 0; /* channel source: FM/AM, nicam or SCART */
231 231
@@ -250,6 +250,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
250 case V4L2_TUNER_MODE_MONO: 250 case V4L2_TUNER_MODE_MONO:
251 case V4L2_TUNER_MODE_LANG1: 251 case V4L2_TUNER_MODE_LANG1:
252 case V4L2_TUNER_MODE_LANG2: 252 case V4L2_TUNER_MODE_LANG2:
253 case V4L2_TUNER_MODE_LANG1_LANG2:
253 msp_write_dsp(client, 0x000e, 0x3000); 254 msp_write_dsp(client, 0x000e, 0x3000);
254 break; 255 break;
255 } 256 }
@@ -261,6 +262,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
261 msp3400c_set_carrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); 262 msp3400c_set_carrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
262 break; 263 break;
263 case V4L2_TUNER_MODE_STEREO: 264 case V4L2_TUNER_MODE_STEREO:
265 case V4L2_TUNER_MODE_LANG1_LANG2:
264 msp3400c_set_carrier(client, MSP_CARRIER(7.2), MSP_CARRIER(7.02)); 266 msp3400c_set_carrier(client, MSP_CARRIER(7.2), MSP_CARRIER(7.02));
265 break; 267 break;
266 case V4L2_TUNER_MODE_LANG1: 268 case V4L2_TUNER_MODE_LANG1:
@@ -296,6 +298,7 @@ static void msp3400c_set_audmode(struct i2c_client *client)
296 /* switch audio */ 298 /* switch audio */
297 switch (state->audmode) { 299 switch (state->audmode) {
298 case V4L2_TUNER_MODE_STEREO: 300 case V4L2_TUNER_MODE_STEREO:
301 case V4L2_TUNER_MODE_LANG1_LANG2:
299 src |= 0x0020; 302 src |= 0x0020;
300 break; 303 break;
301 case V4L2_TUNER_MODE_MONO: 304 case V4L2_TUNER_MODE_MONO:
@@ -835,6 +838,7 @@ static void msp34xxg_set_source(struct i2c_client *client, u16 reg, int in)
835 matrix = 0x10; 838 matrix = 0x10;
836 break; 839 break;
837 case V4L2_TUNER_MODE_STEREO: 840 case V4L2_TUNER_MODE_STEREO:
841 case V4L2_TUNER_MODE_LANG1_LANG2:
838 default: 842 default:
839 source = 1; /* stereo or A|B */ 843 source = 1; /* stereo or A|B */
840 matrix = 0x20; 844 matrix = 0x20;
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 14ca251787d5..b0aea4002d11 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -790,6 +790,12 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
790 DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n")); 790 DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n"));
791 break; 791 break;
792 } 792 }
793 case V4L2_TUNER_MODE_LANG1_LANG2: {
794 mxb->cur_mode = V4L2_TUNER_MODE_LANG1_LANG2;
795 byte = TDA9840_SET_BOTH;
796 DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1_LANG2\n"));
797 break;
798 }
793 case V4L2_TUNER_MODE_LANG1: { 799 case V4L2_TUNER_MODE_LANG1: {
794 mxb->cur_mode = V4L2_TUNER_MODE_LANG1; 800 mxb->cur_mode = V4L2_TUNER_MODE_LANG1;
795 byte = TDA9840_SET_LANG1; 801 byte = TDA9840_SET_LANG1;
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 3043233a8b6e..0db53d192b2a 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -482,12 +482,14 @@ static int tvaudio_setstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
482 [ V4L2_TUNER_MODE_STEREO ] = "stereo", 482 [ V4L2_TUNER_MODE_STEREO ] = "stereo",
483 [ V4L2_TUNER_MODE_LANG1 ] = "lang1", 483 [ V4L2_TUNER_MODE_LANG1 ] = "lang1",
484 [ V4L2_TUNER_MODE_LANG2 ] = "lang2", 484 [ V4L2_TUNER_MODE_LANG2 ] = "lang2",
485 [ V4L2_TUNER_MODE_LANG1_LANG2 ] = "lang1+lang2",
485 }; 486 };
486 static u32 fm[] = { 487 static u32 fm[] = {
487 [ V4L2_TUNER_MODE_MONO ] = 0x00, /* ch1 */ 488 [ V4L2_TUNER_MODE_MONO ] = 0x00, /* ch1 */
488 [ V4L2_TUNER_MODE_STEREO ] = 0x80, /* auto */ 489 [ V4L2_TUNER_MODE_STEREO ] = 0x80, /* auto */
489 [ V4L2_TUNER_MODE_LANG1 ] = 0x00, /* ch1 */ 490 [ V4L2_TUNER_MODE_LANG1 ] = 0x00, /* ch1 */
490 [ V4L2_TUNER_MODE_LANG2 ] = 0x01, /* ch2 */ 491 [ V4L2_TUNER_MODE_LANG2 ] = 0x01, /* ch2 */
492 [ V4L2_TUNER_MODE_LANG1_LANG2 ] = 0x80, /* auto */
491 }; 493 };
492 u32 reg; 494 u32 reg;
493 495
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 4e6d030d83c0..356bff455ad1 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -1733,6 +1733,7 @@ static int chip_command(struct i2c_client *client,
1733 mode = VIDEO_SOUND_MONO; 1733 mode = VIDEO_SOUND_MONO;
1734 break; 1734 break;
1735 case V4L2_TUNER_MODE_STEREO: 1735 case V4L2_TUNER_MODE_STEREO:
1736 case V4L2_TUNER_MODE_LANG1_LANG2:
1736 mode = VIDEO_SOUND_STEREO; 1737 mode = VIDEO_SOUND_STEREO;
1737 break; 1738 break;
1738 case V4L2_TUNER_MODE_LANG1: 1739 case V4L2_TUNER_MODE_LANG1:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 724cfbf54b8a..2275bfec5b68 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -883,6 +883,7 @@ struct v4l2_modulator
883#define V4L2_TUNER_MODE_LANG2 0x0002 883#define V4L2_TUNER_MODE_LANG2 0x0002
884#define V4L2_TUNER_MODE_SAP 0x0002 884#define V4L2_TUNER_MODE_SAP 0x0002
885#define V4L2_TUNER_MODE_LANG1 0x0003 885#define V4L2_TUNER_MODE_LANG1 0x0003
886#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
886 887
887struct v4l2_frequency 888struct v4l2_frequency
888{ 889{