summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-03-19 16:35:57 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2006-03-19 16:35:57 +0100
commitfde3e3b6816368fa44ece4a962fd3ef5ed664398 (patch)
tree22004efc3fe8489597fae89142217965b630f2b9 /linux/drivers/media/video/pvrusb2/pvrusb2-audio.c
parenta54e9c36217d11493c90e0dbdef2f48625525702 (diff)
downloadmediapointer-dvb-s2-fde3e3b6816368fa44ece4a962fd3ef5ed664398.tar.gz
mediapointer-dvb-s2-fde3e3b6816368fa44ece4a962fd3ef5ed664398.tar.bz2
Implement correct msp3400 input/output routing
From: Hans Verkuil <hverkuil@xs4all.nl> - 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 <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-audio.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-audio.c46
1 files changed, 12 insertions, 34 deletions
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 <linux/videodev.h>
-#include "msp3400-driver.h"
-#include <media/tvaudio.h>
+#include <media/msp3400.h>
#include <media/v4l2-common.h>
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);
}