diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-03-19 01:31:00 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2006-03-19 01:31:00 +0100 |
commit | 4d93017b78b84f0e38f348ba71a4e0206d753c09 (patch) | |
tree | 0c75f25c982935f452c34b17be52b345c5b4f482 /linux/drivers/media/video/pvrusb2/pvrusb2-audio.c | |
parent | 2d0abb67a8d568f7bfd5ae1814cf1f34757237da (diff) | |
download | mediapointer-dvb-s2-4d93017b78b84f0e38f348ba71a4e0206d753c09.tar.gz mediapointer-dvb-s2-4d93017b78b84f0e38f348ba71a4e0206d753c09.tar.bz2 |
Cleanup audio input handling
From: Hans Verkuil <hverkuil@xs4all.nl>
Cleanup audio input handling in bttv and tvaudio:
- inputs were specified that were never used
- mute was handled as a special input which led to confusing code
- confusing naming made it difficult to see if the setting was for
i2c or gpio.
The old audiochip.h input names moved to tvaudio.h. Currently this
is used both by tvaudio and msp3400 until the msp3400 implements the
new msp3400-specific inputs.
Detect in bttv the tvaudio and msp3400 i2c clients and use these
client pointers to set the inputs directly instead of broadcasting the
command.
Removed AUDC_SET_INPUT. Now replaced by VIDIOC_S_AUDIO. This will be
replaced again later by the new ROUTING commands.
Removed VIDIOC_G_AUDIO implementations in i2c drivers: this command is
a user level command and not to be used internally. It wasn't called at
all anyway.
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.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c index 7e2fab330..0304ee1e5 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -26,7 +26,7 @@ #include "pvrusb2-debug.h" #include "msp3400.h" #include <linux/videodev.h> -#include <media/audiochip.h> +#include <media/tvaudio.h> #include <media/v4l2-common.h> struct pvr2_msp3400_handler { @@ -75,8 +75,8 @@ static int xlat_audiomode_to_v4l2(int id) static void set_stereo(struct pvr2_msp3400_handler *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; - unsigned short sarg = 0; struct msp_matrix mspm; + struct v4l2_audio aud_input; pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 set_stereo"); @@ -88,22 +88,23 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt) pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_TUNER,&vt); } - sarg = AUDIO_TUNER; + memset(&aud_input,0,sizeof(aud_input)); + aud_input.index = TVAUDIO_INPUT_TUNER; switch (hdw->controls[PVR2_CID_INPUT].value) { case PVR2_CVAL_INPUT_TV: - sarg = AUDIO_TUNER; + 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. */ - sarg = AUDIO_TUNER; + aud_input.index = TVAUDIO_INPUT_TUNER; break; case PVR2_CVAL_INPUT_SVIDEO: case PVR2_CVAL_INPUT_COMPOSITE: - sarg = AUDIO_EXTERN; + aud_input.index = TVAUDIO_INPUT_EXTERN; break; } - pvr2_i2c_client_cmd(ctxt->client,AUDC_SET_INPUT,&sarg); + 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 |