From fde3e3b6816368fa44ece4a962fd3ef5ed664398 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 19 Mar 2006 16:35:57 +0100 Subject: Implement correct msp3400 input/output routing From: Hans Verkuil - implement VIDIOC_INT_S_AUDIO_ROUTING for msp3400 and tvaudio - use the new command in bttv, pvrusb2 and em28xx. - remove the now obsolete MSP_SET_MATRIX from msp3400 (yeah!) - remove the obsolete VIDIOC_S_AUDIO from msp3400. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c | 46 ++++++----------------- 1 file changed, 12 insertions(+), 34 deletions(-) (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-audio.c') diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c index 0501851dc..79e1bede4 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -25,8 +25,7 @@ #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" #include -#include "msp3400-driver.h" -#include +#include #include struct pvr2_msp3400_handler { @@ -75,8 +74,7 @@ static int xlat_audiomode_to_v4l2(int id) static void set_stereo(struct pvr2_msp3400_handler *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; - struct msp_matrix mspm; - struct v4l2_audio aud_input; + struct v4l2_routing route; pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 set_stereo"); @@ -88,47 +86,27 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt) pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_TUNER,&vt); } - memset(&aud_input,0,sizeof(aud_input)); - aud_input.index = TVAUDIO_INPUT_TUNER; + route.input = MSP_INPUT_DEFAULT; + route.output = MSP_OUTPUT(MSP_OUT_SCART1_DA); switch (hdw->controls[PVR2_CID_INPUT].value) { case PVR2_CVAL_INPUT_TV: - aud_input.index = TVAUDIO_INPUT_TUNER; break; case PVR2_CVAL_INPUT_RADIO: /* Assume that msp34xx also handle FM decoding, in which case we're still using the tuner. */ - aud_input.index = TVAUDIO_INPUT_TUNER; + /* HV: actually it is more likely to be the SCART2 input if + the ivtv experience is any indication. */ + route.input = MSP_INPUT(MSP_IN_SCART_2, MSP_IN_TUNER_1, + MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART); break; case PVR2_CVAL_INPUT_SVIDEO: case PVR2_CVAL_INPUT_COMPOSITE: - aud_input.index = TVAUDIO_INPUT_EXTERN; + /* SCART 1 input */ + route.input = MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, + MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART); break; } - pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_AUDIO,&aud_input); - - /* The above should have been enough to do the job, however - msp3400.ko does an incomplete job of handling the scart - routing. Really. It doesn't even bother to initialize the - SC1 output at all. So we have to help it here... - Unfortunately this also means that we have include - msp3400.c's header file and it currently isn't in a public - place. Damnit! */ - - mspm.input = SCART_IN1_DA; - switch (hdw->controls[PVR2_CID_INPUT].value) { - case PVR2_CVAL_INPUT_SVIDEO: - case PVR2_CVAL_INPUT_COMPOSITE: - /* Bypass the DSP and just use IN1. In theory we - should be able to permanent just use IN1_DA, but to - do that msp3400.ko should be adjusting the DSP - input SCART routing correctly when doing video in. - Unfortunately that appears not to be the case. I - really hate that module. */ - mspm.input = SCART_IN1; - break; - } - mspm.output = 1; - pvr2_i2c_client_cmd(ctxt->client,MSP_SET_MATRIX,&mspm); + pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_AUDIO_ROUTING,&route); } -- cgit v1.2.3