aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-kthreads.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-04-02 08:21:02 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:57:34 -0300
commit2eb606db1134ce860cc0cbf8b533b6315d182e21 (patch)
tree1b0d026b77bc7d1cb9f3d9f60dd4fb7ac655333f /drivers/media/video/msp3400-kthreads.c
parentV4L/DVB (3708a): Clean up some cruft in or51132 frontend (diff)
downloadlinux-dev-2eb606db1134ce860cc0cbf8b533b6315d182e21.tar.xz
linux-dev-2eb606db1134ce860cc0cbf8b533b6315d182e21.zip
V4L/DVB (3709): Improve line-in handling
- improve handling of the EXTERN input: don't start an unnecessary carrier scan - improve the LOG_STATUS output - ensure that a carrier scan is started again when switching back to the tuner. - set correct prescale for L-NICAM Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/msp3400-kthreads.c')
-rw-r--r--drivers/media/video/msp3400-kthreads.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c
index 633a10213789..f2fd9195b3ac 100644
--- a/drivers/media/video/msp3400-kthreads.c
+++ b/drivers/media/video/msp3400-kthreads.c
@@ -244,19 +244,21 @@ static void msp3400c_set_audmode(struct i2c_client *client)
the hardware does not support SAP. So the rxsubchans combination
of STEREO | LANG2 does not occur. */
- /* switch to mono if only mono is available */
- if (state->rxsubchans == V4L2_TUNER_SUB_MONO)
- audmode = V4L2_TUNER_MODE_MONO;
- /* if bilingual */
- else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) {
- /* and mono or stereo, then fallback to lang1 */
- if (audmode == V4L2_TUNER_MODE_MONO ||
- audmode == V4L2_TUNER_MODE_STEREO)
- audmode = V4L2_TUNER_MODE_LANG1;
+ if (state->mode != MSP_MODE_EXTERN) {
+ /* switch to mono if only mono is available */
+ if (state->rxsubchans == V4L2_TUNER_SUB_MONO)
+ audmode = V4L2_TUNER_MODE_MONO;
+ /* if bilingual */
+ else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) {
+ /* and mono or stereo, then fallback to lang1 */
+ if (audmode == V4L2_TUNER_MODE_MONO ||
+ audmode == V4L2_TUNER_MODE_STEREO)
+ audmode = V4L2_TUNER_MODE_LANG1;
+ }
+ /* if stereo, and audmode is not mono, then switch to stereo */
+ else if (audmode != V4L2_TUNER_MODE_MONO)
+ audmode = V4L2_TUNER_MODE_STEREO;
}
- /* if stereo, and audmode is not mono, then switch to stereo */
- else if (audmode != V4L2_TUNER_MODE_MONO)
- audmode = V4L2_TUNER_MODE_STEREO;
/* switch demodulator */
switch (state->mode) {
@@ -481,6 +483,7 @@ int msp3400c_thread(void *data)
/* no carrier scan, just unmute */
v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n");
state->scan_in_progress = 0;
+ state->rxsubchans = V4L2_TUNER_SUB_STEREO;
msp_set_audio(client);
continue;
}
@@ -947,6 +950,14 @@ int msp34xxg_thread(void *data)
if (kthread_should_stop())
break;
+ if (state->mode == MSP_MODE_EXTERN) {
+ /* no carrier scan needed, just unmute */
+ v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n");
+ state->scan_in_progress = 0;
+ msp_set_audio(client);
+ continue;
+ }
+
/* setup the chip*/
msp34xxg_reset(client);
state->std = state->radio ? 0x40 : msp_standard;
@@ -978,6 +989,11 @@ int msp34xxg_thread(void *data)
v4l_dbg(1, msp_debug, client, "detected standard: %s (0x%04x)\n",
msp_standard_std_name(state->std), state->std);
+ if (state->std == 9) {
+ /* AM NICAM mode */
+ msp_write_dsp(client, 0x0e, 0x7c00);
+ }
+
/* unmute: dispatch sound to scart output, set scart volume */
msp_set_audio(client);