1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ov534-ov9xxx gspca driver
5 * Copyright (C) 2009-2011 Jean-Francois Moine http://moinejf.free.fr
6 * Copyright (C) 2008 Antonio Ospite <ospite@studenti.unina.it>
7 * Copyright (C) 2008 Jim Paris <jim@jtan.com>
9 * Based on a prototype written by Mark Ferrell <majortrips@gmail.com>
10 * USB protocol reverse engineered by Jim Paris <jim@jtan.com>
11 * https://jim.sh/svn/jim/devl/playstation/ps3/eye/test/
14 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
16 #define MODULE_NAME "ov534_9"
20 #define OV534_REG_ADDRESS 0xf1 /* sensor address */
21 #define OV534_REG_SUBADDR 0xf2
22 #define OV534_REG_WRITE 0xf3
23 #define OV534_REG_READ 0xf4
24 #define OV534_REG_OPERATION 0xf5
25 #define OV534_REG_STATUS 0xf6
27 #define OV534_OP_WRITE_3 0x37
28 #define OV534_OP_WRITE_2 0x33
29 #define OV534_OP_READ_2 0xf9
31 #define CTRL_TIMEOUT 500
33 MODULE_AUTHOR("Jean-Francois Moine <moinejf@free.fr>");
34 MODULE_DESCRIPTION("GSPCA/OV534_9 USB Camera Driver");
35 MODULE_LICENSE("GPL");
37 /* specific webcam descriptor */
39 struct gspca_dev gspca_dev
; /* !! must be the first item */
46 SENSOR_OV965x
, /* ov9657 */
47 SENSOR_OV971x
, /* ov9712 */
48 SENSOR_OV562x
, /* ov5621 */
49 SENSOR_OV361x
, /* ov3610 */
53 static const struct v4l2_pix_format ov965x_mode
[] = {
55 {320, 240, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
57 .sizeimage
= 320 * 240 * 3 / 8 + 590,
58 .colorspace
= V4L2_COLORSPACE_JPEG
},
60 {640, 480, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
62 .sizeimage
= 640 * 480 * 3 / 8 + 590,
63 .colorspace
= V4L2_COLORSPACE_JPEG
},
65 {800, 600, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
67 .sizeimage
= 800 * 600 * 3 / 8 + 590,
68 .colorspace
= V4L2_COLORSPACE_JPEG
},
70 {1024, 768, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
72 .sizeimage
= 1024 * 768 * 3 / 8 + 590,
73 .colorspace
= V4L2_COLORSPACE_JPEG
},
75 {1280, 1024, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
77 .sizeimage
= 1280 * 1024 * 3 / 8 + 590,
78 .colorspace
= V4L2_COLORSPACE_JPEG
},
81 static const struct v4l2_pix_format ov971x_mode
[] = {
82 {640, 480, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
84 .sizeimage
= 640 * 480,
85 .colorspace
= V4L2_COLORSPACE_SRGB
89 static const struct v4l2_pix_format ov562x_mode
[] = {
90 {2592, 1680, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
92 .sizeimage
= 2592 * 1680,
93 .colorspace
= V4L2_COLORSPACE_SRGB
107 static const struct v4l2_pix_format ov361x_mode
[] = {
108 {0x800, 0x600, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
109 .bytesperline
= 0x800,
110 .sizeimage
= 0x800 * 0x600,
111 .colorspace
= V4L2_COLORSPACE_SRGB
},
112 {1600, 1200, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
113 .bytesperline
= 1600,
114 .sizeimage
= 1600 * 1200,
115 .colorspace
= V4L2_COLORSPACE_SRGB
},
116 {1024, 768, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
118 .sizeimage
= 1024 * 768,
119 .colorspace
= V4L2_COLORSPACE_SRGB
},
120 {640, 480, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
122 .sizeimage
= 640 * 480,
123 .colorspace
= V4L2_COLORSPACE_SRGB
},
124 {320, 240, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
126 .sizeimage
= 320 * 240,
127 .colorspace
= V4L2_COLORSPACE_SRGB
},
128 {160, 120, V4L2_PIX_FMT_SBGGR8
, V4L2_FIELD_NONE
,
130 .sizeimage
= 160 * 120,
131 .colorspace
= V4L2_COLORSPACE_SRGB
}
134 static const u8 ov361x_start_2048
[][2] = {
155 static const u8 ov361x_bridge_start_2048
[][2] = {
172 static const u8 ov361x_start_1600
[][2] = {
193 static const u8 ov361x_bridge_start_1600
[][2] = {
194 {0xf1, 0x60}, /* Hsize[7:0] */
195 {0x88, 0x00}, /* Hsize[15:8] Write Only, can't read */
196 {0x89, 0x08}, /* Vsize[7:0] */
197 {0x8a, 0x00}, /* Vsize[15:8] Write Only, can't read */
198 {0x8b, 0x06}, /* for Iso */
199 {0x8c, 0x01}, /* RAW input */
201 {0x1c, 0x00}, /* RAW output, Iso transfer */
205 {0x1c, 0x0a}, /* turn off JPEG, Iso mode */
206 {0x1d, 0x2e}, /* for Iso */
210 static const u8 ov361x_start_1024
[][2] = {
231 static const u8 ov361x_bridge_start_1024
[][2] = {
232 {0xf1, 0x60}, /* Hsize[7:0] */
233 {0x88, 0x00}, /* Hsize[15:8] Write Only, can't read */
234 {0x89, 0x04}, /* Vsize[7:0] */
235 {0x8a, 0x00}, /* Vsize[15:8] Write Only, can't read */
236 {0x8b, 0x03}, /* for Iso */
237 {0x8c, 0x01}, /* RAW input */
239 {0x1c, 0x00}, /* RAW output, Iso transfer */
243 {0x1c, 0x0a}, /* turn off JPEG, Iso mode */
244 {0x1d, 0x2e}, /* for Iso */
248 static const u8 ov361x_start_640
[][2] = {
270 static const u8 ov361x_bridge_start_640
[][2] = {
271 {0xf1, 0x60}, /* Hsize[7:0]*/
272 {0x88, 0x00}, /* Hsize[15:8] Write Only, can't read */
273 {0x89, 0x04}, /* Vsize[7:0] */
274 {0x8a, 0x00}, /* Vsize[15:8] Write Only, can't read */
275 {0x8b, 0x03}, /* for Iso */
276 {0x8c, 0x01}, /* RAW input */
278 {0x1c, 0x00}, /* RAW output, Iso transfer */
282 {0x1c, 0x0a}, /* turn off JPEG, Iso mode */
283 {0x1d, 0x2e}, /* for Iso */
287 static const u8 ov361x_start_320
[][2] = {
309 static const u8 ov361x_bridge_start_320
[][2] = {
310 {0xf1, 0x60}, /* Hsize[7:0] */
311 {0x88, 0x00}, /* Hsize[15:8] Write Only, can't read */
312 {0x89, 0x04}, /* Vsize[7:0] */
313 {0x8a, 0x00}, /* Vsize[15:8] Write Only, can't read */
314 {0x8b, 0x03}, /* for Iso */
315 {0x8c, 0x01}, /* RAW input */
317 {0x1c, 0x00}, /* RAW output, Iso transfer; */
321 {0x1c, 0x0a}, /* turn off JPEG, Iso mode */
322 {0x1d, 0x2e}, /* for Iso */
326 static const u8 ov361x_start_160
[][2] = {
348 static const u8 ov361x_bridge_start_160
[][2] = {
349 {0xf1, 0x60}, /* Hsize[7:0] */
350 {0x88, 0x00}, /* Hsize[15:8] Write Only, can't read */
351 {0x89, 0x04}, /* Vsize[7:0] */
352 {0x8a, 0x00}, /* Vsize[15:8] Write Only, can't read */
353 {0x8b, 0x03}, /* for Iso */
354 {0x8c, 0x01}, /* RAW input */
356 {0x1c, 0x00}, /* RAW output, Iso transfer */
360 {0x1c, 0x0a}, /* turn off JPEG, Iso mode */
361 {0x1d, 0x2e}, /* for Iso */
365 static const u8 bridge_init
[][2] = {
399 static const u8 ov965x_init
[][2] = {
400 {0x12, 0x80}, /* com7 - SSCB reset */
401 {0x00, 0x00}, /* gain */
402 {0x01, 0x80}, /* blue */
403 {0x02, 0x80}, /* red */
404 {0x03, 0x1b}, /* vref */
405 {0x04, 0x03}, /* com1 - exposure low bits */
406 {0x0b, 0x57}, /* ver */
407 {0x0e, 0x61}, /* com5 */
408 {0x0f, 0x42}, /* com6 */
409 {0x11, 0x00}, /* clkrc */
410 {0x12, 0x02}, /* com7 - 15fps VGA YUYV */
411 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
412 {0x14, 0x28}, /* com9 */
413 {0x16, 0x24}, /* reg16 */
414 {0x17, 0x1d}, /* hstart*/
415 {0x18, 0xbd}, /* hstop */
416 {0x19, 0x01}, /* vstrt */
417 {0x1a, 0x81}, /* vstop*/
418 {0x1e, 0x04}, /* mvfp */
419 {0x24, 0x3c}, /* aew */
420 {0x25, 0x36}, /* aeb */
421 {0x26, 0x71}, /* vpt */
422 {0x27, 0x08}, /* bbias */
423 {0x28, 0x08}, /* gbbias */
424 {0x29, 0x15}, /* gr com */
425 {0x2a, 0x00}, /* exhch */
426 {0x2b, 0x00}, /* exhcl */
427 {0x2c, 0x08}, /* rbias */
428 {0x32, 0xff}, /* href */
429 {0x33, 0x00}, /* chlf */
430 {0x34, 0x3f}, /* aref1 */
431 {0x35, 0x00}, /* aref2 */
432 {0x36, 0xf8}, /* aref3 */
433 {0x38, 0x72}, /* adc2 */
434 {0x39, 0x57}, /* aref4 */
435 {0x3a, 0x80}, /* tslb - yuyv */
436 {0x3b, 0xc4}, /* com11 - night mode 1/4 frame rate */
437 {0x3d, 0x99}, /* com13 */
438 {0x3f, 0xc1}, /* edge */
439 {0x40, 0xc0}, /* com15 */
440 {0x41, 0x40}, /* com16 */
441 {0x42, 0xc0}, /* com17 */
442 {0x43, 0x0a}, /* rsvd */
453 {0x4f, 0x98}, /* matrix */
459 {0x58, 0x1a}, /* matrix coef sign */
460 {0x59, 0x85}, /* AWB control */
466 {0x5f, 0xf0}, /* AWB blue limit */
467 {0x60, 0xf0}, /* AWB red limit */
468 {0x61, 0xf0}, /* AWB green limit */
469 {0x62, 0x00}, /* lcc1 */
470 {0x63, 0x00}, /* lcc2 */
471 {0x64, 0x02}, /* lcc3 */
472 {0x65, 0x16}, /* lcc4 */
473 {0x66, 0x01}, /* lcc5 */
474 {0x69, 0x02}, /* hv */
475 {0x6b, 0x5a}, /* dbvl */
480 {0x70, 0x21}, /* dnsth */
482 {0x72, 0x00}, /* poidx */
483 {0x73, 0x01}, /* pckdv */
484 {0x74, 0x3a}, /* xindx */
485 {0x75, 0x35}, /* yindx */
488 {0x7a, 0x12}, /* gamma curve */
505 {0x8c, 0x89}, /* com19 */
506 {0x14, 0x28}, /* com9 */
509 {0x9d, 0x03}, /* lcc6 */
510 {0x9e, 0x04}, /* lcc7 */
513 {0xa1, 0x40}, /* aechm */
514 {0xa4, 0x50}, /* com21 */
515 {0xa5, 0x68}, /* com26 */
516 {0xa6, 0x4a}, /* AWB green */
517 {0xa8, 0xc1}, /* refa8 */
518 {0xa9, 0xef}, /* refa9 */
521 {0xac, 0x80}, /* black level control */
527 {0xb4, 0x20}, /* ctrlb4 */
531 {0xbc, 0x7f}, /* ADC channel offsets */
540 {0xc7, 0x80}, /* com24 */
546 {0x4f, 0x98}, /* matrix */
553 {0xff, 0x41}, /* read 41, write ff 00 */
554 {0x41, 0x40}, /* com16 */
556 {0xc5, 0x03}, /* 60 Hz banding filter */
557 {0x6a, 0x02}, /* 50 Hz banding filter */
559 {0x12, 0x62}, /* com7 - 30fps VGA YUV */
560 {0x36, 0xfa}, /* aref3 */
561 {0x69, 0x0a}, /* hv */
562 {0x8c, 0x89}, /* com22 */
563 {0x14, 0x28}, /* com9 */
565 {0x41, 0x40}, /* com16 */
572 {0x03, 0x12}, /* vref */
573 {0x17, 0x16}, /* hstart */
574 {0x18, 0x02}, /* hstop */
575 {0x19, 0x01}, /* vstrt */
576 {0x1a, 0x3d}, /* vstop */
577 {0x32, 0xff}, /* href */
581 static const u8 bridge_init_2
[][2] = {
609 static const u8 ov965x_init_2
[][2] = {
611 {0x1e, 0x04}, /* mvfp */
612 {0x13, 0xe0}, /* com8 */
613 {0x00, 0x00}, /* gain */
614 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
615 {0x11, 0x03}, /* clkrc */
616 {0x6b, 0x5a}, /* dblv */
622 {0xff, 0x42}, /* read 42, write ff 00 */
623 {0x42, 0xc0}, /* com17 */
625 {0xff, 0x42}, /* read 42, write ff 00 */
626 {0x42, 0xc1}, /* com17 */
629 {0xff, 0x42}, /* read 42, write ff 00 */
630 {0x42, 0xc1}, /* com17 */
632 {0x4f, 0x98}, /* matrix */
639 {0xff, 0x41}, /* read 41, write ff 00 */
640 {0x41, 0x40}, /* com16 */
646 {0x10, 0x25}, /* aech - exposure high bits */
647 {0xff, 0x13}, /* read 13, write ff 00 */
648 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
651 static const u8 ov971x_init
[][2] = {
675 {0x98, 0x40}, /*{0x98, 0x00},*/
676 {0x99, 0xA0}, /*{0x99, 0x00},*/
677 {0x9a, 0x01}, /*{0x9a, 0x00},*/
679 {0x58, 0x78}, /*{0x58, 0xc8},*/
680 {0x59, 0x50}, /*{0x59, 0xa0},*/
685 {0xbd, 0x50}, /*{0xbd, 0xa0},*/
686 {0xbe, 0x78}, /*{0xbe, 0xc8},*/
709 static const u8 ov965x_start_1_vga
[][2] = { /* same for qvga */
710 {0x12, 0x62}, /* com7 - 30fps VGA YUV */
711 {0x36, 0xfa}, /* aref3 */
712 {0x69, 0x0a}, /* hv */
713 {0x8c, 0x89}, /* com22 */
714 {0x14, 0x28}, /* com9 */
715 {0x3e, 0x0c}, /* com14 */
716 {0x41, 0x40}, /* com16 */
722 {0xc7, 0x80}, /* com24 */
723 {0x03, 0x12}, /* vref */
724 {0x17, 0x16}, /* hstart */
725 {0x18, 0x02}, /* hstop */
726 {0x19, 0x01}, /* vstrt */
727 {0x1a, 0x3d}, /* vstop */
728 {0x32, 0xff}, /* href */
732 static const u8 ov965x_start_1_svga
[][2] = {
733 {0x12, 0x02}, /* com7 - YUYV - VGA 15 full resolution */
734 {0x36, 0xf8}, /* aref3 */
735 {0x69, 0x02}, /* hv */
736 {0x8c, 0x0d}, /* com22 */
737 {0x3e, 0x0c}, /* com14 */
738 {0x41, 0x40}, /* com16 */
744 {0xc7, 0x80}, /* com24 */
745 {0x03, 0x1b}, /* vref */
746 {0x17, 0x1d}, /* hstart */
747 {0x18, 0xbd}, /* hstop */
748 {0x19, 0x01}, /* vstrt */
749 {0x1a, 0x81}, /* vstop */
750 {0x32, 0xff}, /* href */
754 static const u8 ov965x_start_1_xga
[][2] = {
755 {0x12, 0x02}, /* com7 */
756 {0x36, 0xf8}, /* aref3 */
757 {0x69, 0x02}, /* hv */
758 {0x8c, 0x89}, /* com22 */
759 {0x14, 0x28}, /* com9 */
760 {0x3e, 0x0c}, /* com14 */
761 {0x41, 0x40}, /* com16 */
767 {0xc7, 0x80}, /* com24 */
768 {0x03, 0x1b}, /* vref */
769 {0x17, 0x1d}, /* hstart */
770 {0x18, 0xbd}, /* hstop */
771 {0x19, 0x01}, /* vstrt */
772 {0x1a, 0x81}, /* vstop */
773 {0x32, 0xff}, /* href */
777 static const u8 ov965x_start_1_sxga
[][2] = {
778 {0x12, 0x02}, /* com7 */
779 {0x36, 0xf8}, /* aref3 */
780 {0x69, 0x02}, /* hv */
781 {0x8c, 0x89}, /* com22 */
782 {0x14, 0x28}, /* com9 */
783 {0x3e, 0x0c}, /* com14 */
784 {0x41, 0x40}, /* com16 */
790 {0xc7, 0x80}, /* com24 */
791 {0x03, 0x1b}, /* vref */
792 {0x17, 0x1d}, /* hstart */
793 {0x18, 0x02}, /* hstop */
794 {0x19, 0x01}, /* vstrt */
795 {0x1a, 0x81}, /* vstop */
796 {0x32, 0xff}, /* href */
800 static const u8 bridge_start_qvga
[][2] = {
828 static const u8 bridge_start_vga
[][2] = {
855 static const u8 bridge_start_svga
[][2] = {
882 static const u8 bridge_start_xga
[][2] = {
909 static const u8 bridge_start_sxga
[][2] = {
926 static const u8 ov965x_start_2_qvga
[][2] = {
927 {0x3b, 0xe4}, /* com11 - night mode 1/4 frame rate */
928 {0x1e, 0x04}, /* mvfp */
929 {0x13, 0xe0}, /* com8 */
931 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
932 {0x11, 0x01}, /* clkrc */
933 {0x6b, 0x5a}, /* dblv */
934 {0x6a, 0x02}, /* 50 Hz banding filter */
935 {0xc5, 0x03}, /* 60 Hz banding filter */
936 {0xa2, 0x96}, /* bd50 */
937 {0xa3, 0x7d}, /* bd60 */
939 {0xff, 0x13}, /* read 13, write ff 00 */
941 {0x3a, 0x80}, /* tslb - yuyv */
944 static const u8 ov965x_start_2_vga
[][2] = {
945 {0x3b, 0xc4}, /* com11 - night mode 1/4 frame rate */
946 {0x1e, 0x04}, /* mvfp */
947 {0x13, 0xe0}, /* com8 */
949 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
950 {0x11, 0x03}, /* clkrc */
951 {0x6b, 0x5a}, /* dblv */
952 {0x6a, 0x05}, /* 50 Hz banding filter */
953 {0xc5, 0x07}, /* 60 Hz banding filter */
954 {0xa2, 0x4b}, /* bd50 */
955 {0xa3, 0x3e}, /* bd60 */
957 {0x2d, 0x00}, /* advfl */
960 static const u8 ov965x_start_2_svga
[][2] = { /* same for xga */
961 {0x3b, 0xc4}, /* com11 - night mode 1/4 frame rate */
962 {0x1e, 0x04}, /* mvfp */
963 {0x13, 0xe0}, /* com8 */
965 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
966 {0x11, 0x01}, /* clkrc */
967 {0x6b, 0x5a}, /* dblv */
968 {0x6a, 0x0c}, /* 50 Hz banding filter */
969 {0xc5, 0x0f}, /* 60 Hz banding filter */
970 {0xa2, 0x4e}, /* bd50 */
971 {0xa3, 0x41}, /* bd60 */
974 static const u8 ov965x_start_2_sxga
[][2] = {
975 {0x13, 0xe0}, /* com8 */
977 {0x13, 0xe7}, /* com8 - everything (AGC, AWB and AEC) */
978 {0x3b, 0xc4}, /* com11 - night mode 1/4 frame rate */
979 {0x1e, 0x04}, /* mvfp */
980 {0x11, 0x01}, /* clkrc */
981 {0x6b, 0x5a}, /* dblv */
982 {0x6a, 0x0c}, /* 50 Hz banding filter */
983 {0xc5, 0x0f}, /* 60 Hz banding filter */
984 {0xa2, 0x4e}, /* bd50 */
985 {0xa3, 0x41}, /* bd60 */
988 static const u8 ov562x_init
[][2] = {
1004 static const u8 ov562x_init_2
[][2] = {
1106 static void reg_w_i(struct gspca_dev
*gspca_dev
, u16 reg
, u8 val
)
1108 struct usb_device
*udev
= gspca_dev
->dev
;
1111 if (gspca_dev
->usb_err
< 0)
1113 gspca_dev
->usb_buf
[0] = val
;
1114 ret
= usb_control_msg(udev
,
1115 usb_sndctrlpipe(udev
, 0),
1117 USB_DIR_OUT
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
1118 0x00, reg
, gspca_dev
->usb_buf
, 1, CTRL_TIMEOUT
);
1120 pr_err("reg_w failed %d\n", ret
);
1121 gspca_dev
->usb_err
= ret
;
1125 static void reg_w(struct gspca_dev
*gspca_dev
, u16 reg
, u8 val
)
1127 gspca_dbg(gspca_dev
, D_USBO
, "reg_w [%04x] = %02x\n", reg
, val
);
1128 reg_w_i(gspca_dev
, reg
, val
);
1131 static u8
reg_r(struct gspca_dev
*gspca_dev
, u16 reg
)
1133 struct usb_device
*udev
= gspca_dev
->dev
;
1136 if (gspca_dev
->usb_err
< 0)
1138 ret
= usb_control_msg(udev
,
1139 usb_rcvctrlpipe(udev
, 0),
1141 USB_DIR_IN
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
1142 0x00, reg
, gspca_dev
->usb_buf
, 1, CTRL_TIMEOUT
);
1143 gspca_dbg(gspca_dev
, D_USBI
, "reg_r [%04x] -> %02x\n",
1144 reg
, gspca_dev
->usb_buf
[0]);
1146 pr_err("reg_r err %d\n", ret
);
1147 gspca_dev
->usb_err
= ret
;
1150 return gspca_dev
->usb_buf
[0];
1153 static int sccb_check_status(struct gspca_dev
*gspca_dev
)
1158 for (i
= 0; i
< 5; i
++) {
1160 data
= reg_r(gspca_dev
, OV534_REG_STATUS
);
1170 gspca_dbg(gspca_dev
, D_USBI
|D_USBO
,
1171 "sccb status 0x%02x, attempt %d/5\n",
1178 static void sccb_write(struct gspca_dev
*gspca_dev
, u8 reg
, u8 val
)
1180 gspca_dbg(gspca_dev
, D_USBO
, "sccb_write [%02x] = %02x\n", reg
, val
);
1181 reg_w_i(gspca_dev
, OV534_REG_SUBADDR
, reg
);
1182 reg_w_i(gspca_dev
, OV534_REG_WRITE
, val
);
1183 reg_w_i(gspca_dev
, OV534_REG_OPERATION
, OV534_OP_WRITE_3
);
1185 if (!sccb_check_status(gspca_dev
))
1186 pr_err("sccb_write failed\n");
1189 static u8
sccb_read(struct gspca_dev
*gspca_dev
, u16 reg
)
1191 reg_w(gspca_dev
, OV534_REG_SUBADDR
, reg
);
1192 reg_w(gspca_dev
, OV534_REG_OPERATION
, OV534_OP_WRITE_2
);
1193 if (!sccb_check_status(gspca_dev
))
1194 pr_err("sccb_read failed 1\n");
1196 reg_w(gspca_dev
, OV534_REG_OPERATION
, OV534_OP_READ_2
);
1197 if (!sccb_check_status(gspca_dev
))
1198 pr_err("sccb_read failed 2\n");
1200 return reg_r(gspca_dev
, OV534_REG_READ
);
1203 /* output a bridge sequence (reg - val) */
1204 static void reg_w_array(struct gspca_dev
*gspca_dev
,
1205 const u8 (*data
)[2], int len
)
1207 while (--len
>= 0) {
1208 reg_w(gspca_dev
, (*data
)[0], (*data
)[1]);
1213 /* output a sensor sequence (reg - val) */
1214 static void sccb_w_array(struct gspca_dev
*gspca_dev
,
1215 const u8 (*data
)[2], int len
)
1217 while (--len
>= 0) {
1218 if ((*data
)[0] != 0xff) {
1219 sccb_write(gspca_dev
, (*data
)[0], (*data
)[1]);
1221 sccb_read(gspca_dev
, (*data
)[1]);
1222 sccb_write(gspca_dev
, 0xff, 0x00);
1228 /* Two bits control LED: 0x21 bit 7 and 0x23 bit 7.
1229 * (direction and output)? */
1230 static void set_led(struct gspca_dev
*gspca_dev
, int status
)
1234 gspca_dbg(gspca_dev
, D_CONF
, "led status: %d\n", status
);
1236 data
= reg_r(gspca_dev
, 0x21);
1238 reg_w(gspca_dev
, 0x21, data
);
1240 data
= reg_r(gspca_dev
, 0x23);
1246 reg_w(gspca_dev
, 0x23, data
);
1249 data
= reg_r(gspca_dev
, 0x21);
1251 reg_w(gspca_dev
, 0x21, data
);
1255 static void setbrightness(struct gspca_dev
*gspca_dev
, s32 brightness
)
1257 struct sd
*sd
= (struct sd
*) gspca_dev
;
1261 if (sd
->sensor
== SENSOR_OV562x
) {
1265 sccb_write(gspca_dev
, 0x24, val
);
1268 sccb_write(gspca_dev
, 0x25, val
);
1275 sccb_write(gspca_dev
, 0x26, val
);
1279 val
= 15 - val
; /* f .. 8 */
1281 val
= val
- 8; /* 0 .. 7 */
1282 sccb_write(gspca_dev
, 0x55, /* brtn - brightness adjustment */
1287 static void setcontrast(struct gspca_dev
*gspca_dev
, s32 val
)
1289 sccb_write(gspca_dev
, 0x56, /* cnst1 - contrast 1 ctrl coeff */
1293 static void setautogain(struct gspca_dev
*gspca_dev
, s32 autogain
)
1297 /*fixme: should adjust agc/awb/aec by different controls */
1298 val
= sccb_read(gspca_dev
, 0x13); /* com8 */
1299 sccb_write(gspca_dev
, 0xff, 0x00);
1301 val
|= 0x05; /* agc & aec */
1304 sccb_write(gspca_dev
, 0x13, val
);
1307 static void setexposure(struct gspca_dev
*gspca_dev
, s32 exposure
)
1309 static const u8 expo
[4] = {0x00, 0x25, 0x38, 0x5e};
1312 sccb_write(gspca_dev
, 0x10, expo
[exposure
]); /* aec[9:2] */
1314 val
= sccb_read(gspca_dev
, 0x13); /* com8 */
1315 sccb_write(gspca_dev
, 0xff, 0x00);
1316 sccb_write(gspca_dev
, 0x13, val
);
1318 val
= sccb_read(gspca_dev
, 0xa1); /* aech */
1319 sccb_write(gspca_dev
, 0xff, 0x00);
1320 sccb_write(gspca_dev
, 0xa1, val
& 0xe0); /* aec[15:10] = 0 */
1323 static void setsharpness(struct gspca_dev
*gspca_dev
, s32 val
)
1325 if (val
< 0) { /* auto */
1326 val
= sccb_read(gspca_dev
, 0x42); /* com17 */
1327 sccb_write(gspca_dev
, 0xff, 0x00);
1328 sccb_write(gspca_dev
, 0x42, val
| 0x40);
1329 /* Edge enhancement strength auto adjust */
1333 val
= 1 << (val
- 1);
1334 sccb_write(gspca_dev
, 0x3f, /* edge - edge enhance. factor */
1336 val
= sccb_read(gspca_dev
, 0x42); /* com17 */
1337 sccb_write(gspca_dev
, 0xff, 0x00);
1338 sccb_write(gspca_dev
, 0x42, val
& 0xbf);
1341 static void setsatur(struct gspca_dev
*gspca_dev
, s32 val
)
1343 u8 val1
, val2
, val3
;
1344 static const u8 matrix
[5][2] = {
1352 val1
= matrix
[val
][0];
1353 val2
= matrix
[val
][1];
1355 sccb_write(gspca_dev
, 0x4f, val3
); /* matrix coeff */
1356 sccb_write(gspca_dev
, 0x50, val3
);
1357 sccb_write(gspca_dev
, 0x51, 0x00);
1358 sccb_write(gspca_dev
, 0x52, val1
);
1359 sccb_write(gspca_dev
, 0x53, val2
);
1360 sccb_write(gspca_dev
, 0x54, val3
);
1361 sccb_write(gspca_dev
, 0x58, 0x1a); /* mtxs - coeff signs */
1363 val1
= sccb_read(gspca_dev
, 0x41); /* com16 */
1364 sccb_write(gspca_dev
, 0xff, 0x00);
1365 sccb_write(gspca_dev
, 0x41, val1
);
1368 static void setlightfreq(struct gspca_dev
*gspca_dev
, s32 freq
)
1372 val
= sccb_read(gspca_dev
, 0x13); /* com8 */
1373 sccb_write(gspca_dev
, 0xff, 0x00);
1375 sccb_write(gspca_dev
, 0x13, val
& 0xdf);
1378 sccb_write(gspca_dev
, 0x13, val
| 0x20);
1380 val
= sccb_read(gspca_dev
, 0x42); /* com17 */
1381 sccb_write(gspca_dev
, 0xff, 0x00);
1386 sccb_write(gspca_dev
, 0x42, val
);
1389 /* this function is called at probe time */
1390 static int sd_config(struct gspca_dev
*gspca_dev
,
1391 const struct usb_device_id
*id
)
1396 /* this function is called at probe and resume time */
1397 static int sd_init(struct gspca_dev
*gspca_dev
)
1399 struct sd
*sd
= (struct sd
*) gspca_dev
;
1403 reg_w(gspca_dev
, 0xe7, 0x3a);
1404 reg_w(gspca_dev
, 0xe0, 0x08);
1407 /* initialize the sensor address */
1408 reg_w(gspca_dev
, OV534_REG_ADDRESS
, 0x60);
1411 sccb_write(gspca_dev
, 0x12, 0x80);
1414 /* probe the sensor */
1415 sccb_read(gspca_dev
, 0x0a);
1416 sensor_id
= sccb_read(gspca_dev
, 0x0a) << 8;
1417 sccb_read(gspca_dev
, 0x0b);
1418 sensor_id
|= sccb_read(gspca_dev
, 0x0b);
1419 gspca_dbg(gspca_dev
, D_PROBE
, "Sensor ID: %04x\n", sensor_id
);
1422 if ((sensor_id
& 0xfff0) == 0x9650) {
1423 sd
->sensor
= SENSOR_OV965x
;
1425 gspca_dev
->cam
.cam_mode
= ov965x_mode
;
1426 gspca_dev
->cam
.nmodes
= ARRAY_SIZE(ov965x_mode
);
1428 reg_w_array(gspca_dev
, bridge_init
,
1429 ARRAY_SIZE(bridge_init
));
1430 sccb_w_array(gspca_dev
, ov965x_init
,
1431 ARRAY_SIZE(ov965x_init
));
1432 reg_w_array(gspca_dev
, bridge_init_2
,
1433 ARRAY_SIZE(bridge_init_2
));
1434 sccb_w_array(gspca_dev
, ov965x_init_2
,
1435 ARRAY_SIZE(ov965x_init_2
));
1436 reg_w(gspca_dev
, 0xe0, 0x00);
1437 reg_w(gspca_dev
, 0xe0, 0x01);
1438 set_led(gspca_dev
, 0);
1439 reg_w(gspca_dev
, 0xe0, 0x00);
1440 } else if ((sensor_id
& 0xfff0) == 0x9710) {
1444 sd
->sensor
= SENSOR_OV971x
;
1446 gspca_dev
->cam
.cam_mode
= ov971x_mode
;
1447 gspca_dev
->cam
.nmodes
= ARRAY_SIZE(ov971x_mode
);
1449 gspca_dev
->cam
.bulk
= 1;
1450 gspca_dev
->cam
.bulk_size
= 16384;
1451 gspca_dev
->cam
.bulk_nurbs
= 2;
1453 sccb_w_array(gspca_dev
, ov971x_init
,
1454 ARRAY_SIZE(ov971x_init
));
1456 /* set video format on bridge processor */
1457 /* access bridge processor's video format registers at: 0x00 */
1458 reg_w(gspca_dev
, 0x1c, 0x00);
1459 /*set register: 0x00 is 'RAW8', 0x40 is 'YUV422' (YUYV?)*/
1460 reg_w(gspca_dev
, 0x1d, 0x00);
1462 /* Will W. specific stuff
1464 * output (0x1f) if first webcam
1465 * input (0x17) if 2nd or 3rd webcam */
1466 p
= video_device_node_name(&gspca_dev
->vdev
);
1469 reg_w(gspca_dev
, 0x56, 0x1f);
1471 reg_w(gspca_dev
, 0x56, 0x17);
1472 } else if ((sensor_id
& 0xfff0) == 0x5620) {
1473 sd
->sensor
= SENSOR_OV562x
;
1474 gspca_dev
->cam
.cam_mode
= ov562x_mode
;
1475 gspca_dev
->cam
.nmodes
= ARRAY_SIZE(ov562x_mode
);
1477 reg_w_array(gspca_dev
, ov562x_init
,
1478 ARRAY_SIZE(ov562x_init
));
1479 sccb_w_array(gspca_dev
, ov562x_init_2
,
1480 ARRAY_SIZE(ov562x_init_2
));
1481 reg_w(gspca_dev
, 0xe0, 0x00);
1482 } else if ((sensor_id
& 0xfff0) == 0x3610) {
1483 sd
->sensor
= SENSOR_OV361x
;
1484 gspca_dev
->cam
.cam_mode
= ov361x_mode
;
1485 gspca_dev
->cam
.nmodes
= ARRAY_SIZE(ov361x_mode
);
1486 reg_w(gspca_dev
, 0xe7, 0x3a);
1487 reg_w(gspca_dev
, 0xf1, 0x60);
1488 sccb_write(gspca_dev
, 0x12, 0x80);
1490 pr_err("Unknown sensor %04x", sensor_id
);
1494 return gspca_dev
->usb_err
;
1497 static int sd_start_ov361x(struct gspca_dev
*gspca_dev
)
1499 sccb_write(gspca_dev
, 0x12, 0x80);
1501 switch (gspca_dev
->curr_mode
% (ov361x_last
)) {
1503 reg_w_array(gspca_dev
, ov361x_bridge_start_2048
,
1504 ARRAY_SIZE(ov361x_bridge_start_2048
));
1505 sccb_w_array(gspca_dev
, ov361x_start_2048
,
1506 ARRAY_SIZE(ov361x_start_2048
));
1509 reg_w_array(gspca_dev
, ov361x_bridge_start_1600
,
1510 ARRAY_SIZE(ov361x_bridge_start_1600
));
1511 sccb_w_array(gspca_dev
, ov361x_start_1600
,
1512 ARRAY_SIZE(ov361x_start_1600
));
1515 reg_w_array(gspca_dev
, ov361x_bridge_start_1024
,
1516 ARRAY_SIZE(ov361x_bridge_start_1024
));
1517 sccb_w_array(gspca_dev
, ov361x_start_1024
,
1518 ARRAY_SIZE(ov361x_start_1024
));
1521 reg_w_array(gspca_dev
, ov361x_bridge_start_640
,
1522 ARRAY_SIZE(ov361x_bridge_start_640
));
1523 sccb_w_array(gspca_dev
, ov361x_start_640
,
1524 ARRAY_SIZE(ov361x_start_640
));
1527 reg_w_array(gspca_dev
, ov361x_bridge_start_320
,
1528 ARRAY_SIZE(ov361x_bridge_start_320
));
1529 sccb_w_array(gspca_dev
, ov361x_start_320
,
1530 ARRAY_SIZE(ov361x_start_320
));
1533 reg_w_array(gspca_dev
, ov361x_bridge_start_160
,
1534 ARRAY_SIZE(ov361x_bridge_start_160
));
1535 sccb_w_array(gspca_dev
, ov361x_start_160
,
1536 ARRAY_SIZE(ov361x_start_160
));
1539 reg_w(gspca_dev
, 0xe0, 0x00); /* start transfer */
1541 return gspca_dev
->usb_err
;
1544 static int sd_start(struct gspca_dev
*gspca_dev
)
1546 struct sd
*sd
= (struct sd
*) gspca_dev
;
1548 if (sd
->sensor
== SENSOR_OV971x
)
1549 return gspca_dev
->usb_err
;
1550 if (sd
->sensor
== SENSOR_OV562x
)
1551 return gspca_dev
->usb_err
;
1552 if (sd
->sensor
== SENSOR_OV361x
)
1553 return sd_start_ov361x(gspca_dev
);
1555 switch (gspca_dev
->curr_mode
) {
1556 case QVGA_MODE
: /* 320x240 */
1557 sccb_w_array(gspca_dev
, ov965x_start_1_vga
,
1558 ARRAY_SIZE(ov965x_start_1_vga
));
1559 reg_w_array(gspca_dev
, bridge_start_qvga
,
1560 ARRAY_SIZE(bridge_start_qvga
));
1561 sccb_w_array(gspca_dev
, ov965x_start_2_qvga
,
1562 ARRAY_SIZE(ov965x_start_2_qvga
));
1564 case VGA_MODE
: /* 640x480 */
1565 sccb_w_array(gspca_dev
, ov965x_start_1_vga
,
1566 ARRAY_SIZE(ov965x_start_1_vga
));
1567 reg_w_array(gspca_dev
, bridge_start_vga
,
1568 ARRAY_SIZE(bridge_start_vga
));
1569 sccb_w_array(gspca_dev
, ov965x_start_2_vga
,
1570 ARRAY_SIZE(ov965x_start_2_vga
));
1572 case SVGA_MODE
: /* 800x600 */
1573 sccb_w_array(gspca_dev
, ov965x_start_1_svga
,
1574 ARRAY_SIZE(ov965x_start_1_svga
));
1575 reg_w_array(gspca_dev
, bridge_start_svga
,
1576 ARRAY_SIZE(bridge_start_svga
));
1577 sccb_w_array(gspca_dev
, ov965x_start_2_svga
,
1578 ARRAY_SIZE(ov965x_start_2_svga
));
1580 case XGA_MODE
: /* 1024x768 */
1581 sccb_w_array(gspca_dev
, ov965x_start_1_xga
,
1582 ARRAY_SIZE(ov965x_start_1_xga
));
1583 reg_w_array(gspca_dev
, bridge_start_xga
,
1584 ARRAY_SIZE(bridge_start_xga
));
1585 sccb_w_array(gspca_dev
, ov965x_start_2_svga
,
1586 ARRAY_SIZE(ov965x_start_2_svga
));
1589 /* case SXGA_MODE: * 1280x1024 */
1590 sccb_w_array(gspca_dev
, ov965x_start_1_sxga
,
1591 ARRAY_SIZE(ov965x_start_1_sxga
));
1592 reg_w_array(gspca_dev
, bridge_start_sxga
,
1593 ARRAY_SIZE(bridge_start_sxga
));
1594 sccb_w_array(gspca_dev
, ov965x_start_2_sxga
,
1595 ARRAY_SIZE(ov965x_start_2_sxga
));
1599 reg_w(gspca_dev
, 0xe0, 0x00);
1600 reg_w(gspca_dev
, 0xe0, 0x00);
1601 set_led(gspca_dev
, 1);
1602 return gspca_dev
->usb_err
;
1605 static void sd_stopN(struct gspca_dev
*gspca_dev
)
1607 if (((struct sd
*)gspca_dev
)->sensor
== SENSOR_OV361x
) {
1608 reg_w(gspca_dev
, 0xe0, 0x01); /* stop transfer */
1609 /* reg_w(gspca_dev, 0x31, 0x09); */
1612 reg_w(gspca_dev
, 0xe0, 0x01);
1613 set_led(gspca_dev
, 0);
1614 reg_w(gspca_dev
, 0xe0, 0x00);
1617 /* Values for bmHeaderInfo (Video and Still Image Payload Headers, 2.4.3.3) */
1618 #define UVC_STREAM_EOH (1 << 7)
1619 #define UVC_STREAM_ERR (1 << 6)
1620 #define UVC_STREAM_STI (1 << 5)
1621 #define UVC_STREAM_RES (1 << 4)
1622 #define UVC_STREAM_SCR (1 << 3)
1623 #define UVC_STREAM_PTS (1 << 2)
1624 #define UVC_STREAM_EOF (1 << 1)
1625 #define UVC_STREAM_FID (1 << 0)
1627 static void sd_pkt_scan(struct gspca_dev
*gspca_dev
,
1630 struct sd
*sd
= (struct sd
*) gspca_dev
;
1633 int remaining_len
= len
;
1636 payload_len
= gspca_dev
->cam
.bulk
? 2048 : 2040;
1638 len
= min(remaining_len
, payload_len
);
1640 /* Payloads are prefixed with a UVC-style header. We
1641 consider a frame to start when the FID toggles, or the PTS
1642 changes. A frame ends when EOF is set, and we've received
1643 the correct number of bytes. */
1645 /* Verify UVC header. Header length is always 12 */
1646 if (data
[0] != 12 || len
< 12) {
1647 gspca_dbg(gspca_dev
, D_PACK
, "bad header\n");
1652 if (data
[1] & UVC_STREAM_ERR
) {
1653 gspca_dbg(gspca_dev
, D_PACK
, "payload error\n");
1657 /* Extract PTS and FID */
1658 if (!(data
[1] & UVC_STREAM_PTS
)) {
1659 gspca_dbg(gspca_dev
, D_PACK
, "PTS not present\n");
1662 this_pts
= (data
[5] << 24) | (data
[4] << 16)
1663 | (data
[3] << 8) | data
[2];
1664 this_fid
= data
[1] & UVC_STREAM_FID
;
1666 /* If PTS or FID has changed, start a new frame. */
1667 if (this_pts
!= sd
->last_pts
|| this_fid
!= sd
->last_fid
) {
1668 if (gspca_dev
->last_packet_type
== INTER_PACKET
)
1669 gspca_frame_add(gspca_dev
, LAST_PACKET
,
1671 sd
->last_pts
= this_pts
;
1672 sd
->last_fid
= this_fid
;
1673 gspca_frame_add(gspca_dev
, FIRST_PACKET
,
1674 data
+ 12, len
- 12);
1675 /* If this packet is marked as EOF, end the frame */
1676 } else if (data
[1] & UVC_STREAM_EOF
) {
1678 gspca_frame_add(gspca_dev
, LAST_PACKET
,
1679 data
+ 12, len
- 12);
1682 /* Add the data from this payload */
1683 gspca_frame_add(gspca_dev
, INTER_PACKET
,
1684 data
+ 12, len
- 12);
1687 /* Done this payload */
1691 /* Discard data until a new frame starts. */
1692 gspca_dev
->last_packet_type
= DISCARD_PACKET
;
1695 remaining_len
-= len
;
1697 } while (remaining_len
> 0);
1700 static int sd_s_ctrl(struct v4l2_ctrl
*ctrl
)
1702 struct gspca_dev
*gspca_dev
=
1703 container_of(ctrl
->handler
, struct gspca_dev
, ctrl_handler
);
1705 gspca_dev
->usb_err
= 0;
1707 if (!gspca_dev
->streaming
)
1711 case V4L2_CID_BRIGHTNESS
:
1712 setbrightness(gspca_dev
, ctrl
->val
);
1714 case V4L2_CID_CONTRAST
:
1715 setcontrast(gspca_dev
, ctrl
->val
);
1717 case V4L2_CID_SATURATION
:
1718 setsatur(gspca_dev
, ctrl
->val
);
1720 case V4L2_CID_POWER_LINE_FREQUENCY
:
1721 setlightfreq(gspca_dev
, ctrl
->val
);
1723 case V4L2_CID_SHARPNESS
:
1724 setsharpness(gspca_dev
, ctrl
->val
);
1726 case V4L2_CID_AUTOGAIN
:
1728 setautogain(gspca_dev
, ctrl
->val
);
1729 if (!ctrl
->val
&& gspca_dev
->exposure
->is_new
)
1730 setexposure(gspca_dev
, gspca_dev
->exposure
->val
);
1733 return gspca_dev
->usb_err
;
1736 static const struct v4l2_ctrl_ops sd_ctrl_ops
= {
1737 .s_ctrl
= sd_s_ctrl
,
1740 static int sd_init_controls(struct gspca_dev
*gspca_dev
)
1742 struct sd
*sd
= (struct sd
*)gspca_dev
;
1743 struct v4l2_ctrl_handler
*hdl
= &gspca_dev
->ctrl_handler
;
1745 if (sd
->sensor
== SENSOR_OV971x
)
1747 if (sd
->sensor
== SENSOR_OV361x
)
1749 gspca_dev
->vdev
.ctrl_handler
= hdl
;
1750 v4l2_ctrl_handler_init(hdl
, 7);
1751 if (sd
->sensor
== SENSOR_OV562x
) {
1752 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1753 V4L2_CID_BRIGHTNESS
, -90, 90, 1, 0);
1755 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1756 V4L2_CID_BRIGHTNESS
, 0, 15, 1, 7);
1757 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1758 V4L2_CID_CONTRAST
, 0, 15, 1, 3);
1759 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1760 V4L2_CID_SATURATION
, 0, 4, 1, 2);
1762 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1763 V4L2_CID_SHARPNESS
, -1, 4, 1, -1);
1764 gspca_dev
->autogain
= v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1765 V4L2_CID_AUTOGAIN
, 0, 1, 1, 1);
1766 gspca_dev
->exposure
= v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
1767 V4L2_CID_EXPOSURE
, 0, 3, 1, 0);
1768 v4l2_ctrl_new_std_menu(hdl
, &sd_ctrl_ops
,
1769 V4L2_CID_POWER_LINE_FREQUENCY
,
1770 V4L2_CID_POWER_LINE_FREQUENCY_60HZ
, 0, 0);
1771 v4l2_ctrl_auto_cluster(3, &gspca_dev
->autogain
, 0, false);
1775 pr_err("Could not initialize controls\n");
1781 /* sub-driver description */
1782 static const struct sd_desc sd_desc
= {
1783 .name
= MODULE_NAME
,
1784 .config
= sd_config
,
1786 .init_controls
= sd_init_controls
,
1789 .pkt_scan
= sd_pkt_scan
,
1792 /* -- module initialisation -- */
1793 static const struct usb_device_id device_table
[] = {
1794 {USB_DEVICE(0x05a9, 0x8065)},
1795 {USB_DEVICE(0x06f8, 0x3003)},
1796 {USB_DEVICE(0x05a9, 0x1550)},
1800 MODULE_DEVICE_TABLE(usb
, device_table
);
1802 /* -- device connect -- */
1803 static int sd_probe(struct usb_interface
*intf
, const struct usb_device_id
*id
)
1805 return gspca_dev_probe(intf
, id
, &sd_desc
, sizeof(struct sd
),
1809 static struct usb_driver sd_driver
= {
1810 .name
= MODULE_NAME
,
1811 .id_table
= device_table
,
1813 .disconnect
= gspca_disconnect
,
1815 .suspend
= gspca_suspend
,
1816 .resume
= gspca_resume
,
1817 .reset_resume
= gspca_resume
,
1821 module_usb_driver(sd_driver
);