diff options
author | Mike Isely <isely@pobox.com> | 2006-03-30 22:46:49 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-03-30 22:46:49 -0600 |
commit | 4a70d7bbda936a5e93a2d6f6061800327491cc69 (patch) | |
tree | e7734e7cfedf5a03d71471826f116e45df37272d /linux/drivers/media/video/msp3400-kthreads.c | |
parent | 012c447c3dd586921468215450cb6cce65052a3c (diff) | |
parent | b03dad0db6b312169fd2e16c18187703b23ecd38 (diff) | |
download | mediapointer-dvb-s2-4a70d7bbda936a5e93a2d6f6061800327491cc69.tar.gz mediapointer-dvb-s2-4a70d7bbda936a5e93a2d6f6061800327491cc69.tar.bz2 |
Merge from master
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/msp3400-kthreads.c')
-rw-r--r-- | linux/drivers/media/video/msp3400-kthreads.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/linux/drivers/media/video/msp3400-kthreads.c b/linux/drivers/media/video/msp3400-kthreads.c index 0a9b4a2ba..4b0d6340a 100644 --- a/linux/drivers/media/video/msp3400-kthreads.c +++ b/linux/drivers/media/video/msp3400-kthreads.c @@ -234,6 +234,7 @@ static void msp3400c_set_audmode(struct i2c_client *client) char *modestr = (state->audmode >= 0 && state->audmode < 5) ? strmode[state->audmode] : "unknown"; int src = 0; /* channel source: FM/AM, nicam or SCART */ + int audmode = state->audmode; if (state->opmode == OPMODE_AUTOSELECT) { /* this method would break everything, let's make sure @@ -245,11 +246,22 @@ static void msp3400c_set_audmode(struct i2c_client *client) return; } + /* If no second language is available, switch to the first language */ + if ((audmode == V4L2_TUNER_MODE_LANG2 || + audmode == V4L2_TUNER_MODE_LANG1_LANG2) && + !(state->rxsubchans & V4L2_TUNER_SUB_LANG2)) + audmode = V4L2_TUNER_MODE_LANG1; + /* switch to stereo for stereo transmission, otherwise + keep first language */ + if (audmode == V4L2_TUNER_MODE_LANG1 && + (state->rxsubchans & V4L2_TUNER_SUB_STEREO)) + audmode = V4L2_TUNER_MODE_STEREO; + /* switch demodulator */ switch (state->mode) { case MSP_MODE_FM_TERRA: v4l_dbg(1, msp_debug, client, "FM set_audmode: %s\n", modestr); - switch (state->audmode) { + switch (audmode) { case V4L2_TUNER_MODE_STEREO: msp_write_dsp(client, 0x000e, 0x3001); break; @@ -263,7 +275,7 @@ static void msp3400c_set_audmode(struct i2c_client *client) break; case MSP_MODE_FM_SAT: v4l_dbg(1, msp_debug, client, "SAT set_audmode: %s\n", modestr); - switch (state->audmode) { + switch (audmode) { case V4L2_TUNER_MODE_MONO: msp3400c_set_carrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); break; @@ -302,7 +314,7 @@ static void msp3400c_set_audmode(struct i2c_client *client) } /* switch audio */ - switch (state->audmode) { + switch (audmode) { case V4L2_TUNER_MODE_STEREO: case V4L2_TUNER_MODE_LANG1_LANG2: src |= 0x0020; @@ -320,10 +332,6 @@ static void msp3400c_set_audmode(struct i2c_client *client) src = 0x0030; break; case V4L2_TUNER_MODE_LANG1: - /* switch to stereo for stereo transmission, otherwise - keep first language */ - if (state->rxsubchans & V4L2_TUNER_SUB_STEREO) - src |= 0x0020; break; case V4L2_TUNER_MODE_LANG2: src |= 0x0010; @@ -625,9 +633,9 @@ int msp3400c_thread(void *data) if (msp_sleep(state, 1000)) goto restart; while (state->watch_stereo) { + watch_stereo(client); if (msp_sleep(state, 5000)) goto restart; - watch_stereo(client); } } v4l_dbg(1, msp_debug, client, "thread: exit\n"); |