aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorGerd Knorr <kraxel@bytesex.org>2005-05-01 11:59:20 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:59:20 -0400
commitfaf8b24968ce6392ea68d9afc7de1ffbc38c1f6c (patch)
tree8309caf9e4448e019d724ec5d3ed115f2b07b450 /drivers/media/video
parent9990d744bea7d28e83c420e2c9d524c7a8a2d136 (diff)
[PATCH] v4l: msp3400 update
msp3400 update: Fix and enable "simpler" mode, some other minor fixes. Signed-off-by: Gerd Knorr <kraxel@bytesex.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/msp3400.c28
-rw-r--r--drivers/media/video/tvaudio.c2
2 files changed, 19 insertions, 11 deletions
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index c97df705df5e..7fbb8581a87d 100644
--- a/drivers/media/video/msp3400.c
+++ b/drivers/media/video/msp3400.c
@@ -380,7 +380,9 @@ static void msp3400c_setvolume(struct i2c_client *client,
380 int val = 0, bal = 0; 380 int val = 0, bal = 0;
381 381
382 if (!muted) { 382 if (!muted) {
383 val = (volume * 0x7F / 65535) << 8; 383 /* 0x7f instead if 0x73 here has sound quality issues,
384 * probably due to overmodulation + clipping ... */
385 val = (volume * 0x73 / 65535) << 8;
384 } 386 }
385 if (val) { 387 if (val) {
386 bal = (balance / 256) - 128; 388 bal = (balance / 256) - 128;
@@ -997,7 +999,13 @@ static int msp34xx_modus(int norm)
997{ 999{
998 switch (norm) { 1000 switch (norm) {
999 case VIDEO_MODE_PAL: 1001 case VIDEO_MODE_PAL:
1002#if 1
1003 /* experimental: not sure this works with all chip versions */
1004 return 0x7003;
1005#else
1006 /* previous value, try this if it breaks ... */
1000 return 0x1003; 1007 return 0x1003;
1008#endif
1001 case VIDEO_MODE_NTSC: /* BTSC */ 1009 case VIDEO_MODE_NTSC: /* BTSC */
1002 return 0x2003; 1010 return 0x2003;
1003 case VIDEO_MODE_SECAM: 1011 case VIDEO_MODE_SECAM:
@@ -1264,6 +1272,7 @@ static int msp34xxg_thread(void *data)
1264 int val, std, i; 1272 int val, std, i;
1265 1273
1266 printk("msp34xxg: daemon started\n"); 1274 printk("msp34xxg: daemon started\n");
1275 msp->source = 1; /* default */
1267 for (;;) { 1276 for (;;) {
1268 d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n"); 1277 d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n");
1269 msp34xx_sleep(msp,-1); 1278 msp34xx_sleep(msp,-1);
@@ -1334,8 +1343,9 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
1334 1343
1335 /* fix matrix mode to stereo and let the msp choose what 1344 /* fix matrix mode to stereo and let the msp choose what
1336 * to output according to 'source', as recommended 1345 * to output according to 'source', as recommended
1346 * for MONO (source==0) downmixing set bit[7:0] to 0x30
1337 */ 1347 */
1338 int value = (source&0x07)<<8|(source==0 ? 0x00:0x20); 1348 int value = (source&0x07)<<8|(source==0 ? 0x30:0x20);
1339 dprintk("msp34xxg: set source to %d (0x%x)\n", source, value); 1349 dprintk("msp34xxg: set source to %d (0x%x)\n", source, value);
1340 msp3400c_write(client, 1350 msp3400c_write(client,
1341 I2C_MSP3400C_DFP, 1351 I2C_MSP3400C_DFP,
@@ -1359,7 +1369,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
1359 msp3400c_write(client, 1369 msp3400c_write(client,
1360 I2C_MSP3400C_DEM, 1370 I2C_MSP3400C_DEM,
1361 0x22, /* a2 threshold for stereo/bilingual */ 1371 0x22, /* a2 threshold for stereo/bilingual */
1362 source==0 ? 0x7f0:stereo_threshold); 1372 stereo_threshold);
1363 msp->source=source; 1373 msp->source=source;
1364} 1374}
1365 1375
@@ -1394,7 +1404,7 @@ static void msp34xxg_detect_stereo(struct i2c_client *client)
1394static void msp34xxg_set_audmode(struct i2c_client *client, int audmode) 1404static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
1395{ 1405{
1396 struct msp3400c *msp = i2c_get_clientdata(client); 1406 struct msp3400c *msp = i2c_get_clientdata(client);
1397 int source = 0; 1407 int source;
1398 1408
1399 switch (audmode) { 1409 switch (audmode) {
1400 case V4L2_TUNER_MODE_MONO: 1410 case V4L2_TUNER_MODE_MONO:
@@ -1410,9 +1420,10 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
1410 case V4L2_TUNER_MODE_LANG2: 1420 case V4L2_TUNER_MODE_LANG2:
1411 source=4; /* stereo or B */ 1421 source=4; /* stereo or B */
1412 break; 1422 break;
1413 default: /* doing nothing: a safe, sane default */ 1423 default:
1414 audmode = 0; 1424 audmode = 0;
1415 return; 1425 source = 1;
1426 break;
1416 } 1427 }
1417 msp->audmode = audmode; 1428 msp->audmode = audmode;
1418 msp34xxg_set_source(client, source); 1429 msp34xxg_set_source(client, source);
@@ -1514,12 +1525,9 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
1514 1525
1515 msp->opmode = opmode; 1526 msp->opmode = opmode;
1516 if (OPMODE_AUTO == msp->opmode) { 1527 if (OPMODE_AUTO == msp->opmode) {
1517#if 0 /* seems to work for ivtv only, disable by default for now ... */
1518 if (HAVE_SIMPLER(msp)) 1528 if (HAVE_SIMPLER(msp))
1519 msp->opmode = OPMODE_SIMPLER; 1529 msp->opmode = OPMODE_SIMPLER;
1520 else 1530 else if (HAVE_SIMPLE(msp))
1521#endif
1522 if (HAVE_SIMPLE(msp))
1523 msp->opmode = OPMODE_SIMPLE; 1531 msp->opmode = OPMODE_SIMPLE;
1524 else 1532 else
1525 msp->opmode = OPMODE_MANUAL; 1533 msp->opmode = OPMODE_MANUAL;
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 065eb4007b1d..80dc34f18c2c 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -991,7 +991,7 @@ static int tda9874a_initialize(struct CHIPSTATE *chip)
991{ 991{
992 if (tda9874a_SIF > 2) 992 if (tda9874a_SIF > 2)
993 tda9874a_SIF = 1; 993 tda9874a_SIF = 1;
994 if (tda9874a_STD >= 8) 994 if (tda9874a_STD > 8)
995 tda9874a_STD = 0; 995 tda9874a_STD = 0;
996 if(tda9874a_AMSEL > 1) 996 if(tda9874a_AMSEL > 1)
997 tda9874a_AMSEL = 0; 997 tda9874a_AMSEL = 0;