diff options
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-audio.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-audio.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c index c43b98897..79395d540 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -24,9 +24,8 @@ #include "pvrusb2-audio.h" #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" -#include "msp3400.h" #include <linux/videodev.h> -#include <media/audiochip.h> +#include <media/msp3400.h> #include <media/v4l2-common.h> struct pvr2_msp3400_handler { @@ -51,6 +50,8 @@ static int xlat_audiomode_to_v4l2(int id) return V4L2_TUNER_MODE_LANG1; case PVR2_CVAL_AUDIOMODE_LANG2: return V4L2_TUNER_MODE_LANG2; + case PVR2_CVAL_AUDIOMODE_LANG1_LANG2: + return V4L2_TUNER_MODE_LANG1_LANG2; } return V4L2_TUNER_MODE_STEREO; } @@ -60,8 +61,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 v4l2_audio ac; - struct msp_matrix mspm; + struct v4l2_routing route; pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo"); @@ -73,37 +73,27 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt) pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_TUNER,&vt); } - memset(&ac,0,sizeof(ac)); - ac.index = AUDIO_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: - ac.index = AUDIO_TUNER; break; case PVR2_CVAL_INPUT_RADIO: - ac.index = AUDIO_RADIO; + /* Assume that msp34xx also handle FM decoding, in which case + we're still using the 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: - ac.index = AUDIO_EXTERN_1; + /* 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,&ac); - - 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 permanently 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); } |