diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-03-18 19:31:00 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-24 14:26:56 -0500 |
commit | 8bf2f8e747700419cc5bbc56c4496774eb8f2f1f (patch) | |
tree | 94e9b7e99d2e95d4515d48247ce549540374a989 /include/media | |
parent | ae62e3d4a8194680023b47ab778bf1dcea8d6b42 (diff) |
V4L/DVB (3577): Cleanup audio input handling
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/audiochip.h | 14 | ||||
-rw-r--r-- | include/media/tvaudio.h | 30 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 11 |
3 files changed, 34 insertions, 21 deletions
diff --git a/include/media/audiochip.h b/include/media/audiochip.h index 295d256ee811..1fd4a2207574 100644 --- a/include/media/audiochip.h +++ b/include/media/audiochip.h | |||
@@ -21,18 +21,4 @@ enum audiochip { | |||
21 | AUDIO_CHIP_MSP34XX | 21 | AUDIO_CHIP_MSP34XX |
22 | }; | 22 | }; |
23 | 23 | ||
24 | /* ---------------------------------------------------------------------- */ | ||
25 | |||
26 | /* audio inputs */ | ||
27 | #define AUDIO_TUNER 0x00 | ||
28 | #define AUDIO_RADIO 0x01 | ||
29 | #define AUDIO_EXTERN 0x02 | ||
30 | #define AUDIO_INTERN 0x03 | ||
31 | #define AUDIO_OFF 0x04 | ||
32 | #define AUDIO_ON 0x05 | ||
33 | #define AUDIO_EXTERN_1 AUDIO_EXTERN | ||
34 | #define AUDIO_EXTERN_2 0x06 | ||
35 | #define AUDIO_MUTE 0x80 | ||
36 | #define AUDIO_UNMUTE 0x81 | ||
37 | |||
38 | #endif /* AUDIOCHIP_H */ | 24 | #endif /* AUDIOCHIP_H */ |
diff --git a/include/media/tvaudio.h b/include/media/tvaudio.h new file mode 100644 index 000000000000..6915aafc875a --- /dev/null +++ b/include/media/tvaudio.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | tvaudio.h - definition for tvaudio inputs | ||
3 | |||
4 | Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) | ||
5 | |||
6 | This program is free software; you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License as published by | ||
8 | the Free Software Foundation; either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _TVAUDIO_H | ||
22 | #define _TVAUDIO_H | ||
23 | |||
24 | /* The tvaudio module accepts the following inputs: */ | ||
25 | #define TVAUDIO_INPUT_TUNER 0 | ||
26 | #define TVAUDIO_INPUT_RADIO 1 | ||
27 | #define TVAUDIO_INPUT_EXTERN 2 | ||
28 | #define TVAUDIO_INPUT_INTERN 3 | ||
29 | |||
30 | #endif | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 2360453e7496..07130474a0df 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -123,9 +123,6 @@ enum v4l2_chip_ident { | |||
123 | /* v4l device was opened in Radio mode, to be replaced by VIDIOC_INT_S_TUNER_MODE */ | 123 | /* v4l device was opened in Radio mode, to be replaced by VIDIOC_INT_S_TUNER_MODE */ |
124 | #define AUDC_SET_RADIO _IO('d',88) | 124 | #define AUDC_SET_RADIO _IO('d',88) |
125 | 125 | ||
126 | /* select from TV,radio,extern,MUTE, to be replaced with VIDIOC_INT_S_AUDIO_ROUTING */ | ||
127 | #define AUDC_SET_INPUT _IOW('d',89,int) | ||
128 | |||
129 | /* msp3400 ioctl: will be removed in the near future, to be replaced by | 126 | /* msp3400 ioctl: will be removed in the near future, to be replaced by |
130 | VIDIOC_INT_S_AUDIO_ROUTING. */ | 127 | VIDIOC_INT_S_AUDIO_ROUTING. */ |
131 | struct msp_matrix { | 128 | struct msp_matrix { |
@@ -209,10 +206,10 @@ struct v4l2_routing { | |||
209 | }; | 206 | }; |
210 | 207 | ||
211 | /* These internal commands should be used to define the inputs and outputs | 208 | /* These internal commands should be used to define the inputs and outputs |
212 | of an audio/video chip. They will replace AUDC_SET_INPUT. | 209 | of an audio/video chip. They will replace the v4l2 API commands |
213 | The v4l2 API commands VIDIOC_S/G_INPUT, VIDIOC_S/G_OUTPUT, | 210 | VIDIOC_S/G_INPUT, VIDIOC_S/G_OUTPUT, VIDIOC_S/G_AUDIO and VIDIOC_S/G_AUDOUT |
214 | VIDIOC_S/G_AUDIO and VIDIOC_S/G_AUDOUT are meant to be used by the | 211 | that are meant to be used by the user. |
215 | user. Internally these commands should be used to switch inputs/outputs | 212 | The internal commands should be used to switch inputs/outputs |
216 | because only the driver knows how to map a 'Television' input to the precise | 213 | because only the driver knows how to map a 'Television' input to the precise |
217 | input/output routing of an A/D converter, or a DSP, or a video digitizer. | 214 | input/output routing of an A/D converter, or a DSP, or a video digitizer. |
218 | These four commands should only be sent directly to an i2c device, they | 215 | These four commands should only be sent directly to an i2c device, they |