diff options
Diffstat (limited to 'linux/drivers/media/video/pvrusb2')
6 files changed, 33 insertions, 33 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); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 231c314f4..ec2b5eeae 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -158,6 +158,7 @@ static const char *control_values_audiomode[] = { [PVR2_CVAL_AUDIOMODE_SAP] = "SAP", [PVR2_CVAL_AUDIOMODE_LANG1] = "Lang1", [PVR2_CVAL_AUDIOMODE_LANG2] = "Lang2", + [PVR2_CVAL_AUDIOMODE_LANG1_LANG2] = "Lang1+Lang2", }; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index cf5231ee9..aa6d9029a 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -119,8 +119,9 @@ #define PVR2_CVAL_AUDIOMODE_SAP 2 #define PVR2_CVAL_AUDIOMODE_LANG1 3 #define PVR2_CVAL_AUDIOMODE_LANG2 4 +#define PVR2_CVAL_AUDIOMODE_LANG1_LANG2 5 #define PVR2_CVAL_AUDIOMODE_MIN PVR2_CVAL_AUDIOMODE_MONO -#define PVR2_CVAL_AUDIOMODE_MAX PVR2_CVAL_AUDIOMODE_LANG2 +#define PVR2_CVAL_AUDIOMODE_MAX PVR2_CVAL_AUDIOMODE_LANG1_LANG2 /* Values that pvr2_hdw_get_signal_status() returns */ #define PVR2_SIGNAL_OK 0x0001 diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 7721e405e..000c26911 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -24,7 +24,6 @@ #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" #include <linux/videodev.h> -#include <media/audiochip.h> static void set_standard(struct pvr2_hdw *hdw) diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 44423ff1a..dd207fae4 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -593,6 +593,9 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, case PVR2_CVAL_AUDIOMODE_LANG2: vt->audmode = V4L2_TUNER_MODE_LANG2; break; + case PVR2_CVAL_AUDIOMODE_LANG1_LANG2: + vt->audmode = V4L2_TUNER_MODE_LANG1_LANG2; + break; case PVR2_CVAL_AUDIOMODE_SAP: vt->audmode = V4L2_TUNER_MODE_SAP; break; @@ -620,6 +623,9 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, case V4L2_TUNER_MODE_LANG1: val = PVR2_CVAL_AUDIOMODE_LANG1; break; + case V4L2_TUNER_MODE_LANG1_LANG2: + val = PVR2_CVAL_AUDIOMODE_LANG1_LANG2; + break; case V4L2_TUNER_MODE_SAP: // Also LANG2 val = PVR2_CVAL_AUDIOMODE_SAP; break; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index 7078ac3ad..c55f3c653 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c @@ -36,6 +36,7 @@ #include "pvrusb2-debug.h" #include <linux/videodev.h> #include <media/v4l2-common.h> +#include <media/saa7115.h> #include <linux/errno.h> #include <linux/slab.h> @@ -51,25 +52,27 @@ struct pvr2_v4l_decoder { static void set_input(struct pvr2_v4l_decoder *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; - int v = 0; + struct v4l2_routing route; + pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_input(%d)", hdw->controls[PVR2_CID_INPUT].value); switch(hdw->controls[PVR2_CID_INPUT].value){ case PVR2_CVAL_INPUT_TV: - v = 4; + route.input = SAA7115_COMPOSITE4; break; case PVR2_CVAL_INPUT_COMPOSITE: - v = 5; + route.input = SAA7115_COMPOSITE5; break; case PVR2_CVAL_INPUT_SVIDEO: - v = 8; + route.input = SAA7115_SVIDEO2; break; case PVR2_CVAL_INPUT_RADIO: // ????? No idea yet what to do here default: return; } - pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_INPUT,&v); + route.output = 0; + pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_S_VIDEO_ROUTING,&route); } |