diff options
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-audio-hook.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-audio-hook.c | 173 |
1 files changed, 81 insertions, 92 deletions
diff --git a/drivers/media/video/bt8xx/bttv-audio-hook.c b/drivers/media/video/bt8xx/bttv-audio-hook.c index 1f25cdbed7d6..a075198f8300 100644 --- a/drivers/media/video/bt8xx/bttv-audio-hook.c +++ b/drivers/media/video/bt8xx/bttv-audio-hook.c | |||
@@ -7,22 +7,18 @@ | |||
7 | 7 | ||
8 | #include "bttv-audio-hook.h" | 8 | #include "bttv-audio-hook.h" |
9 | 9 | ||
10 | #include <linux/delay.h> | ||
11 | |||
10 | /* ----------------------------------------------------------------------- */ | 12 | /* ----------------------------------------------------------------------- */ |
11 | /* winview */ | 13 | /* winview */ |
12 | 14 | ||
13 | void winview_audio(struct bttv *btv, struct video_audio *v, int set) | 15 | void winview_volume(struct bttv *btv, __u16 volume) |
14 | { | 16 | { |
15 | /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */ | 17 | /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */ |
16 | int bits_out, loops, vol, data; | 18 | int bits_out, loops, vol, data; |
17 | 19 | ||
18 | if (!set) { | ||
19 | /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */ | ||
20 | v->flags |= VIDEO_AUDIO_VOLUME; | ||
21 | return; | ||
22 | } | ||
23 | |||
24 | /* 32 levels logarithmic */ | 20 | /* 32 levels logarithmic */ |
25 | vol = 32 - ((v->volume>>11)); | 21 | vol = 32 - ((volume>>11)); |
26 | /* units */ | 22 | /* units */ |
27 | bits_out = (PT2254_DBS_IN_2>>(vol%5)); | 23 | bits_out = (PT2254_DBS_IN_2>>(vol%5)); |
28 | /* tens */ | 24 | /* tens */ |
@@ -56,30 +52,28 @@ | |||
56 | /* mono/stereo control for various cards (which don't use i2c chips but */ | 52 | /* mono/stereo control for various cards (which don't use i2c chips but */ |
57 | /* connect something to the GPIO pins */ | 53 | /* connect something to the GPIO pins */ |
58 | 54 | ||
59 | void | 55 | void gvbctv3pci_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
60 | gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set) | ||
61 | { | 56 | { |
62 | unsigned int con = 0; | 57 | unsigned int con = 0; |
63 | 58 | ||
64 | if (set) { | 59 | if (set) { |
65 | gpio_inout(0x300, 0x300); | 60 | gpio_inout(0x300, 0x300); |
66 | if (v->mode & VIDEO_SOUND_LANG1) | 61 | if (t->audmode & V4L2_TUNER_MODE_LANG1) |
67 | con = 0x000; | 62 | con = 0x000; |
68 | if (v->mode & VIDEO_SOUND_LANG2) | 63 | if (t->audmode & V4L2_TUNER_MODE_LANG2) |
69 | con = 0x300; | 64 | con = 0x300; |
70 | if (v->mode & VIDEO_SOUND_STEREO) | 65 | if (t->audmode & V4L2_TUNER_MODE_STEREO) |
71 | con = 0x200; | 66 | con = 0x200; |
72 | /* if (v->mode & VIDEO_SOUND_MONO) | 67 | /* if (t->audmode & V4L2_TUNER_MODE_MONO) |
73 | * con = 0x100; */ | 68 | * con = 0x100; */ |
74 | gpio_bits(0x300, con); | 69 | gpio_bits(0x300, con); |
75 | } else { | 70 | } else { |
76 | v->mode = VIDEO_SOUND_STEREO | | 71 | t->audmode = V4L2_TUNER_MODE_STEREO | |
77 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 72 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
78 | } | 73 | } |
79 | } | 74 | } |
80 | 75 | ||
81 | void | 76 | void gvbctv5pci_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
82 | gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set) | ||
83 | { | 77 | { |
84 | unsigned int val, con; | 78 | unsigned int val, con; |
85 | 79 | ||
@@ -89,8 +83,8 @@ gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set) | |||
89 | val = gpio_read(); | 83 | val = gpio_read(); |
90 | if (set) { | 84 | if (set) { |
91 | con = 0x000; | 85 | con = 0x000; |
92 | if (v->mode & VIDEO_SOUND_LANG2) { | 86 | if (t->audmode & V4L2_TUNER_MODE_LANG2) { |
93 | if (v->mode & VIDEO_SOUND_LANG1) { | 87 | if (t->audmode & V4L2_TUNER_MODE_LANG1) { |
94 | /* LANG1 + LANG2 */ | 88 | /* LANG1 + LANG2 */ |
95 | con = 0x100; | 89 | con = 0x100; |
96 | } | 90 | } |
@@ -107,23 +101,23 @@ gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set) | |||
107 | } else { | 101 | } else { |
108 | switch (val & 0x70) { | 102 | switch (val & 0x70) { |
109 | case 0x10: | 103 | case 0x10: |
110 | v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 104 | t->audmode = V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
111 | break; | 105 | break; |
112 | case 0x30: | 106 | case 0x30: |
113 | v->mode = VIDEO_SOUND_LANG2; | 107 | t->audmode = V4L2_TUNER_MODE_LANG2; |
114 | break; | 108 | break; |
115 | case 0x50: | 109 | case 0x50: |
116 | v->mode = VIDEO_SOUND_LANG1; | 110 | t->audmode = V4L2_TUNER_MODE_LANG1; |
117 | break; | 111 | break; |
118 | case 0x60: | 112 | case 0x60: |
119 | v->mode = VIDEO_SOUND_STEREO; | 113 | t->audmode = V4L2_TUNER_MODE_STEREO; |
120 | break; | 114 | break; |
121 | case 0x70: | 115 | case 0x70: |
122 | v->mode = VIDEO_SOUND_MONO; | 116 | t->audmode = V4L2_TUNER_MODE_MONO; |
123 | break; | 117 | break; |
124 | default: | 118 | default: |
125 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 119 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
126 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 120 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
127 | } | 121 | } |
128 | } | 122 | } |
129 | } | 123 | } |
@@ -141,15 +135,15 @@ gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set) | |||
141 | * handles this with a tda9840 | 135 | * handles this with a tda9840 |
142 | * | 136 | * |
143 | */ | 137 | */ |
144 | void | 138 | |
145 | avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set) | 139 | void avermedia_tvphone_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
146 | { | 140 | { |
147 | int val = 0; | 141 | int val = 0; |
148 | 142 | ||
149 | if (set) { | 143 | if (set) { |
150 | if (v->mode & VIDEO_SOUND_LANG2) /* SAP */ | 144 | if (t->audmode & V4L2_TUNER_MODE_LANG2) /* SAP */ |
151 | val = 0x02; | 145 | val = 0x02; |
152 | if (v->mode & VIDEO_SOUND_STEREO) | 146 | if (t->audmode & V4L2_TUNER_MODE_STEREO) |
153 | val = 0x01; | 147 | val = 0x01; |
154 | if (val) { | 148 | if (val) { |
155 | gpio_bits(0x03,val); | 149 | gpio_bits(0x03,val); |
@@ -157,97 +151,96 @@ avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set) | |||
157 | bttv_gpio_tracking(btv,"avermedia"); | 151 | bttv_gpio_tracking(btv,"avermedia"); |
158 | } | 152 | } |
159 | } else { | 153 | } else { |
160 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 154 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
161 | VIDEO_SOUND_LANG1; | 155 | V4L2_TUNER_MODE_LANG1; |
162 | return; | 156 | return; |
163 | } | 157 | } |
164 | } | 158 | } |
165 | 159 | ||
166 | void | 160 | |
167 | avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set) | 161 | void avermedia_tv_stereo_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
168 | { | 162 | { |
169 | int val = 0; | 163 | int val = 0; |
170 | 164 | ||
171 | if (set) { | 165 | if (set) { |
172 | if (v->mode & VIDEO_SOUND_LANG2) /* SAP */ | 166 | if (t->audmode & V4L2_TUNER_MODE_LANG2) /* SAP */ |
173 | val = 0x01; | 167 | val = 0x01; |
174 | if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */ | 168 | if (t->audmode & V4L2_TUNER_MODE_STEREO) /* STEREO */ |
175 | val = 0x02; | 169 | val = 0x02; |
176 | btaor(val, ~0x03, BT848_GPIO_DATA); | 170 | btaor(val, ~0x03, BT848_GPIO_DATA); |
177 | if (bttv_gpio) | 171 | if (bttv_gpio) |
178 | bttv_gpio_tracking(btv,"avermedia"); | 172 | bttv_gpio_tracking(btv,"avermedia"); |
179 | } else { | 173 | } else { |
180 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 174 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
181 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 175 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
182 | return; | 176 | return; |
183 | } | 177 | } |
184 | } | 178 | } |
185 | 179 | ||
186 | /* Lifetec 9415 handling */ | 180 | /* Lifetec 9415 handling */ |
187 | void | 181 | |
188 | lt9415_audio(struct bttv *btv, struct video_audio *v, int set) | 182 | void lt9415_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
189 | { | 183 | { |
190 | int val = 0; | 184 | int val = 0; |
191 | 185 | ||
192 | if (gpio_read() & 0x4000) { | 186 | if (gpio_read() & 0x4000) { |
193 | v->mode = VIDEO_SOUND_MONO; | 187 | t->audmode = V4L2_TUNER_MODE_MONO; |
194 | return; | 188 | return; |
195 | } | 189 | } |
196 | 190 | ||
197 | if (set) { | 191 | if (set) { |
198 | if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */ | 192 | if (t->audmode & V4L2_TUNER_MODE_LANG2) /* A2 SAP */ |
199 | val = 0x0080; | 193 | val = 0x0080; |
200 | if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */ | 194 | if (t->audmode & V4L2_TUNER_MODE_STEREO) /* A2 stereo */ |
201 | val = 0x0880; | 195 | val = 0x0880; |
202 | if ((v->mode & VIDEO_SOUND_LANG1) || | 196 | if ((t->audmode & V4L2_TUNER_MODE_LANG1) || |
203 | (v->mode & VIDEO_SOUND_MONO)) | 197 | (t->audmode & V4L2_TUNER_MODE_MONO)) |
204 | val = 0; | 198 | val = 0; |
205 | gpio_bits(0x0880, val); | 199 | gpio_bits(0x0880, val); |
206 | if (bttv_gpio) | 200 | if (bttv_gpio) |
207 | bttv_gpio_tracking(btv,"lt9415"); | 201 | bttv_gpio_tracking(btv,"lt9415"); |
208 | } else { | 202 | } else { |
209 | /* autodetect doesn't work with this card :-( */ | 203 | /* autodetect doesn't work with this card :-( */ |
210 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 204 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
211 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 205 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
212 | return; | 206 | return; |
213 | } | 207 | } |
214 | } | 208 | } |
215 | 209 | ||
216 | /* TDA9821 on TerraTV+ Bt848, Bt878 */ | 210 | /* TDA9821 on TerraTV+ Bt848, Bt878 */ |
217 | void | 211 | void terratv_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
218 | terratv_audio(struct bttv *btv, struct video_audio *v, int set) | ||
219 | { | 212 | { |
220 | unsigned int con = 0; | 213 | unsigned int con = 0; |
221 | 214 | ||
222 | if (set) { | 215 | if (set) { |
223 | gpio_inout(0x180000,0x180000); | 216 | gpio_inout(0x180000,0x180000); |
224 | if (v->mode & VIDEO_SOUND_LANG2) | 217 | if (t->audmode & V4L2_TUNER_MODE_LANG2) |
225 | con = 0x080000; | 218 | con = 0x080000; |
226 | if (v->mode & VIDEO_SOUND_STEREO) | 219 | if (t->audmode & V4L2_TUNER_MODE_STEREO) |
227 | con = 0x180000; | 220 | con = 0x180000; |
228 | gpio_bits(0x180000, con); | 221 | gpio_bits(0x180000, con); |
229 | if (bttv_gpio) | 222 | if (bttv_gpio) |
230 | bttv_gpio_tracking(btv,"terratv"); | 223 | bttv_gpio_tracking(btv,"terratv"); |
231 | } else { | 224 | } else { |
232 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 225 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
233 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 226 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
234 | } | 227 | } |
235 | } | 228 | } |
236 | 229 | ||
237 | void | 230 | |
238 | winfast2000_audio(struct bttv *btv, struct video_audio *v, int set) | 231 | void winfast2000_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
239 | { | 232 | { |
240 | unsigned long val = 0; | 233 | unsigned long val = 0; |
241 | 234 | ||
242 | if (set) { | 235 | if (set) { |
243 | /*btor (0xc32000, BT848_GPIO_OUT_EN);*/ | 236 | /*btor (0xc32000, BT848_GPIO_OUT_EN);*/ |
244 | if (v->mode & VIDEO_SOUND_MONO) /* Mono */ | 237 | if (t->audmode & V4L2_TUNER_MODE_MONO) /* Mono */ |
245 | val = 0x420000; | 238 | val = 0x420000; |
246 | if (v->mode & VIDEO_SOUND_LANG1) /* Mono */ | 239 | if (t->audmode & V4L2_TUNER_MODE_LANG1) /* Mono */ |
247 | val = 0x420000; | 240 | val = 0x420000; |
248 | if (v->mode & VIDEO_SOUND_LANG2) /* SAP */ | 241 | if (t->audmode & V4L2_TUNER_MODE_LANG2) /* SAP */ |
249 | val = 0x410000; | 242 | val = 0x410000; |
250 | if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */ | 243 | if (t->audmode & V4L2_TUNER_MODE_STEREO) /* Stereo */ |
251 | val = 0x020000; | 244 | val = 0x020000; |
252 | if (val) { | 245 | if (val) { |
253 | gpio_bits(0x430000, val); | 246 | gpio_bits(0x430000, val); |
@@ -255,8 +248,8 @@ winfast2000_audio(struct bttv *btv, struct video_audio *v, int set) | |||
255 | bttv_gpio_tracking(btv,"winfast2000"); | 248 | bttv_gpio_tracking(btv,"winfast2000"); |
256 | } | 249 | } |
257 | } else { | 250 | } else { |
258 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 251 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
259 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 252 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
260 | } | 253 | } |
261 | } | 254 | } |
262 | 255 | ||
@@ -268,8 +261,7 @@ winfast2000_audio(struct bttv *btv, struct video_audio *v, int set) | |||
268 | * Note: There are card variants without tda9874a. Forcing the "stereo sound route" | 261 | * Note: There are card variants without tda9874a. Forcing the "stereo sound route" |
269 | * will mute this cards. | 262 | * will mute this cards. |
270 | */ | 263 | */ |
271 | void | 264 | void pvbt878p9b_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
272 | pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set) | ||
273 | { | 265 | { |
274 | unsigned int val = 0; | 266 | unsigned int val = 0; |
275 | 267 | ||
@@ -277,11 +269,11 @@ pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set) | |||
277 | return; | 269 | return; |
278 | 270 | ||
279 | if (set) { | 271 | if (set) { |
280 | if (v->mode & VIDEO_SOUND_MONO) { | 272 | if (t->audmode & V4L2_TUNER_MODE_MONO) { |
281 | val = 0x01; | 273 | val = 0x01; |
282 | } | 274 | } |
283 | if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2)) | 275 | if ((t->audmode & (V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2)) |
284 | || (v->mode & VIDEO_SOUND_STEREO)) { | 276 | || (t->audmode & V4L2_TUNER_MODE_STEREO)) { |
285 | val = 0x02; | 277 | val = 0x02; |
286 | } | 278 | } |
287 | if (val) { | 279 | if (val) { |
@@ -290,8 +282,8 @@ pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set) | |||
290 | bttv_gpio_tracking(btv,"pvbt878p9b"); | 282 | bttv_gpio_tracking(btv,"pvbt878p9b"); |
291 | } | 283 | } |
292 | } else { | 284 | } else { |
293 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 285 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
294 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 286 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
295 | } | 287 | } |
296 | } | 288 | } |
297 | 289 | ||
@@ -300,8 +292,7 @@ pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set) | |||
300 | * sound control for FlyVideo 2000S (with tda9874 decoder) | 292 | * sound control for FlyVideo 2000S (with tda9874 decoder) |
301 | * based on pvbt878p9b_audio() - this is not tested, please fix!!! | 293 | * based on pvbt878p9b_audio() - this is not tested, please fix!!! |
302 | */ | 294 | */ |
303 | void | 295 | void fv2000s_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
304 | fv2000s_audio(struct bttv *btv, struct video_audio *v, int set) | ||
305 | { | 296 | { |
306 | unsigned int val = 0xffff; | 297 | unsigned int val = 0xffff; |
307 | 298 | ||
@@ -309,11 +300,11 @@ fv2000s_audio(struct bttv *btv, struct video_audio *v, int set) | |||
309 | return; | 300 | return; |
310 | 301 | ||
311 | if (set) { | 302 | if (set) { |
312 | if (v->mode & VIDEO_SOUND_MONO) { | 303 | if (t->audmode & V4L2_TUNER_MODE_MONO) { |
313 | val = 0x0000; | 304 | val = 0x0000; |
314 | } | 305 | } |
315 | if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2)) | 306 | if ((t->audmode & (V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2)) |
316 | || (v->mode & VIDEO_SOUND_STEREO)) { | 307 | || (t->audmode & V4L2_TUNER_MODE_STEREO)) { |
317 | val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */ | 308 | val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */ |
318 | } | 309 | } |
319 | if (val != 0xffff) { | 310 | if (val != 0xffff) { |
@@ -322,8 +313,8 @@ fv2000s_audio(struct bttv *btv, struct video_audio *v, int set) | |||
322 | bttv_gpio_tracking(btv,"fv2000s"); | 313 | bttv_gpio_tracking(btv,"fv2000s"); |
323 | } | 314 | } |
324 | } else { | 315 | } else { |
325 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 316 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
326 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 317 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
327 | } | 318 | } |
328 | } | 319 | } |
329 | 320 | ||
@@ -331,19 +322,18 @@ fv2000s_audio(struct bttv *btv, struct video_audio *v, int set) | |||
331 | * sound control for Canopus WinDVR PCI | 322 | * sound control for Canopus WinDVR PCI |
332 | * Masaki Suzuki <masaki@btree.org> | 323 | * Masaki Suzuki <masaki@btree.org> |
333 | */ | 324 | */ |
334 | void | 325 | void windvr_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
335 | windvr_audio(struct bttv *btv, struct video_audio *v, int set) | ||
336 | { | 326 | { |
337 | unsigned long val = 0; | 327 | unsigned long val = 0; |
338 | 328 | ||
339 | if (set) { | 329 | if (set) { |
340 | if (v->mode & VIDEO_SOUND_MONO) | 330 | if (t->audmode & V4L2_TUNER_MODE_MONO) |
341 | val = 0x040000; | 331 | val = 0x040000; |
342 | if (v->mode & VIDEO_SOUND_LANG1) | 332 | if (t->audmode & V4L2_TUNER_MODE_LANG1) |
343 | val = 0; | 333 | val = 0; |
344 | if (v->mode & VIDEO_SOUND_LANG2) | 334 | if (t->audmode & V4L2_TUNER_MODE_LANG2) |
345 | val = 0x100000; | 335 | val = 0x100000; |
346 | if (v->mode & VIDEO_SOUND_STEREO) | 336 | if (t->audmode & V4L2_TUNER_MODE_STEREO) |
347 | val = 0; | 337 | val = 0; |
348 | if (val) { | 338 | if (val) { |
349 | gpio_bits(0x140000, val); | 339 | gpio_bits(0x140000, val); |
@@ -351,8 +341,8 @@ windvr_audio(struct bttv *btv, struct video_audio *v, int set) | |||
351 | bttv_gpio_tracking(btv,"windvr"); | 341 | bttv_gpio_tracking(btv,"windvr"); |
352 | } | 342 | } |
353 | } else { | 343 | } else { |
354 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 344 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
355 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 345 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
356 | } | 346 | } |
357 | } | 347 | } |
358 | 348 | ||
@@ -360,8 +350,7 @@ windvr_audio(struct bttv *btv, struct video_audio *v, int set) | |||
360 | * sound control for AD-TVK503 | 350 | * sound control for AD-TVK503 |
361 | * Hiroshi Takekawa <sian@big.or.jp> | 351 | * Hiroshi Takekawa <sian@big.or.jp> |
362 | */ | 352 | */ |
363 | void | 353 | void adtvk503_audio(struct bttv *btv, struct v4l2_tuner *t, int set) |
364 | adtvk503_audio(struct bttv *btv, struct video_audio *v, int set) | ||
365 | { | 354 | { |
366 | unsigned int con = 0xffffff; | 355 | unsigned int con = 0xffffff; |
367 | 356 | ||
@@ -369,13 +358,13 @@ adtvk503_audio(struct bttv *btv, struct video_audio *v, int set) | |||
369 | 358 | ||
370 | if (set) { | 359 | if (set) { |
371 | /* btor(***, BT848_GPIO_OUT_EN); */ | 360 | /* btor(***, BT848_GPIO_OUT_EN); */ |
372 | if (v->mode & VIDEO_SOUND_LANG1) | 361 | if (t->audmode & V4L2_TUNER_MODE_LANG1) |
373 | con = 0x00000000; | 362 | con = 0x00000000; |
374 | if (v->mode & VIDEO_SOUND_LANG2) | 363 | if (t->audmode & V4L2_TUNER_MODE_LANG2) |
375 | con = 0x00180000; | 364 | con = 0x00180000; |
376 | if (v->mode & VIDEO_SOUND_STEREO) | 365 | if (t->audmode & V4L2_TUNER_MODE_STEREO) |
377 | con = 0x00000000; | 366 | con = 0x00000000; |
378 | if (v->mode & VIDEO_SOUND_MONO) | 367 | if (t->audmode & V4L2_TUNER_MODE_MONO) |
379 | con = 0x00060000; | 368 | con = 0x00060000; |
380 | if (con != 0xffffff) { | 369 | if (con != 0xffffff) { |
381 | gpio_bits(0x1e0000,con); | 370 | gpio_bits(0x1e0000,con); |
@@ -383,7 +372,7 @@ adtvk503_audio(struct bttv *btv, struct video_audio *v, int set) | |||
383 | bttv_gpio_tracking(btv, "adtvk503"); | 372 | bttv_gpio_tracking(btv, "adtvk503"); |
384 | } | 373 | } |
385 | } else { | 374 | } else { |
386 | v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO | | 375 | t->audmode = V4L2_TUNER_MODE_MONO | V4L2_TUNER_MODE_STEREO | |
387 | VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 376 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
388 | } | 377 | } |
389 | } | 378 | } |