diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:37:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 11:37:36 -0500 |
commit | 368d17e068f691dba5a4f122c271db5ec9b2ebd6 (patch) | |
tree | 69954cea09e5efd4ad1b8268be0e1733a13b4fae /include | |
parent | a9312fb839e90668d05a90024f3a7e7ff646a4a3 (diff) | |
parent | 22fe087f0139e2f5cbe004f24f84cb1c08b4711e (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (33 commits)
V4L/DVB (3604): V4l printk fix
V4L/DVB (3599c): Whitespace cleanups under Documentation/video4linux
V4L/DVB (3599b): Whitespace cleanups under drivers/media
V4L/DVB (3599a): Move drivers/usb/media to drivers/media/video
V4L/DVB (3599): Implement new routing commands for wm8775 and cs53l32a.
V4L/DVB (3598): Add bit algorithm adapter for the Conexant CX2341X boards.
V4L/DVB (3597): Vivi: fix warning: implicit declaration of function 'in_interrupt'
V4L/DVB (3588): Remove VIDIOC_G/S_AUDOUT from msp3400
V4L/DVB (3587): Always wake thread after routing change.
V4L/DVB (3584): Implement V4L2_TUNER_MODE_LANG1_LANG2 audio mode
V4L/DVB (3582): Implement correct msp3400 input/output routing
V4L/DVB (3581): Add new media/msp3400.h header containing the routing macros
V4L/DVB (3580): Last round of msp3400 cleanups before adding routing commands
V4L/DVB (3579): Move msp_modus to msp3400-kthreads, add JP and KR std detection
V4L/DVB (3578): Make scart definitions easier to handle
V4L/DVB (3577): Cleanup audio input handling
V4L/DVB (3575): Cxusb: fix i2c debug messages for bluebird devices
V4L/DVB (3574): Cxusb: fix debug messages
V4L/DVB (3573): Cxusb: remove FIXME: comment in bluebird_patch_dvico_firmware_download
V4L/DVB (3572): Cxusb: conditionalize gpio write for the medion box
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c-id.h | 1 | ||||
-rw-r--r-- | include/linux/videodev2.h | 1 | ||||
-rw-r--r-- | include/media/audiochip.h | 14 | ||||
-rw-r--r-- | include/media/cs53l32a.h | 34 | ||||
-rw-r--r-- | include/media/i2c-addr.h | 44 | ||||
-rw-r--r-- | include/media/msp3400.h | 226 | ||||
-rw-r--r-- | include/media/rds.h | 44 | ||||
-rw-r--r-- | include/media/saa7146_vv.h | 3 | ||||
-rw-r--r-- | include/media/tvaudio.h | 30 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 19 | ||||
-rw-r--r-- | include/media/video-buf.h | 56 | ||||
-rw-r--r-- | include/media/wm8775.h | 35 |
12 files changed, 462 insertions, 45 deletions
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index ec311bc89439..679b46a6a565 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -184,6 +184,7 @@ | |||
184 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ | 184 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ |
185 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | 185 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ |
186 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | 186 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ |
187 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | ||
187 | 188 | ||
188 | /* --- PCF 8584 based algorithms */ | 189 | /* --- PCF 8584 based algorithms */ |
189 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | 190 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 724cfbf54b8a..2275bfec5b68 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -883,6 +883,7 @@ struct v4l2_modulator | |||
883 | #define V4L2_TUNER_MODE_LANG2 0x0002 | 883 | #define V4L2_TUNER_MODE_LANG2 0x0002 |
884 | #define V4L2_TUNER_MODE_SAP 0x0002 | 884 | #define V4L2_TUNER_MODE_SAP 0x0002 |
885 | #define V4L2_TUNER_MODE_LANG1 0x0003 | 885 | #define V4L2_TUNER_MODE_LANG1 0x0003 |
886 | #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 | ||
886 | 887 | ||
887 | struct v4l2_frequency | 888 | struct v4l2_frequency |
888 | { | 889 | { |
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/cs53l32a.h b/include/media/cs53l32a.h new file mode 100644 index 000000000000..bf76197d3790 --- /dev/null +++ b/include/media/cs53l32a.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | cs53l32a.h - definition for cs53l32a inputs and outputs | ||
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 _CS53L32A_H_ | ||
22 | #define _CS53L32A_H_ | ||
23 | |||
24 | /* There are 2 physical inputs, but the second input can be | ||
25 | placed in two modes, the first mode bypasses the PGA (gain), | ||
26 | the second goes through the PGA. Hence there are three | ||
27 | possible inputs to choose from. */ | ||
28 | |||
29 | /* CS53L32A HW inputs */ | ||
30 | #define CS53L32A_IN0 0 | ||
31 | #define CS53L32A_IN1 1 | ||
32 | #define CS53L32A_IN2 2 | ||
33 | |||
34 | #endif | ||
diff --git a/include/media/i2c-addr.h b/include/media/i2c-addr.h new file mode 100644 index 000000000000..e7ff44a35ca0 --- /dev/null +++ b/include/media/i2c-addr.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * V4L I2C address list | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | ||
6 | * Based on a previous mapping by | ||
7 | * Ralph Metzler (rjkm@thp.uni-koeln.de) | ||
8 | * Gerd Knorr <kraxel@goldbach.in-berlin.de> | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | /* bttv address list */ | ||
13 | #define I2C_ADDR_TSA5522 0xc2 | ||
14 | #define I2C_ADDR_TDA7432 0x8a | ||
15 | #define I2C_ADDR_BT832_ALT1 0x88 | ||
16 | #define I2C_ADDR_BT832_ALT2 0x8a // alternate setting | ||
17 | #define I2C_ADDR_TDA8425 0x82 | ||
18 | #define I2C_ADDR_TDA9840 0x84 | ||
19 | #define I2C_ADDR_TDA9850 0xb6 /* also used by 9855,9873 */ | ||
20 | #define I2C_ADDR_TDA9874 0xb0 /* also used by 9875 */ | ||
21 | #define I2C_ADDR_TDA9875 0xb0 | ||
22 | #define I2C_ADDR_HAUPEE 0xa0 | ||
23 | #define I2C_ADDR_STBEE 0xae | ||
24 | #define I2C_ADDR_VHX 0xc0 | ||
25 | #define I2C_ADDR_MSP3400 0x80 | ||
26 | #define I2C_ADDR_MSP3400_ALT 0x88 | ||
27 | #define I2C_ADDR_TEA6300 0x80 /* also used by 6320 */ | ||
28 | #define I2C_ADDR_DPL3518 0x84 | ||
29 | #define I2C_ADDR_TDA9887 0x86 | ||
30 | |||
31 | /* | ||
32 | * i2c bus addresses for the chips supported by tvaudio.c | ||
33 | */ | ||
34 | |||
35 | #define I2C_ADDR_TDA8425 0x82 | ||
36 | #define I2C_ADDR_TDA9840 0x84 /* also used by TA8874Z */ | ||
37 | #define I2C_ADDR_TDA985x_L 0xb4 /* also used by 9873 */ | ||
38 | #define I2C_ADDR_TDA985x_H 0xb6 | ||
39 | #define I2C_ADDR_TDA9874 0xb0 /* also used by 9875 */ | ||
40 | |||
41 | #define I2C_ADDR_TEA6300 0x80 /* also used by 6320 */ | ||
42 | #define I2C_ADDR_TEA6420 0x98 | ||
43 | |||
44 | #define I2C_ADDR_PIC16C54 0x96 /* PV951 */ | ||
diff --git a/include/media/msp3400.h b/include/media/msp3400.h new file mode 100644 index 000000000000..0be61a021d45 --- /dev/null +++ b/include/media/msp3400.h | |||
@@ -0,0 +1,226 @@ | |||
1 | /* | ||
2 | msp3400.h - definition for msp3400 inputs and outputs | ||
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 _MSP3400_H_ | ||
22 | #define _MSP3400_H_ | ||
23 | |||
24 | /* msp3400 routing | ||
25 | =============== | ||
26 | |||
27 | The msp3400 has a complicated routing scheme with many possible | ||
28 | combinations. The details are all in the datasheets but I will try | ||
29 | to give a short description here. | ||
30 | |||
31 | Inputs | ||
32 | ====== | ||
33 | |||
34 | There are 1) tuner inputs, 2) I2S inputs, 3) SCART inputs. You will have | ||
35 | to select which tuner input to use and which SCART input to use. The | ||
36 | selected tuner input, the selected SCART input and all I2S inputs go to | ||
37 | the DSP (the tuner input first goes through the demodulator). | ||
38 | |||
39 | The DSP handles things like volume, bass/treble, balance, and some chips | ||
40 | have support for surround sound. It has several outputs: MAIN, AUX, I2S | ||
41 | and SCART1/2. Each output can select which DSP input to use. So the MAIN | ||
42 | output can select the tuner input while at the same time the SCART1 output | ||
43 | uses the I2S input. | ||
44 | |||
45 | Outputs | ||
46 | ======= | ||
47 | |||
48 | Most DSP outputs are also the outputs of the msp3400. However, the SCART | ||
49 | outputs of the msp3400 can select which input to use: either the SCART1 or | ||
50 | SCART2 output from the DSP, or the msp3400 SCART inputs, thus completely | ||
51 | bypassing the DSP. | ||
52 | |||
53 | Summary | ||
54 | ======= | ||
55 | |||
56 | So to specify a complete routing scheme for the msp3400 you will have to | ||
57 | specify in the 'input' field of the v4l2_routing struct: | ||
58 | |||
59 | 1) which tuner input to use | ||
60 | 2) which SCART input to use | ||
61 | 3) which DSP input to use for each DSP output | ||
62 | |||
63 | And in the 'output' field of the v4l2_routing struct you specify: | ||
64 | |||
65 | 1) which SCART input to use for each SCART output | ||
66 | |||
67 | Depending on how the msp is wired to the other components you can | ||
68 | ignore or mute certain inputs or outputs. | ||
69 | |||
70 | Also, depending on the msp version only a subset of the inputs or | ||
71 | outputs may be present. At the end of this header some tables are | ||
72 | added containing a list of what is available for each msp version. | ||
73 | */ | ||
74 | |||
75 | /* Inputs to the DSP unit: two independent selections have to be made: | ||
76 | 1) the tuner (SIF) input | ||
77 | 2) the SCART input | ||
78 | Bits 0-2 are used for the SCART input select, bit 3 is used for the tuner | ||
79 | input, bits 4-7 are reserved. | ||
80 | */ | ||
81 | |||
82 | /* SCART input to DSP selection */ | ||
83 | #define MSP_IN_SCART_1 0 /* Pin SC1_IN */ | ||
84 | #define MSP_IN_SCART_2 1 /* Pin SC2_IN */ | ||
85 | #define MSP_IN_SCART_3 2 /* Pin SC3_IN */ | ||
86 | #define MSP_IN_SCART_4 3 /* Pin SC4_IN */ | ||
87 | #define MSP_IN_MONO 6 /* Pin MONO_IN */ | ||
88 | #define MSP_IN_MUTE 7 /* Mute DSP input */ | ||
89 | #define MSP_SCART_TO_DSP(in) (in) | ||
90 | /* Tuner input to demodulator and DSP selection */ | ||
91 | #define MSP_IN_TUNER_1 0 /* Analog Sound IF input pin ANA_IN1 */ | ||
92 | #define MSP_IN_TUNER_2 1 /* Analog Sound IF input pin ANA_IN2 */ | ||
93 | #define MSP_TUNER_TO_DSP(in) ((in) << 3) | ||
94 | |||
95 | /* The msp has up to 5 DSP outputs, each output can independently select | ||
96 | a DSP input. | ||
97 | |||
98 | The DSP outputs are: loudspeaker output (aka MAIN), headphones output | ||
99 | (aka AUX), SCART1 DA output, SCART2 DA output and an I2S output. | ||
100 | There also is a quasi-peak detector output, but that is not used by | ||
101 | this driver and is set to the same input as the loudspeaker output. | ||
102 | Not all outputs are supported by all msp models. Setting the input | ||
103 | of an unsupported output will be ignored by the driver. | ||
104 | |||
105 | There are up to 16 DSP inputs to choose from, so each output is | ||
106 | assigned 4 bits. | ||
107 | |||
108 | Note: the 44x8G can mix two inputs and feed the result back to the | ||
109 | DSP. This is currently not implemented. Also not implemented is the | ||
110 | multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate | ||
111 | a need for one of those features then additional support can be added. */ | ||
112 | #define MSP_DSP_OUT_TUNER 0 /* Tuner output */ | ||
113 | #define MSP_DSP_OUT_SCART 2 /* SCART output */ | ||
114 | #define MSP_DSP_OUT_I2S1 5 /* I2S1 output */ | ||
115 | #define MSP_DSP_OUT_I2S2 6 /* I2S2 output */ | ||
116 | #define MSP_DSP_OUT_I2S3 7 /* I2S3 output */ | ||
117 | #define MSP_DSP_OUT_MAIN_AVC 11 /* MAIN AVC processed output */ | ||
118 | #define MSP_DSP_OUT_MAIN 12 /* MAIN output */ | ||
119 | #define MSP_DSP_OUT_AUX 13 /* AUX output */ | ||
120 | #define MSP_DSP_TO_MAIN(in) ((in) << 4) | ||
121 | #define MSP_DSP_TO_AUX(in) ((in) << 8) | ||
122 | #define MSP_DSP_TO_SCART1(in) ((in) << 12) | ||
123 | #define MSP_DSP_TO_SCART2(in) ((in) << 16) | ||
124 | #define MSP_DSP_TO_I2S(in) ((in) << 20) | ||
125 | |||
126 | /* Output SCART select: the SCART outputs can select which input | ||
127 | to use. */ | ||
128 | #define MSP_OUT_SCART1 0 /* SCART1 input, bypassing the DSP */ | ||
129 | #define MSP_OUT_SCART2 1 /* SCART2 input, bypassing the DSP */ | ||
130 | #define MSP_OUT_SCART3 2 /* SCART3 input, bypassing the DSP */ | ||
131 | #define MSP_OUT_SCART4 3 /* SCART4 input, bypassing the DSP */ | ||
132 | #define MSP_OUT_SCART1_DA 4 /* DSP SCART1 output */ | ||
133 | #define MSP_OUT_SCART2_DA 5 /* DSP SCART2 output */ | ||
134 | #define MSP_OUT_MONO 6 /* MONO input, bypassing the DSP */ | ||
135 | #define MSP_OUT_MUTE 7 /* MUTE output */ | ||
136 | #define MSP_OUT_TO_SCART1(in) (in) | ||
137 | #define MSP_OUT_TO_SCART2(in) ((in) << 4) | ||
138 | |||
139 | /* Shortcut macros */ | ||
140 | #define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ | ||
141 | (MSP_SCART_TO_DSP(sc) | \ | ||
142 | MSP_TUNER_TO_DSP(t) | \ | ||
143 | MSP_DSP_TO_MAIN(main_aux_src) | \ | ||
144 | MSP_DSP_TO_AUX(main_aux_src) | \ | ||
145 | MSP_DSP_TO_SCART1(sc_i2s_src) | \ | ||
146 | MSP_DSP_TO_SCART2(sc_i2s_src) | \ | ||
147 | MSP_DSP_TO_I2S(sc_i2s_src)) | ||
148 | #define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, \ | ||
149 | MSP_DSP_OUT_TUNER, MSP_DSP_OUT_TUNER) | ||
150 | #define MSP_OUTPUT(sc) \ | ||
151 | (MSP_OUT_TO_SCART1(sc) | \ | ||
152 | MSP_OUT_TO_SCART2(sc)) | ||
153 | /* This equals the RESET position of the msp3400 ACB register */ | ||
154 | #define MSP_OUTPUT_DEFAULT (MSP_OUT_TO_SCART1(MSP_OUT_SCART3) | \ | ||
155 | MSP_OUT_TO_SCART2(MSP_OUT_SCART1_DA)) | ||
156 | |||
157 | /* Tuner inputs vs. msp version */ | ||
158 | /* Chip TUNER_1 TUNER_2 | ||
159 | ------------------------- | ||
160 | msp34x0b y y | ||
161 | msp34x0c y y | ||
162 | msp34x0d y y | ||
163 | msp34x5d y n | ||
164 | msp34x7d y n | ||
165 | msp34x0g y y | ||
166 | msp34x1g y y | ||
167 | msp34x2g y y | ||
168 | msp34x5g y n | ||
169 | msp34x7g y n | ||
170 | msp44x0g y y | ||
171 | msp44x8g y y | ||
172 | */ | ||
173 | |||
174 | /* SCART inputs vs. msp version */ | ||
175 | /* Chip SC1 SC2 SC3 SC4 | ||
176 | ------------------------- | ||
177 | msp34x0b y y y n | ||
178 | msp34x0c y y y n | ||
179 | msp34x0d y y y y | ||
180 | msp34x5d y y n n | ||
181 | msp34x7d y n n n | ||
182 | msp34x0g y y y y | ||
183 | msp34x1g y y y y | ||
184 | msp34x2g y y y y | ||
185 | msp34x5g y y n n | ||
186 | msp34x7g y n n n | ||
187 | msp44x0g y y y y | ||
188 | msp44x8g y y y y | ||
189 | */ | ||
190 | |||
191 | /* DSP inputs vs. msp version (tuner and SCART inputs are always available) */ | ||
192 | /* Chip I2S1 I2S2 I2S3 MAIN_AVC MAIN AUX | ||
193 | ------------------------------------------ | ||
194 | msp34x0b y n n n n n | ||
195 | msp34x0c y y n n n n | ||
196 | msp34x0d y y n n n n | ||
197 | msp34x5d y y n n n n | ||
198 | msp34x7d n n n n n n | ||
199 | msp34x0g y y n n n n | ||
200 | msp34x1g y y n n n n | ||
201 | msp34x2g y y n y y y | ||
202 | msp34x5g y y n n n n | ||
203 | msp34x7g n n n n n n | ||
204 | msp44x0g y y y y y y | ||
205 | msp44x8g y y y n n n | ||
206 | */ | ||
207 | |||
208 | /* DSP outputs vs. msp version */ | ||
209 | /* Chip MAIN AUX SCART1 SCART2 I2S | ||
210 | ------------------------------------ | ||
211 | msp34x0b y y y n y | ||
212 | msp34x0c y y y n y | ||
213 | msp34x0d y y y y y | ||
214 | msp34x5d y n y n y | ||
215 | msp34x7d y n y n n | ||
216 | msp34x0g y y y y y | ||
217 | msp34x1g y y y y y | ||
218 | msp34x2g y y y y y | ||
219 | msp34x5g y n y n y | ||
220 | msp34x7g y n y n n | ||
221 | msp44x0g y y y y y | ||
222 | msp44x8g y y y y y | ||
223 | */ | ||
224 | |||
225 | #endif /* MSP3400_H */ | ||
226 | |||
diff --git a/include/media/rds.h b/include/media/rds.h new file mode 100644 index 000000000000..951c1ae0be74 --- /dev/null +++ b/include/media/rds.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | |||
3 | Types and defines needed for RDS. This is included by | ||
4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants | ||
5 | to use the saa6588 module. | ||
6 | |||
7 | Instead of having a seperate rds.h, I'd prefer to include | ||
8 | this stuff in one of the already existing files like tuner.h | ||
9 | |||
10 | (c) 2005 by Hans J. Koch | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of the GNU General Public License as published by | ||
14 | the Free Software Foundation; either version 2 of the License, or | ||
15 | (at your option) any later version. | ||
16 | |||
17 | This program is distributed in the hope that it will be useful, | ||
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | GNU General Public License for more details. | ||
21 | |||
22 | You should have received a copy of the GNU General Public License | ||
23 | along with this program; if not, write to the Free Software | ||
24 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | |||
26 | */ | ||
27 | |||
28 | #ifndef _RDS_H | ||
29 | #define _RDS_H | ||
30 | |||
31 | struct rds_command { | ||
32 | unsigned int block_count; | ||
33 | int result; | ||
34 | unsigned char __user *buffer; | ||
35 | struct file *instance; | ||
36 | poll_table *event_list; | ||
37 | }; | ||
38 | |||
39 | #define RDS_CMD_OPEN _IOW('R',1,int) | ||
40 | #define RDS_CMD_CLOSE _IOW('R',2,int) | ||
41 | #define RDS_CMD_READ _IOR('R',3,int) | ||
42 | #define RDS_CMD_POLL _IOR('R',4,int) | ||
43 | |||
44 | #endif | ||
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index e5e749e984ee..4507cb61ae93 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -197,7 +197,8 @@ void saa7146_buffer_finish(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, | |||
197 | void saa7146_buffer_next(struct saa7146_dev *dev, struct saa7146_dmaqueue *q,int vbi); | 197 | void saa7146_buffer_next(struct saa7146_dev *dev, struct saa7146_dmaqueue *q,int vbi); |
198 | int saa7146_buffer_queue(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, struct saa7146_buf *buf); | 198 | int saa7146_buffer_queue(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, struct saa7146_buf *buf); |
199 | void saa7146_buffer_timeout(unsigned long data); | 199 | void saa7146_buffer_timeout(unsigned long data); |
200 | void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf); | 200 | void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, |
201 | struct saa7146_buf *buf); | ||
201 | 202 | ||
202 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); | 203 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); |
203 | int saa7146_vv_release(struct saa7146_dev* dev); | 204 | int saa7146_vv_release(struct saa7146_dev* dev); |
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..642520acdfa7 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -123,17 +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 | ||
130 | VIDIOC_INT_S_AUDIO_ROUTING. */ | ||
131 | struct msp_matrix { | ||
132 | int input; | ||
133 | int output; | ||
134 | }; | ||
135 | #define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix) | ||
136 | |||
137 | /* tuner ioctls */ | 126 | /* tuner ioctls */ |
138 | 127 | ||
139 | /* Sets tuner type and its I2C addr */ | 128 | /* Sets tuner type and its I2C addr */ |
@@ -209,10 +198,10 @@ struct v4l2_routing { | |||
209 | }; | 198 | }; |
210 | 199 | ||
211 | /* These internal commands should be used to define the inputs and outputs | 200 | /* These internal commands should be used to define the inputs and outputs |
212 | of an audio/video chip. They will replace AUDC_SET_INPUT. | 201 | 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, | 202 | 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 | 203 | that are meant to be used by the user. |
215 | user. Internally these commands should be used to switch inputs/outputs | 204 | 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 | 205 | 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. | 206 | 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 | 207 | These four commands should only be sent directly to an i2c device, they |
diff --git a/include/media/video-buf.h b/include/media/video-buf.h index d90dec5484ee..fff3fd0fbf94 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h | |||
@@ -1,15 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * generic helper functions for video4linux capture buffers, to handle | 3 | * generic helper functions for video4linux capture buffers, to handle |
4 | * memory management and PCI DMA. Right now bttv + saa7134 use it. | 4 | * memory management and PCI DMA. |
5 | * Right now, bttv, saa7134, saa7146 and cx88 use it. | ||
5 | * | 6 | * |
6 | * The functions expect the hardware being able to scatter gatter | 7 | * The functions expect the hardware being able to scatter gatter |
7 | * (i.e. the buffers are not linear in physical memory, but fragmented | 8 | * (i.e. the buffers are not linear in physical memory, but fragmented |
8 | * into PAGE_SIZE chunks). They also assume the driver does not need | 9 | * into PAGE_SIZE chunks). They also assume the driver does not need |
9 | * to touch the video data (thus it is probably not useful for USB as | 10 | * to touch the video data. |
10 | * data often must be uncompressed by the drivers). | 11 | * |
12 | * device specific map/unmap/sync stuff now are mapped as file operations | ||
13 | * to allow its usage by USB and virtual devices. | ||
11 | * | 14 | * |
12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 15 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
16 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | ||
17 | * (c) 2006 Ted Walther and John Sokol | ||
13 | * | 18 | * |
14 | * This program is free software; you can redistribute it and/or modify | 19 | * This program is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License as published by | 20 | * it under the terms of the GNU General Public License as published by |
@@ -38,6 +43,9 @@ struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); | |||
38 | struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, | 43 | struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, |
39 | int offset); | 44 | int offset); |
40 | 45 | ||
46 | struct videobuf_buffer; | ||
47 | struct videobuf_queue; | ||
48 | |||
41 | /* --------------------------------------------------------------------- */ | 49 | /* --------------------------------------------------------------------- */ |
42 | 50 | ||
43 | /* | 51 | /* |
@@ -49,7 +57,7 @@ struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, | |||
49 | * pointer + length. The kernel version just wants the size and | 57 | * pointer + length. The kernel version just wants the size and |
50 | * does memory allocation too using vmalloc_32(). | 58 | * does memory allocation too using vmalloc_32(). |
51 | * | 59 | * |
52 | * videobuf_dma_pci_*() | 60 | * videobuf_dma_*() |
53 | * see Documentation/DMA-mapping.txt, these functions to | 61 | * see Documentation/DMA-mapping.txt, these functions to |
54 | * basically the same. The map function does also build a | 62 | * basically the same. The map function does also build a |
55 | * scatterlist for the buffer (and unmap frees it ...) | 63 | * scatterlist for the buffer (and unmap frees it ...) |
@@ -86,12 +94,18 @@ int videobuf_dma_init_kernel(struct videobuf_dmabuf *dma, int direction, | |||
86 | int nr_pages); | 94 | int nr_pages); |
87 | int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, | 95 | int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, |
88 | dma_addr_t addr, int nr_pages); | 96 | dma_addr_t addr, int nr_pages); |
89 | int videobuf_dma_pci_map(struct pci_dev *dev, struct videobuf_dmabuf *dma); | ||
90 | int videobuf_dma_pci_sync(struct pci_dev *dev, | ||
91 | struct videobuf_dmabuf *dma); | ||
92 | int videobuf_dma_pci_unmap(struct pci_dev *dev, struct videobuf_dmabuf *dma); | ||
93 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | 97 | int videobuf_dma_free(struct videobuf_dmabuf *dma); |
94 | 98 | ||
99 | int videobuf_dma_map(struct videobuf_queue* q,struct videobuf_dmabuf *dma); | ||
100 | int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma); | ||
101 | int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma); | ||
102 | |||
103 | /*FIXME: these variants are used only on *-alsa code, where videobuf is | ||
104 | * used without queue | ||
105 | */ | ||
106 | int videobuf_pci_dma_map(struct pci_dev *pci,struct videobuf_dmabuf *dma); | ||
107 | int videobuf_pci_dma_unmap(struct pci_dev *pci,struct videobuf_dmabuf *dma); | ||
108 | |||
95 | /* --------------------------------------------------------------------- */ | 109 | /* --------------------------------------------------------------------- */ |
96 | 110 | ||
97 | /* | 111 | /* |
@@ -115,9 +129,6 @@ int videobuf_dma_free(struct videobuf_dmabuf *dma); | |||
115 | * | 129 | * |
116 | */ | 130 | */ |
117 | 131 | ||
118 | struct videobuf_buffer; | ||
119 | struct videobuf_queue; | ||
120 | |||
121 | struct videobuf_mapping { | 132 | struct videobuf_mapping { |
122 | unsigned int count; | 133 | unsigned int count; |
123 | unsigned long start; | 134 | unsigned long start; |
@@ -164,6 +175,10 @@ struct videobuf_buffer { | |||
164 | struct timeval ts; | 175 | struct timeval ts; |
165 | }; | 176 | }; |
166 | 177 | ||
178 | typedef int (vb_map_sg_t)(void *dev,struct scatterlist *sglist,int nr_pages, | ||
179 | int direction); | ||
180 | |||
181 | |||
167 | struct videobuf_queue_ops { | 182 | struct videobuf_queue_ops { |
168 | int (*buf_setup)(struct videobuf_queue *q, | 183 | int (*buf_setup)(struct videobuf_queue *q, |
169 | unsigned int *count, unsigned int *size); | 184 | unsigned int *count, unsigned int *size); |
@@ -174,12 +189,20 @@ struct videobuf_queue_ops { | |||
174 | struct videobuf_buffer *vb); | 189 | struct videobuf_buffer *vb); |
175 | void (*buf_release)(struct videobuf_queue *q, | 190 | void (*buf_release)(struct videobuf_queue *q, |
176 | struct videobuf_buffer *vb); | 191 | struct videobuf_buffer *vb); |
192 | |||
193 | /* Helper operations - device dependent. | ||
194 | * If null, videobuf_init defaults all to PCI handling | ||
195 | */ | ||
196 | |||
197 | vb_map_sg_t *vb_map_sg; | ||
198 | vb_map_sg_t *vb_dma_sync_sg; | ||
199 | vb_map_sg_t *vb_unmap_sg; | ||
177 | }; | 200 | }; |
178 | 201 | ||
179 | struct videobuf_queue { | 202 | struct videobuf_queue { |
180 | struct mutex lock; | 203 | struct mutex lock; |
181 | spinlock_t *irqlock; | 204 | spinlock_t *irqlock; |
182 | struct pci_dev *pci; | 205 | void *dev; /* on pci, points to struct pci_dev */ |
183 | 206 | ||
184 | enum v4l2_buf_type type; | 207 | enum v4l2_buf_type type; |
185 | unsigned int inputs; /* for V4L2_BUF_FLAG_INPUT */ | 208 | unsigned int inputs; /* for V4L2_BUF_FLAG_INPUT */ |
@@ -204,12 +227,15 @@ struct videobuf_queue { | |||
204 | 227 | ||
205 | void* videobuf_alloc(unsigned int size); | 228 | void* videobuf_alloc(unsigned int size); |
206 | int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); | 229 | int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); |
207 | int videobuf_iolock(struct pci_dev *pci, struct videobuf_buffer *vb, | 230 | int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, |
208 | struct v4l2_framebuffer *fbuf); | 231 | struct v4l2_framebuffer *fbuf); |
232 | |||
233 | /* Maps fops to PCI stuff */ | ||
234 | void videobuf_queue_pci(struct videobuf_queue* q); | ||
209 | 235 | ||
210 | void videobuf_queue_init(struct videobuf_queue *q, | 236 | void videobuf_queue_init(struct videobuf_queue *q, |
211 | struct videobuf_queue_ops *ops, | 237 | struct videobuf_queue_ops *ops, |
212 | struct pci_dev *pci, | 238 | void *dev, |
213 | spinlock_t *irqlock, | 239 | spinlock_t *irqlock, |
214 | enum v4l2_buf_type type, | 240 | enum v4l2_buf_type type, |
215 | enum v4l2_field field, | 241 | enum v4l2_field field, |
diff --git a/include/media/wm8775.h b/include/media/wm8775.h new file mode 100644 index 000000000000..60739c5a23ae --- /dev/null +++ b/include/media/wm8775.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | wm8775.h - definition for wm8775 inputs and outputs | ||
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 _WM8775_H_ | ||
22 | #define _WM8775_H_ | ||
23 | |||
24 | /* The WM8775 has 4 inputs and one output. Zero or more inputs | ||
25 | are multiplexed together to the output. Hence there are | ||
26 | 16 combinations. | ||
27 | If only one input is active (the normal case) then the | ||
28 | input values 1, 2, 4 or 8 should be used. */ | ||
29 | |||
30 | #define WM8775_AIN1 1 | ||
31 | #define WM8775_AIN2 2 | ||
32 | #define WM8775_AIN3 4 | ||
33 | #define WM8775_AIN4 8 | ||
34 | |||
35 | #endif | ||