video(9): Make softc argument mandatory for video_attach_mi. No separate video_attach_mi_softc function any more.diff -r1.44 -r1.45 src/sys/dev/video.c
(riastradh)
--- src/sys/dev/video.c 2022/03/03 06:22:23 1.44
+++ src/sys/dev/video.c 2022/03/03 06:23:25 1.45
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: video.c,v 1.44 2022/03/03 06:22:23 riastradh Exp $ */ | 1 | /* $NetBSD: video.c,v 1.45 2022/03/03 06:23:25 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2008 Patrick Mahoney <pat@polycrystal.org> | 4 | * Copyright (c) 2008 Patrick Mahoney <pat@polycrystal.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code was written by Patrick Mahoney (pat@polycrystal.org) as | 7 | * This code was written by Patrick Mahoney (pat@polycrystal.org) as | |
8 | * part of Google Summer of Code 2008. | 8 | * part of Google Summer of Code 2008. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * This ia a Video4Linux 2 compatible /dev/video driver for NetBSD | 33 | * This ia a Video4Linux 2 compatible /dev/video driver for NetBSD | |
34 | * | 34 | * | |
35 | * See http://v4l2spec.bytesex.org/ for Video4Linux 2 specifications | 35 | * See http://v4l2spec.bytesex.org/ for Video4Linux 2 specifications | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: video.c,v 1.44 2022/03/03 06:22:23 riastradh Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: video.c,v 1.45 2022/03/03 06:23:25 riastradh Exp $"); | |
40 | 40 | |||
41 | #include "video.h" | 41 | #include "video.h" | |
42 | #if NVIDEO > 0 | 42 | #if NVIDEO > 0 | |
43 | 43 | |||
44 | #include <sys/param.h> | 44 | #include <sys/param.h> | |
45 | #include <sys/ioctl.h> | 45 | #include <sys/ioctl.h> | |
46 | #include <sys/fcntl.h> | 46 | #include <sys/fcntl.h> | |
47 | #include <sys/vnode.h> | 47 | #include <sys/vnode.h> | |
48 | #include <sys/poll.h> | 48 | #include <sys/poll.h> | |
49 | #include <sys/select.h> | 49 | #include <sys/select.h> | |
50 | #include <sys/kmem.h> | 50 | #include <sys/kmem.h> | |
51 | #include <sys/pool.h> | 51 | #include <sys/pool.h> | |
52 | #include <sys/conf.h> | 52 | #include <sys/conf.h> | |
@@ -418,39 +418,27 @@ video_print(void *aux, const char *pnp) | @@ -418,39 +418,27 @@ video_print(void *aux, const char *pnp) | |||
418 | aprint_normal("%s at %s\n", "video", pnp); | 418 | aprint_normal("%s at %s\n", "video", pnp); | |
419 | } else { | 419 | } else { | |
420 | DPRINTF(("video_print: pnp is NULL\n")); | 420 | DPRINTF(("video_print: pnp is NULL\n")); | |
421 | } | 421 | } | |
422 | return UNCONF; | 422 | return UNCONF; | |
423 | } | 423 | } | |
424 | 424 | |||
425 | 425 | |||
426 | /* | 426 | /* | |
427 | * Called from hardware driver. This is where the MI audio driver | 427 | * Called from hardware driver. This is where the MI audio driver | |
428 | * gets probed/attached to the hardware driver. | 428 | * gets probed/attached to the hardware driver. | |
429 | */ | 429 | */ | |
430 | device_t | 430 | device_t | |
431 | video_attach_mi(const struct video_hw_if *hw_if, device_t parent) | 431 | video_attach_mi(const struct video_hw_if *hw_if, device_t parent, void *sc) | |
432 | { | |||
433 | struct video_attach_args args; | |||
434 | ||||
435 | args.hw_if = hw_if; | |||
436 | args.hw_softc = device_private(parent); | |||
437 | return config_found(parent, &args, video_print, | |||
438 | CFARGS(.iattr = "videobus")); | |||
439 | } | |||
440 | ||||
441 | device_t | |||
442 | video_attach_mi_softc(const struct video_hw_if *hw_if, device_t parent, | |||
443 | void *sc) | |||
444 | { | 432 | { | |
445 | struct video_attach_args args; | 433 | struct video_attach_args args; | |
446 | 434 | |||
447 | args.hw_if = hw_if; | 435 | args.hw_if = hw_if; | |
448 | args.hw_softc = sc; | 436 | args.hw_softc = sc; | |
449 | return config_found(parent, &args, video_print, | 437 | return config_found(parent, &args, video_print, | |
450 | CFARGS(.iattr = "videobus")); | 438 | CFARGS(.iattr = "videobus")); | |
451 | } | 439 | } | |
452 | 440 | |||
453 | /* video_submit_payload - called by hardware driver to submit payload data */ | 441 | /* video_submit_payload - called by hardware driver to submit payload data */ | |
454 | void | 442 | void | |
455 | video_submit_payload(device_t self, const struct video_payload *payload) | 443 | video_submit_payload(device_t self, const struct video_payload *payload) | |
456 | { | 444 | { |
--- src/sys/dev/video_if.h 2022/03/03 06:22:23 1.10
+++ src/sys/dev/video_if.h 2022/03/03 06:23:25 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: video_if.h,v 1.10 2022/03/03 06:22:23 riastradh Exp $ */ | 1 | /* $NetBSD: video_if.h,v 1.11 2022/03/03 06:23:25 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2008 Patrick Mahoney <pat@polycrystal.org> | 4 | * Copyright (c) 2008 Patrick Mahoney <pat@polycrystal.org> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code was written by Patrick Mahoney (pat@polycrystal.org) as | 7 | * This code was written by Patrick Mahoney (pat@polycrystal.org) as | |
8 | * part of Google Summer of Code 2008. | 8 | * part of Google Summer of Code 2008. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -494,18 +494,17 @@ struct video_hw_if { | @@ -494,18 +494,17 @@ struct video_hw_if { | |||
494 | 494 | |||
495 | int (*get_frequency)(void *, struct video_frequency *); | 495 | int (*get_frequency)(void *, struct video_frequency *); | |
496 | int (*set_frequency)(void *, struct video_frequency *); | 496 | int (*set_frequency)(void *, struct video_frequency *); | |
497 | 497 | |||
498 | int (*get_framerate)(void *, struct video_fract *); | 498 | int (*get_framerate)(void *, struct video_fract *); | |
499 | int (*set_framerate)(void *, struct video_fract *); | 499 | int (*set_framerate)(void *, struct video_fract *); | |
500 | }; | 500 | }; | |
501 | 501 | |||
502 | struct video_attach_args { | 502 | struct video_attach_args { | |
503 | const struct video_hw_if *hw_if; | 503 | const struct video_hw_if *hw_if; | |
504 | void *hw_softc; | 504 | void *hw_softc; | |
505 | }; | 505 | }; | |
506 | 506 | |||
507 | device_t video_attach_mi(const struct video_hw_if *, device_t); | 507 | device_t video_attach_mi(const struct video_hw_if *, device_t, void *); | |
508 | device_t video_attach_mi_softc(const struct video_hw_if *, device_t, void *); | |||
509 | void video_submit_payload(device_t, const struct video_payload *); | 508 | void video_submit_payload(device_t, const struct video_payload *); | |
510 | 509 | |||
511 | #endif /* _SYS_DEV_VIDEO_IF_H_ */ | 510 | #endif /* _SYS_DEV_VIDEO_IF_H_ */ |
--- src/sys/dev/usb/auvitek_video.c 2019/01/22 06:47:20 1.9
+++ src/sys/dev/usb/auvitek_video.c 2022/03/03 06:23:25 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: auvitek_video.c,v 1.9 2019/01/22 06:47:20 skrll Exp $ */ | 1 | /* $NetBSD: auvitek_video.c,v 1.10 2022/03/03 06:23:25 riastradh Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * Auvitek AU0828 USB controller | 30 | * Auvitek AU0828 USB controller | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.9 2019/01/22 06:47:20 skrll Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.10 2022/03/03 06:23:25 riastradh Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/conf.h> | 39 | #include <sys/conf.h> | |
40 | #include <sys/kmem.h> | 40 | #include <sys/kmem.h> | |
41 | #include <sys/bus.h> | 41 | #include <sys/bus.h> | |
42 | 42 | |||
43 | #include <dev/usb/usb.h> | 43 | #include <dev/usb/usb.h> | |
44 | #include <dev/usb/usbdi.h> | 44 | #include <dev/usb/usbdi.h> | |
45 | #include <dev/usb/usbdivar.h> | 45 | #include <dev/usb/usbdivar.h> | |
46 | #include <dev/usb/usbdi_util.h> | 46 | #include <dev/usb/usbdi_util.h> | |
47 | #include <dev/usb/usbdevs.h> | 47 | #include <dev/usb/usbdevs.h> | |
@@ -142,29 +142,30 @@ auvitek_video_detach(struct auvitek_soft | @@ -142,29 +142,30 @@ auvitek_video_detach(struct auvitek_soft | |||
142 | { | 142 | { | |
143 | if (sc->sc_videodev != NULL) { | 143 | if (sc->sc_videodev != NULL) { | |
144 | config_detach(sc->sc_videodev, flags); | 144 | config_detach(sc->sc_videodev, flags); | |
145 | sc->sc_videodev = NULL; | 145 | sc->sc_videodev = NULL; | |
146 | } | 146 | } | |
147 | 147 | |||
148 | return 0; | 148 | return 0; | |
149 | } | 149 | } | |
150 | 150 | |||
151 | void | 151 | void | |
152 | auvitek_video_rescan(struct auvitek_softc *sc, const char *ifattr, | 152 | auvitek_video_rescan(struct auvitek_softc *sc, const char *ifattr, | |
153 | const int *locs) | 153 | const int *locs) | |
154 | { | 154 | { | |
155 | if (ifattr_match(ifattr, "videobus") && sc->sc_videodev == NULL) | 155 | if (ifattr_match(ifattr, "videobus") && sc->sc_videodev == NULL) { | |
156 | sc->sc_videodev = video_attach_mi(&auvitek_video_if, | 156 | sc->sc_videodev = video_attach_mi(&auvitek_video_if, | |
157 | sc->sc_dev); | 157 | sc->sc_dev, sc); | |
158 | } | |||
158 | } | 159 | } | |
159 | 160 | |||
160 | void | 161 | void | |
161 | auvitek_video_childdet(struct auvitek_softc *sc, device_t child) | 162 | auvitek_video_childdet(struct auvitek_softc *sc, device_t child) | |
162 | { | 163 | { | |
163 | if (sc->sc_videodev == child) | 164 | if (sc->sc_videodev == child) | |
164 | sc->sc_videodev = NULL; | 165 | sc->sc_videodev = NULL; | |
165 | } | 166 | } | |
166 | 167 | |||
167 | static int | 168 | static int | |
168 | auvitek_open(void *opaque, int flags) | 169 | auvitek_open(void *opaque, int flags) | |
169 | { | 170 | { | |
170 | struct auvitek_softc *sc = opaque; | 171 | struct auvitek_softc *sc = opaque; |
--- src/sys/dev/usb/pseye.c 2020/05/22 11:24:31 1.28
+++ src/sys/dev/usb/pseye.c 2022/03/03 06:23:25 1.29
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pseye.c,v 1.28 2020/05/22 11:24:31 jmcneill Exp $ */ | 1 | /* $NetBSD: pseye.c,v 1.29 2022/03/03 06:23:25 riastradh Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -27,27 +27,27 @@ | @@ -27,27 +27,27 @@ | |||
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * Sony PlayStation Eye Driver | 30 | * Sony PlayStation Eye Driver | |
31 | * | 31 | * | |
32 | * The only documentation we have for this part is based on a series | 32 | * The only documentation we have for this part is based on a series | |
33 | * of forum postings by Jim Paris on ps2dev.org. Many thanks for | 33 | * of forum postings by Jim Paris on ps2dev.org. Many thanks for | |
34 | * figuring this one out. | 34 | * figuring this one out. | |
35 | * | 35 | * | |
36 | * URL: http://forums.ps2dev.org/viewtopic.php?t=9238 | 36 | * URL: http://forums.ps2dev.org/viewtopic.php?t=9238 | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | #include <sys/cdefs.h> | 39 | #include <sys/cdefs.h> | |
40 | __KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.28 2020/05/22 11:24:31 jmcneill Exp $"); | 40 | __KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.29 2022/03/03 06:23:25 riastradh Exp $"); | |
41 | 41 | |||
42 | #include <sys/param.h> | 42 | #include <sys/param.h> | |
43 | #include <sys/systm.h> | 43 | #include <sys/systm.h> | |
44 | #include <sys/device.h> | 44 | #include <sys/device.h> | |
45 | #include <sys/fcntl.h> | 45 | #include <sys/fcntl.h> | |
46 | #include <sys/conf.h> | 46 | #include <sys/conf.h> | |
47 | #include <sys/poll.h> | 47 | #include <sys/poll.h> | |
48 | #include <sys/bus.h> | 48 | #include <sys/bus.h> | |
49 | #include <sys/mutex.h> | 49 | #include <sys/mutex.h> | |
50 | #include <sys/kthread.h> | 50 | #include <sys/kthread.h> | |
51 | #include <sys/condvar.h> | 51 | #include <sys/condvar.h> | |
52 | #include <sys/module.h> | 52 | #include <sys/module.h> | |
53 | 53 | |||
@@ -253,27 +253,27 @@ pseye_attach(device_t parent, device_t s | @@ -253,27 +253,27 @@ pseye_attach(device_t parent, device_t s | |||
253 | if (error) { | 253 | if (error) { | |
254 | aprint_error_dev(self, "couldn't create transfer\n"); | 254 | aprint_error_dev(self, "couldn't create transfer\n"); | |
255 | pseye_close_pipes(sc); | 255 | pseye_close_pipes(sc); | |
256 | return; | 256 | return; | |
257 | } | 257 | } | |
258 | 258 | |||
259 | sc->sc_bulkin_buffer = usbd_get_buffer(sc->sc_bulkin_xfer); | 259 | sc->sc_bulkin_buffer = usbd_get_buffer(sc->sc_bulkin_xfer); | |
260 | 260 | |||
261 | pseye_init(sc); | 261 | pseye_init(sc); | |
262 | 262 | |||
263 | if (!pmf_device_register(self, NULL, NULL)) | 263 | if (!pmf_device_register(self, NULL, NULL)) | |
264 | aprint_error_dev(self, "couldn't establish power handler\n"); | 264 | aprint_error_dev(self, "couldn't establish power handler\n"); | |
265 | 265 | |||
266 | sc->sc_videodev = video_attach_mi(&pseye_hw_if, self); | 266 | sc->sc_videodev = video_attach_mi(&pseye_hw_if, self, sc); | |
267 | if (sc->sc_videodev == NULL) { | 267 | if (sc->sc_videodev == NULL) { | |
268 | aprint_error_dev(self, "couldn't attach video layer\n"); | 268 | aprint_error_dev(self, "couldn't attach video layer\n"); | |
269 | sc->sc_dying = 1; | 269 | sc->sc_dying = 1; | |
270 | return; | 270 | return; | |
271 | } | 271 | } | |
272 | 272 | |||
273 | usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, self); | 273 | usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, self); | |
274 | 274 | |||
275 | } | 275 | } | |
276 | 276 | |||
277 | static int | 277 | static int | |
278 | pseye_detach(device_t self, int flags) | 278 | pseye_detach(device_t self, int flags) | |
279 | { | 279 | { |
--- src/sys/dev/usb/uvideo.c 2022/03/03 06:22:53 1.68
+++ src/sys/dev/usb/uvideo.c 2022/03/03 06:23:25 1.69
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uvideo.c,v 1.68 2022/03/03 06:22:53 riastradh Exp $ */ | 1 | /* $NetBSD: uvideo.c,v 1.69 2022/03/03 06:23:25 riastradh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2008 Patrick Mahoney | 4 | * Copyright (c) 2008 Patrick Mahoney | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code was written by Patrick Mahoney (pat@polycrystal.org) as | 7 | * This code was written by Patrick Mahoney (pat@polycrystal.org) as | |
8 | * part of Google Summer of Code 2008. | 8 | * part of Google Summer of Code 2008. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -32,27 +32,27 @@ | @@ -32,27 +32,27 @@ | |||
32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
36 | * POSSIBILITY OF SUCH DAMAGE. | 36 | * POSSIBILITY OF SUCH DAMAGE. | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | /* | 39 | /* | |
40 | * USB video specs: | 40 | * USB video specs: | |
41 | * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip | 41 | * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip | |
42 | */ | 42 | */ | |
43 | 43 | |||
44 | #include <sys/cdefs.h> | 44 | #include <sys/cdefs.h> | |
45 | __KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.68 2022/03/03 06:22:53 riastradh Exp $"); | 45 | __KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.69 2022/03/03 06:23:25 riastradh Exp $"); | |
46 | 46 | |||
47 | #ifdef _KERNEL_OPT | 47 | #ifdef _KERNEL_OPT | |
48 | #include "opt_usb.h" | 48 | #include "opt_usb.h" | |
49 | #endif | 49 | #endif | |
50 | 50 | |||
51 | #ifdef _MODULE | 51 | #ifdef _MODULE | |
52 | #include <sys/module.h> | 52 | #include <sys/module.h> | |
53 | #endif | 53 | #endif | |
54 | 54 | |||
55 | #include <sys/param.h> | 55 | #include <sys/param.h> | |
56 | #include <sys/systm.h> | 56 | #include <sys/systm.h> | |
57 | #include <sys/kernel.h> | 57 | #include <sys/kernel.h> | |
58 | #include <sys/kmem.h> | 58 | #include <sys/kmem.h> | |
@@ -593,28 +593,28 @@ uvideo_attach(device_t parent, device_t | @@ -593,28 +593,28 @@ uvideo_attach(device_t parent, device_t | |||
593 | break; | 593 | break; | |
594 | } | 594 | } | |
595 | 595 | |||
596 | } | 596 | } | |
597 | 597 | |||
598 | 598 | |||
599 | usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev); | 599 | usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev); | |
600 | 600 | |||
601 | if (!pmf_device_register(self, NULL, NULL)) | 601 | if (!pmf_device_register(self, NULL, NULL)) | |
602 | aprint_error_dev(self, "couldn't establish power handler\n"); | 602 | aprint_error_dev(self, "couldn't establish power handler\n"); | |
603 | 603 | |||
604 | SLIST_FOREACH(vs, &sc->sc_stream_list, entries) { | 604 | SLIST_FOREACH(vs, &sc->sc_stream_list, entries) { | |
605 | /* XXX initialization of vs_videodev is racy */ | 605 | /* XXX initialization of vs_videodev is racy */ | |
606 | vs->vs_videodev = video_attach_mi_softc(&uvideo_hw_if, | 606 | vs->vs_videodev = video_attach_mi(&uvideo_hw_if, sc->sc_dev, | |
607 | sc->sc_dev, vs); | 607 | vs); | |
608 | } | 608 | } | |
609 | 609 | |||
610 | return; | 610 | return; | |
611 | 611 | |||
612 | bad: | 612 | bad: | |
613 | if (err != USBD_NORMAL_COMPLETION) { | 613 | if (err != USBD_NORMAL_COMPLETION) { | |
614 | DPRINTF(("uvideo_attach: error: %s (%d)\n", | 614 | DPRINTF(("uvideo_attach: error: %s (%d)\n", | |
615 | usbd_errstr(err), err)); | 615 | usbd_errstr(err), err)); | |
616 | } | 616 | } | |
617 | return; | 617 | return; | |
618 | } | 618 | } | |
619 | 619 | |||
620 | 620 |