aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-kthreads.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-04-02 07:21:02 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:57:34 -0400
commit2eb606db1134ce860cc0cbf8b533b6315d182e21 (patch)
tree1b0d026b77bc7d1cb9f3d9f60dd4fb7ac655333f /drivers/media/video/msp3400-kthreads.c
parent0ead09180a0620eaef761da84259262bfcf21090 (diff)
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)
244 the hardware does not support SAP. So the rxsubchans combination 244 the hardware does not support SAP. So the rxsubchans combination
245 of STEREO | LANG2 does not occur. */ 245 of STEREO | LANG2 does not occur. */
246 246
247 /* switch to mono if only mono is available */ 247 if (state->mode != MSP_MODE_EXTERN) {
248 if (state->rxsubchans == V4L2_TUNER_SUB_MONO) 248 /* switch to mono if only mono is available */
249 audmode = V4L2_TUNER_MODE_MONO; 249 if (state->rxsubchans == V4L2_TUNER_SUB_MONO)
250 /* if bilingual */ 250 audmode = V4L2_TUNER_MODE_MONO;
251 else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) { 251 /* if bilingual */
252 /* and mono or stereo, then fallback to lang1 */ 252 else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) {
253 if (audmode == V4L2_TUNER_MODE_MONO || 253 /* and mono or stereo, then fallback to lang1 */
254 audmode == V4L2_TUNER_MODE_STEREO) 254 if (audmode == V4L2_TUNER_MODE_MONO ||
255 audmode = V4L2_TUNER_MODE_LANG1; 255 audmode == V4L2_TUNER_MODE_STEREO)
256 audmode = V4L2_TUNER_MODE_LANG1;
257 }
258 /* if stereo, and audmode is not mono, then switch to stereo */
259 else if (audmode != V4L2_TUNER_MODE_MONO)
260 audmode = V4L2_TUNER_MODE_STEREO;
256 } 261 }
257 /* if stereo, and audmode is not mono, then switch to stereo */
258 else if (audmode != V4L2_TUNER_MODE_MONO)
259 audmode = V4L2_TUNER_MODE_STEREO;
260 262
261 /* switch demodulator */ 263 /* switch demodulator */
262 switch (state->mode) { 264 switch (state->mode) {
@@ -481,6 +483,7 @@ int msp3400c_thread(void *data)
481 /* no carrier scan, just unmute */ 483 /* no carrier scan, just unmute */
482 v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); 484 v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n");
483 state->scan_in_progress = 0; 485 state->scan_in_progress = 0;
486 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
484 msp_set_audio(client); 487 msp_set_audio(client);
485 continue; 488 continue;
486 } 489 }
@@ -947,6 +950,14 @@ int msp34xxg_thread(void *data)
947 if (kthread_should_stop()) 950 if (kthread_should_stop())
948 break; 951 break;
949 952
953 if (state->mode == MSP_MODE_EXTERN) {
954 /* no carrier scan needed, just unmute */
955 v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n");
956 state->scan_in_progress = 0;
957 msp_set_audio(client);
958 continue;
959 }
960
950 /* setup the chip*/ 961 /* setup the chip*/
951 msp34xxg_reset(client); 962 msp34xxg_reset(client);
952 state->std = state->radio ? 0x40 : msp_standard; 963 state->std = state->radio ? 0x40 : msp_standard;
@@ -978,6 +989,11 @@ int msp34xxg_thread(void *data)
978 v4l_dbg(1, msp_debug, client, "detected standard: %s (0x%04x)\n", 989 v4l_dbg(1, msp_debug, client, "detected standard: %s (0x%04x)\n",
979 msp_standard_std_name(state->std), state->std); 990 msp_standard_std_name(state->std), state->std);
980 991
992 if (state->std == 9) {
993 /* AM NICAM mode */
994 msp_write_dsp(client, 0x0e, 0x7c00);
995 }
996
981 /* unmute: dispatch sound to scart output, set scart volume */ 997 /* unmute: dispatch sound to scart output, set scart volume */
982 msp_set_audio(client); 998 msp_set_audio(client);
983 999