diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 11:52:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 11:52:18 -0500 |
commit | b05005772f34497eb2b7415a651fe785cbe70e16 (patch) | |
tree | b176aeb7fa9baf69e77ddd83e844727490bfcf28 /drivers/media/video | |
parent | 044f324f6ea5d55391db62fca6a295b2651cb946 (diff) | |
parent | 7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff) |
Merge branch 'origin'
Conflicts:
Documentation/video4linux/CARDLIST.cx88
drivers/media/video/cx88/Kconfig
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/saa7134/saa7134-dvb.c
Resolved as in the original merge by Mauro Carvalho Chehab
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/compat_ioctl32.c | 89 | ||||
-rw-r--r-- | drivers/media/video/cx88/Kconfig | 28 | ||||
-rw-r--r-- | drivers/media/video/mxb.c | 10 |
3 files changed, 64 insertions, 63 deletions
diff --git a/drivers/media/video/compat_ioctl32.c b/drivers/media/video/compat_ioctl32.c index 297c32ab51e3..840fe0177121 100644 --- a/drivers/media/video/compat_ioctl32.c +++ b/drivers/media/video/compat_ioctl32.c | |||
@@ -167,29 +167,32 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user | |||
167 | if (kp->clipcount > 2048) | 167 | if (kp->clipcount > 2048) |
168 | return -EINVAL; | 168 | return -EINVAL; |
169 | if (kp->clipcount) { | 169 | if (kp->clipcount) { |
170 | struct v4l2_clip32 *uclips = compat_ptr(up->clips); | 170 | struct v4l2_clip32 __user *uclips; |
171 | struct v4l2_clip *kclips; | 171 | struct v4l2_clip __user *kclips; |
172 | int n = kp->clipcount; | 172 | int n = kp->clipcount; |
173 | compat_caddr_t p; | ||
173 | 174 | ||
175 | if (get_user(p, &up->clips)) | ||
176 | return -EFAULT; | ||
177 | uclips = compat_ptr(p); | ||
174 | kclips = compat_alloc_user_space(n * sizeof(struct v4l2_clip)); | 178 | kclips = compat_alloc_user_space(n * sizeof(struct v4l2_clip)); |
175 | kp->clips = kclips; | 179 | kp->clips = kclips; |
176 | while (--n >= 0) { | 180 | while (--n >= 0) { |
177 | if (!access_ok(VERIFY_READ, &uclips->c, sizeof(uclips->c)) || | 181 | if (copy_in_user(&kclips->c, &uclips->c, sizeof(uclips->c))) |
178 | copy_from_user(&kclips->c, &uclips->c, sizeof(uclips->c))) | 182 | return -EFAULT; |
183 | if (put_user(n ? kclips + 1 : NULL, &kclips->next)) | ||
179 | return -EFAULT; | 184 | return -EFAULT; |
180 | kclips->next = n ? kclips + 1 : 0; | ||
181 | uclips += 1; | 185 | uclips += 1; |
182 | kclips += 1; | 186 | kclips += 1; |
183 | } | 187 | } |
184 | } else | 188 | } else |
185 | kp->clips = 0; | 189 | kp->clips = NULL; |
186 | return 0; | 190 | return 0; |
187 | } | 191 | } |
188 | 192 | ||
189 | static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) | 193 | static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) |
190 | { | 194 | { |
191 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_window32)) || | 195 | if (copy_to_user(&up->w, &kp->w, sizeof(up->w)) || |
192 | copy_to_user(&up->w, &kp->w, sizeof(up->w)) || | ||
193 | put_user(kp->field, &up->field) || | 196 | put_user(kp->field, &up->field) || |
194 | put_user(kp->chromakey, &up->chromakey) || | 197 | put_user(kp->chromakey, &up->chromakey) || |
195 | put_user(kp->clipcount, &up->clipcount)) | 198 | put_user(kp->clipcount, &up->clipcount)) |
@@ -199,33 +202,29 @@ static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user | |||
199 | 202 | ||
200 | static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) | 203 | static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) |
201 | { | 204 | { |
202 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_pix_format)) || | 205 | if (copy_from_user(kp, up, sizeof(struct v4l2_pix_format))) |
203 | copy_from_user(kp, up, sizeof(struct v4l2_pix_format))) | 206 | return -EFAULT; |
204 | return -EFAULT; | ||
205 | return 0; | 207 | return 0; |
206 | } | 208 | } |
207 | 209 | ||
208 | static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) | 210 | static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) |
209 | { | 211 | { |
210 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_pix_format)) || | 212 | if (copy_to_user(up, kp, sizeof(struct v4l2_pix_format))) |
211 | copy_to_user(up, kp, sizeof(struct v4l2_pix_format))) | 213 | return -EFAULT; |
212 | return -EFAULT; | ||
213 | return 0; | 214 | return 0; |
214 | } | 215 | } |
215 | 216 | ||
216 | static inline int get_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) | 217 | static inline int get_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) |
217 | { | 218 | { |
218 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_vbi_format)) || | 219 | if (copy_from_user(kp, up, sizeof(struct v4l2_vbi_format))) |
219 | copy_from_user(kp, up, sizeof(struct v4l2_vbi_format))) | 220 | return -EFAULT; |
220 | return -EFAULT; | ||
221 | return 0; | 221 | return 0; |
222 | } | 222 | } |
223 | 223 | ||
224 | static inline int put_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) | 224 | static inline int put_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) |
225 | { | 225 | { |
226 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_vbi_format)) || | 226 | if (copy_to_user(up, kp, sizeof(struct v4l2_vbi_format))) |
227 | copy_to_user(up, kp, sizeof(struct v4l2_vbi_format))) | 227 | return -EFAULT; |
228 | return -EFAULT; | ||
229 | return 0; | 228 | return 0; |
230 | } | 229 | } |
231 | 230 | ||
@@ -279,18 +278,16 @@ static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user | |||
279 | 278 | ||
280 | static inline int get_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) | 279 | static inline int get_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) |
281 | { | 280 | { |
282 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard)) || | 281 | if (copy_from_user(kp, up, sizeof(struct v4l2_standard))) |
283 | copy_from_user(kp, up, sizeof(struct v4l2_standard))) | 282 | return -EFAULT; |
284 | return -EFAULT; | ||
285 | return 0; | 283 | return 0; |
286 | 284 | ||
287 | } | 285 | } |
288 | 286 | ||
289 | static inline int put_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) | 287 | static inline int put_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) |
290 | { | 288 | { |
291 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard)) || | 289 | if (copy_to_user(up, kp, sizeof(struct v4l2_standard))) |
292 | copy_to_user(up, kp, sizeof(struct v4l2_standard))) | 290 | return -EFAULT; |
293 | return -EFAULT; | ||
294 | return 0; | 291 | return 0; |
295 | } | 292 | } |
296 | 293 | ||
@@ -328,18 +325,16 @@ static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 | |||
328 | 325 | ||
329 | static inline int get_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) | 326 | static inline int get_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) |
330 | { | 327 | { |
331 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_tuner)) || | 328 | if (copy_from_user(kp, up, sizeof(struct v4l2_tuner))) |
332 | copy_from_user(kp, up, sizeof(struct v4l2_tuner))) | 329 | return -EFAULT; |
333 | return -EFAULT; | ||
334 | return 0; | 330 | return 0; |
335 | 331 | ||
336 | } | 332 | } |
337 | 333 | ||
338 | static inline int put_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) | 334 | static inline int put_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) |
339 | { | 335 | { |
340 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_tuner)) || | 336 | if (copy_to_user(up, kp, sizeof(struct v4l2_tuner))) |
341 | copy_to_user(up, kp, sizeof(struct v4l2_tuner))) | 337 | return -EFAULT; |
342 | return -EFAULT; | ||
343 | return 0; | 338 | return 0; |
344 | } | 339 | } |
345 | 340 | ||
@@ -380,11 +375,13 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user | |||
380 | break; | 375 | break; |
381 | case V4L2_MEMORY_USERPTR: | 376 | case V4L2_MEMORY_USERPTR: |
382 | { | 377 | { |
383 | unsigned long tmp = (unsigned long)compat_ptr(up->m.userptr); | 378 | compat_long_t tmp; |
384 | 379 | ||
385 | if(get_user(kp->length, &up->length) || | 380 | if (get_user(kp->length, &up->length) || |
386 | get_user(kp->m.userptr, &tmp)) | 381 | get_user(tmp, &up->m.userptr)) |
387 | return -EFAULT; | 382 | return -EFAULT; |
383 | |||
384 | kp->m.userptr = (unsigned long)compat_ptr(tmp); | ||
388 | } | 385 | } |
389 | break; | 386 | break; |
390 | case V4L2_MEMORY_OVERLAY: | 387 | case V4L2_MEMORY_OVERLAY: |
@@ -468,33 +465,29 @@ static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame | |||
468 | 465 | ||
469 | static inline int get_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) | 466 | static inline int get_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) |
470 | { | 467 | { |
471 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input) - 4) || | 468 | if (copy_from_user(kp, up, sizeof(struct v4l2_input) - 4)) |
472 | copy_from_user(kp, up, sizeof(struct v4l2_input) - 4)) | 469 | return -EFAULT; |
473 | return -EFAULT; | ||
474 | return 0; | 470 | return 0; |
475 | } | 471 | } |
476 | 472 | ||
477 | static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) | 473 | static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) |
478 | { | 474 | { |
479 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input) - 4) || | 475 | if (copy_to_user(up, kp, sizeof(struct v4l2_input) - 4)) |
480 | copy_to_user(up, kp, sizeof(struct v4l2_input) - 4)) | 476 | return -EFAULT; |
481 | return -EFAULT; | ||
482 | return 0; | 477 | return 0; |
483 | } | 478 | } |
484 | 479 | ||
485 | static inline int get_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) | 480 | static inline int get_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) |
486 | { | 481 | { |
487 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input)) || | 482 | if (copy_from_user(kp, up, sizeof(struct v4l2_input))) |
488 | copy_from_user(kp, up, sizeof(struct v4l2_input))) | 483 | return -EFAULT; |
489 | return -EFAULT; | ||
490 | return 0; | 484 | return 0; |
491 | } | 485 | } |
492 | 486 | ||
493 | static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) | 487 | static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) |
494 | { | 488 | { |
495 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input)) || | 489 | if (copy_to_user(up, kp, sizeof(struct v4l2_input))) |
496 | copy_to_user(up, kp, sizeof(struct v4l2_input))) | 490 | return -EFAULT; |
497 | return -EFAULT; | ||
498 | return 0; | 491 | return 0; |
499 | } | 492 | } |
500 | 493 | ||
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index b52a243c357e..e140996e6ee4 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig | |||
@@ -15,20 +15,6 @@ config VIDEO_CX88 | |||
15 | To compile this driver as a module, choose M here: the | 15 | To compile this driver as a module, choose M here: the |
16 | module will be called cx8800 | 16 | module will be called cx8800 |
17 | 17 | ||
18 | config VIDEO_CX88_DVB | ||
19 | tristate "DVB/ATSC Support for cx2388x based TV cards" | ||
20 | depends on VIDEO_CX88 && DVB_CORE | ||
21 | select VIDEO_BUF_DVB | ||
22 | ---help--- | ||
23 | This adds support for DVB/ATSC cards based on the | ||
24 | Connexant 2388x chip. | ||
25 | |||
26 | To compile this driver as a module, choose M here: the | ||
27 | module will be called cx88-dvb. | ||
28 | |||
29 | You must also select one or more DVB/ATSC demodulators. | ||
30 | If you are unsure which you need, choose all of them. | ||
31 | |||
32 | config VIDEO_CX88_ALSA | 18 | config VIDEO_CX88_ALSA |
33 | tristate "ALSA DMA audio support" | 19 | tristate "ALSA DMA audio support" |
34 | depends on VIDEO_CX88 && SND && EXPERIMENTAL | 20 | depends on VIDEO_CX88 && SND && EXPERIMENTAL |
@@ -44,6 +30,20 @@ config VIDEO_CX88_ALSA | |||
44 | To compile this driver as a module, choose M here: the | 30 | To compile this driver as a module, choose M here: the |
45 | module will be called cx88-alsa. | 31 | module will be called cx88-alsa. |
46 | 32 | ||
33 | config VIDEO_CX88_DVB | ||
34 | tristate "DVB/ATSC Support for cx2388x based TV cards" | ||
35 | depends on VIDEO_CX88 && DVB_CORE | ||
36 | select VIDEO_BUF_DVB | ||
37 | ---help--- | ||
38 | This adds support for DVB/ATSC cards based on the | ||
39 | Connexant 2388x chip. | ||
40 | |||
41 | To compile this driver as a module, choose M here: the | ||
42 | module will be called cx88-dvb. | ||
43 | |||
44 | You must also select one or more DVB/ATSC demodulators. | ||
45 | If you are unsure which you need, choose all of them. | ||
46 | |||
47 | config VIDEO_CX88_DVB_ALL_FRONTENDS | 47 | config VIDEO_CX88_DVB_ALL_FRONTENDS |
48 | bool "Build all supported frontends for cx2388x based TV cards" | 48 | bool "Build all supported frontends for cx2388x based TV cards" |
49 | default y | 49 | default y |
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 69a7eddf3a24..2f154f415bca 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | mxb - v4l2 driver for the Multimedia eXtension Board | 2 | mxb - v4l2 driver for the Multimedia eXtension Board |
3 | 3 | ||
4 | Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de> | 4 | Copyright (C) 1998-2006 Michael Hunold <michael@mihu.de> |
5 | 5 | ||
6 | Visit http://www.mihu.de/linux/saa7146/mxb/ | 6 | Visit http://www.mihu.de/linux/saa7146/mxb/ |
7 | for further details about this card. | 7 | for further details about this card. |
@@ -327,6 +327,7 @@ static int mxb_init_done(struct saa7146_dev* dev) | |||
327 | struct video_decoder_init init; | 327 | struct video_decoder_init init; |
328 | struct i2c_msg msg; | 328 | struct i2c_msg msg; |
329 | struct tuner_setup tun_setup; | 329 | struct tuner_setup tun_setup; |
330 | v4l2_std_id std = V4L2_STD_PAL_BG; | ||
330 | 331 | ||
331 | int i = 0, err = 0; | 332 | int i = 0, err = 0; |
332 | struct tea6415c_multiplex vm; | 333 | struct tea6415c_multiplex vm; |
@@ -361,6 +362,9 @@ static int mxb_init_done(struct saa7146_dev* dev) | |||
361 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, | 362 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, |
362 | &mxb->cur_freq); | 363 | &mxb->cur_freq); |
363 | 364 | ||
365 | /* set a default video standard */ | ||
366 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); | ||
367 | |||
364 | /* mute audio on tea6420s */ | 368 | /* mute audio on tea6420s */ |
365 | mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); | 369 | mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); |
366 | mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]); | 370 | mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]); |
@@ -921,17 +925,21 @@ static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) | |||
921 | int one = 1; | 925 | int one = 1; |
922 | 926 | ||
923 | if(V4L2_STD_PAL_I == std->id ) { | 927 | if(V4L2_STD_PAL_I == std->id ) { |
928 | v4l2_std_id std = V4L2_STD_PAL_I; | ||
924 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); | 929 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); |
925 | /* set the 7146 gpio register -- I don't know what this does exactly */ | 930 | /* set the 7146 gpio register -- I don't know what this does exactly */ |
926 | saa7146_write(dev, GPIO_CTRL, 0x00404050); | 931 | saa7146_write(dev, GPIO_CTRL, 0x00404050); |
927 | /* unset the 7111 gpio register -- I don't know what this does exactly */ | 932 | /* unset the 7111 gpio register -- I don't know what this does exactly */ |
928 | mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero); | 933 | mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero); |
934 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); | ||
929 | } else { | 935 | } else { |
936 | v4l2_std_id std = V4L2_STD_PAL_BG; | ||
930 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); | 937 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); |
931 | /* set the 7146 gpio register -- I don't know what this does exactly */ | 938 | /* set the 7146 gpio register -- I don't know what this does exactly */ |
932 | saa7146_write(dev, GPIO_CTRL, 0x00404050); | 939 | saa7146_write(dev, GPIO_CTRL, 0x00404050); |
933 | /* set the 7111 gpio register -- I don't know what this does exactly */ | 940 | /* set the 7111 gpio register -- I don't know what this does exactly */ |
934 | mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one); | 941 | mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one); |
942 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); | ||
935 | } | 943 | } |
936 | return 0; | 944 | return 0; |
937 | } | 945 | } |