summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/msp3400-driver.c24
-rw-r--r--linux/drivers/media/video/msp3400.c24
2 files changed, 30 insertions, 18 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 5bfb7e174..07117009e 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -994,7 +994,13 @@ static int msp34xx_modus(int norm)
{
switch (norm) {
case VIDEO_MODE_PAL:
+#if 1
+ /* experimental: not sure this works with all chip versions */
+ return 0x7003;
+#else
+ /* previous value, try this if it breaks ... */
return 0x1003;
+#endif
case VIDEO_MODE_NTSC: /* BTSC */
return 0x2003;
case VIDEO_MODE_SECAM:
@@ -1261,6 +1267,7 @@ static int msp34xxg_thread(void *data)
int val, std, i;
printk("msp34xxg: daemon started\n");
+ msp->source = 1; /* default */
for (;;) {
d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n");
msp34xx_sleep(msp,-1);
@@ -1331,8 +1338,9 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
/* fix matrix mode to stereo and let the msp choose what
* to output according to 'source', as recommended
+ * for MONO (source==0) downmixing set bit[7:0] to 0x30
*/
- int value = (source&0x07)<<8|(source==0 ? 0x00:0x20);
+ int value = (source&0x07)<<8|(source==0 ? 0x30:0x20);
dprintk("msp34xxg: set source to %d (0x%x)\n", source, value);
msp3400c_write(client,
I2C_MSP3400C_DFP,
@@ -1356,7 +1364,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
msp3400c_write(client,
I2C_MSP3400C_DEM,
0x22, /* a2 threshold for stereo/bilingual */
- source==0 ? 0x7f0:stereo_threshold);
+ stereo_threshold);
msp->source=source;
}
@@ -1391,7 +1399,7 @@ static void msp34xxg_detect_stereo(struct i2c_client *client)
static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
{
struct msp3400c *msp = i2c_get_clientdata(client);
- int source = 0;
+ int source;
switch (audmode) {
case V4L2_TUNER_MODE_MONO:
@@ -1407,9 +1415,10 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
case V4L2_TUNER_MODE_LANG2:
source=4; /* stereo or B */
break;
- default: /* doing nothing: a safe, sane default */
+ default:
audmode = 0;
- return;
+ source = 1;
+ break;
}
msp->audmode = audmode;
msp34xxg_set_source(client, source);
@@ -1511,12 +1520,9 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
msp->opmode = opmode;
if (OPMODE_AUTO == msp->opmode) {
-#if 0 /* seems to work for ivtv only, disable by default for now ... */
if (HAVE_SIMPLER(msp))
msp->opmode = OPMODE_SIMPLER;
- else
-#endif
- if (HAVE_SIMPLE(msp))
+ else if (HAVE_SIMPLE(msp))
msp->opmode = OPMODE_SIMPLE;
else
msp->opmode = OPMODE_MANUAL;
diff --git a/linux/drivers/media/video/msp3400.c b/linux/drivers/media/video/msp3400.c
index 5bfb7e174..07117009e 100644
--- a/linux/drivers/media/video/msp3400.c
+++ b/linux/drivers/media/video/msp3400.c
@@ -994,7 +994,13 @@ static int msp34xx_modus(int norm)
{
switch (norm) {
case VIDEO_MODE_PAL:
+#if 1
+ /* experimental: not sure this works with all chip versions */
+ return 0x7003;
+#else
+ /* previous value, try this if it breaks ... */
return 0x1003;
+#endif
case VIDEO_MODE_NTSC: /* BTSC */
return 0x2003;
case VIDEO_MODE_SECAM:
@@ -1261,6 +1267,7 @@ static int msp34xxg_thread(void *data)
int val, std, i;
printk("msp34xxg: daemon started\n");
+ msp->source = 1; /* default */
for (;;) {
d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n");
msp34xx_sleep(msp,-1);
@@ -1331,8 +1338,9 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
/* fix matrix mode to stereo and let the msp choose what
* to output according to 'source', as recommended
+ * for MONO (source==0) downmixing set bit[7:0] to 0x30
*/
- int value = (source&0x07)<<8|(source==0 ? 0x00:0x20);
+ int value = (source&0x07)<<8|(source==0 ? 0x30:0x20);
dprintk("msp34xxg: set source to %d (0x%x)\n", source, value);
msp3400c_write(client,
I2C_MSP3400C_DFP,
@@ -1356,7 +1364,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
msp3400c_write(client,
I2C_MSP3400C_DEM,
0x22, /* a2 threshold for stereo/bilingual */
- source==0 ? 0x7f0:stereo_threshold);
+ stereo_threshold);
msp->source=source;
}
@@ -1391,7 +1399,7 @@ static void msp34xxg_detect_stereo(struct i2c_client *client)
static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
{
struct msp3400c *msp = i2c_get_clientdata(client);
- int source = 0;
+ int source;
switch (audmode) {
case V4L2_TUNER_MODE_MONO:
@@ -1407,9 +1415,10 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
case V4L2_TUNER_MODE_LANG2:
source=4; /* stereo or B */
break;
- default: /* doing nothing: a safe, sane default */
+ default:
audmode = 0;
- return;
+ source = 1;
+ break;
}
msp->audmode = audmode;
msp34xxg_set_source(client, source);
@@ -1511,12 +1520,9 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
msp->opmode = opmode;
if (OPMODE_AUTO == msp->opmode) {
-#if 0 /* seems to work for ivtv only, disable by default for now ... */
if (HAVE_SIMPLER(msp))
msp->opmode = OPMODE_SIMPLER;
- else
-#endif
- if (HAVE_SIMPLE(msp))
+ else if (HAVE_SIMPLE(msp))
msp->opmode = OPMODE_SIMPLE;
else
msp->opmode = OPMODE_MANUAL;