1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * GSPCA Endpoints (formerly known as AOX) se401 USB Camera sub Driver
5 * Copyright (C) 2011 Hans de Goede <hdegoede@redhat.com>
7 * Based on the v4l1 se401 driver which is:
9 * Copyright (c) 2000 Jeroen B. Vreeken (pe1rxq@amsat.org)
12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14 #define MODULE_NAME "se401"
16 #define BULK_SIZE 4096
17 #define PACKET_SIZE 1024
18 #define READ_REQ_SIZE 64
19 #define MAX_MODES ((READ_REQ_SIZE - 6) / 4)
20 /* The se401 compression algorithm uses a fixed quant factor, which
21 can be configured by setting the high nibble of the SE401_OPERATINGMODE
22 feature. This needs to exactly match what is in libv4l! */
23 #define SE401_QUANT_FACT 8
25 #include <linux/input.h>
26 #include <linux/slab.h>
30 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
31 MODULE_DESCRIPTION("Endpoints se401");
32 MODULE_LICENSE("GPL");
34 /* exposure change state machine states */
41 /* specific webcam descriptor */
43 struct gspca_dev gspca_dev
; /* !! must be the first item */
44 struct { /* exposure/freq control cluster */
45 struct v4l2_ctrl
*exposure
;
46 struct v4l2_ctrl
*freq
;
49 struct v4l2_pix_format fmts
[MAX_MODES
];
52 u8 packet
[PACKET_SIZE
];
56 u8 resetlevel_frame_count
;
57 int resetlevel_adjust_dir
;
58 int expo_change_state
;
62 static void se401_write_req(struct gspca_dev
*gspca_dev
, u16 req
, u16 value
,
67 if (gspca_dev
->usb_err
< 0)
70 err
= usb_control_msg(gspca_dev
->dev
,
71 usb_sndctrlpipe(gspca_dev
->dev
, 0), req
,
72 USB_DIR_OUT
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
73 value
, 0, NULL
, 0, 1000);
76 pr_err("write req failed req %#04x val %#04x error %d\n",
78 gspca_dev
->usb_err
= err
;
82 static void se401_read_req(struct gspca_dev
*gspca_dev
, u16 req
, int silent
)
86 if (gspca_dev
->usb_err
< 0)
89 if (USB_BUF_SZ
< READ_REQ_SIZE
) {
90 pr_err("USB_BUF_SZ too small!!\n");
91 gspca_dev
->usb_err
= -ENOBUFS
;
95 err
= usb_control_msg(gspca_dev
->dev
,
96 usb_rcvctrlpipe(gspca_dev
->dev
, 0), req
,
97 USB_DIR_IN
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
98 0, 0, gspca_dev
->usb_buf
, READ_REQ_SIZE
, 1000);
101 pr_err("read req failed req %#04x error %d\n",
103 gspca_dev
->usb_err
= err
;
105 * Make sure the buffer is zeroed to avoid uninitialized
108 memset(gspca_dev
->usb_buf
, 0, READ_REQ_SIZE
);
112 static void se401_set_feature(struct gspca_dev
*gspca_dev
,
113 u16 selector
, u16 param
)
117 if (gspca_dev
->usb_err
< 0)
120 err
= usb_control_msg(gspca_dev
->dev
,
121 usb_sndctrlpipe(gspca_dev
->dev
, 0),
122 SE401_REQ_SET_EXT_FEATURE
,
123 USB_DIR_OUT
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
124 param
, selector
, NULL
, 0, 1000);
126 pr_err("set feature failed sel %#04x param %#04x error %d\n",
127 selector
, param
, err
);
128 gspca_dev
->usb_err
= err
;
132 static int se401_get_feature(struct gspca_dev
*gspca_dev
, u16 selector
)
136 if (gspca_dev
->usb_err
< 0)
137 return gspca_dev
->usb_err
;
139 if (USB_BUF_SZ
< 2) {
140 pr_err("USB_BUF_SZ too small!!\n");
141 gspca_dev
->usb_err
= -ENOBUFS
;
142 return gspca_dev
->usb_err
;
145 err
= usb_control_msg(gspca_dev
->dev
,
146 usb_rcvctrlpipe(gspca_dev
->dev
, 0),
147 SE401_REQ_GET_EXT_FEATURE
,
148 USB_DIR_IN
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
149 0, selector
, gspca_dev
->usb_buf
, 2, 1000);
151 pr_err("get feature failed sel %#04x error %d\n",
153 gspca_dev
->usb_err
= err
;
156 return gspca_dev
->usb_buf
[0] | (gspca_dev
->usb_buf
[1] << 8);
159 static void setbrightness(struct gspca_dev
*gspca_dev
, s32 val
)
161 /* HDG: this does not seem to do anything on my cam */
162 se401_write_req(gspca_dev
, SE401_REQ_SET_BRT
, val
, 0);
165 static void setgain(struct gspca_dev
*gspca_dev
, s32 val
)
170 se401_set_feature(gspca_dev
, HV7131_REG_ARCG
, gain
);
171 /* green color gain */
172 se401_set_feature(gspca_dev
, HV7131_REG_AGCG
, gain
);
173 /* blue color gain */
174 se401_set_feature(gspca_dev
, HV7131_REG_ABCG
, gain
);
177 static void setexposure(struct gspca_dev
*gspca_dev
, s32 val
, s32 freq
)
179 struct sd
*sd
= (struct sd
*) gspca_dev
;
180 int integration
= val
<< 6;
181 u8 expose_h
, expose_m
, expose_l
;
183 /* Do this before the set_feature calls, for proper timing wrt
184 the interrupt driven pkt_scan. Note we may still race but that
185 is not a big issue, the expo change state machine is merely for
186 avoiding underexposed frames getting send out, if one sneaks
188 sd
->expo_change_state
= EXPO_CHANGED
;
190 if (freq
== V4L2_CID_POWER_LINE_FREQUENCY_50HZ
)
191 integration
= integration
- integration
% 106667;
192 if (freq
== V4L2_CID_POWER_LINE_FREQUENCY_60HZ
)
193 integration
= integration
- integration
% 88889;
195 expose_h
= (integration
>> 16);
196 expose_m
= (integration
>> 8);
197 expose_l
= integration
;
199 /* integration time low */
200 se401_set_feature(gspca_dev
, HV7131_REG_TITL
, expose_l
);
201 /* integration time mid */
202 se401_set_feature(gspca_dev
, HV7131_REG_TITM
, expose_m
);
203 /* integration time high */
204 se401_set_feature(gspca_dev
, HV7131_REG_TITU
, expose_h
);
207 static int sd_config(struct gspca_dev
*gspca_dev
,
208 const struct usb_device_id
*id
)
210 struct sd
*sd
= (struct sd
*)gspca_dev
;
211 struct cam
*cam
= &gspca_dev
->cam
;
212 u8
*cd
= gspca_dev
->usb_buf
;
214 int widths
[MAX_MODES
], heights
[MAX_MODES
];
216 /* Read the camera descriptor */
217 se401_read_req(gspca_dev
, SE401_REQ_GET_CAMERA_DESCRIPTOR
, 1);
218 if (gspca_dev
->usb_err
) {
219 /* Sometimes after being idle for a while the se401 won't
220 respond and needs a good kicking */
221 usb_reset_device(gspca_dev
->dev
);
222 gspca_dev
->usb_err
= 0;
223 se401_read_req(gspca_dev
, SE401_REQ_GET_CAMERA_DESCRIPTOR
, 0);
226 /* Some cameras start with their LED on */
227 se401_write_req(gspca_dev
, SE401_REQ_LED_CONTROL
, 0, 0);
228 if (gspca_dev
->usb_err
)
229 return gspca_dev
->usb_err
;
232 pr_err("Wrong descriptor type\n");
236 if (!(cd
[2] & SE401_FORMAT_BAYER
)) {
237 pr_err("Bayer format not supported!\n");
242 pr_info("ExtraFeatures: %d\n", cd
[3]);
244 n
= cd
[4] | (cd
[5] << 8);
246 pr_err("Too many frame sizes\n");
250 for (i
= 0; i
< n
; i
++) {
251 widths
[i
] = cd
[6 + i
* 4 + 0] | (cd
[6 + i
* 4 + 1] << 8);
252 heights
[i
] = cd
[6 + i
* 4 + 2] | (cd
[6 + i
* 4 + 3] << 8);
255 for (i
= 0; i
< n
; i
++) {
256 sd
->fmts
[i
].width
= widths
[i
];
257 sd
->fmts
[i
].height
= heights
[i
];
258 sd
->fmts
[i
].field
= V4L2_FIELD_NONE
;
259 sd
->fmts
[i
].colorspace
= V4L2_COLORSPACE_SRGB
;
260 sd
->fmts
[i
].priv
= 1;
262 /* janggu compression only works for 1/4th or 1/16th res */
263 for (j
= 0; j
< n
; j
++) {
264 if (widths
[j
] / 2 == widths
[i
] &&
265 heights
[j
] / 2 == heights
[i
]) {
266 sd
->fmts
[i
].priv
= 2;
270 /* 1/16th if available too is better then 1/4th, because
271 we then use a larger area of the sensor */
272 for (j
= 0; j
< n
; j
++) {
273 if (widths
[j
] / 4 == widths
[i
] &&
274 heights
[j
] / 4 == heights
[i
]) {
275 sd
->fmts
[i
].priv
= 4;
280 if (sd
->fmts
[i
].priv
== 1) {
281 /* Not a 1/4th or 1/16th res, use bayer */
282 sd
->fmts
[i
].pixelformat
= V4L2_PIX_FMT_SBGGR8
;
283 sd
->fmts
[i
].bytesperline
= widths
[i
];
284 sd
->fmts
[i
].sizeimage
= widths
[i
] * heights
[i
];
285 pr_info("Frame size: %dx%d bayer\n",
286 widths
[i
], heights
[i
]);
288 /* Found a match use janggu compression */
289 sd
->fmts
[i
].pixelformat
= V4L2_PIX_FMT_SE401
;
290 sd
->fmts
[i
].bytesperline
= 0;
291 sd
->fmts
[i
].sizeimage
= widths
[i
] * heights
[i
] * 3;
292 pr_info("Frame size: %dx%d 1/%dth janggu\n",
293 widths
[i
], heights
[i
],
294 sd
->fmts
[i
].priv
* sd
->fmts
[i
].priv
);
298 cam
->cam_mode
= sd
->fmts
;
301 cam
->bulk_size
= BULK_SIZE
;
303 sd
->resetlevel
= 0x2d; /* Set initial resetlevel */
305 /* See if the camera supports brightness */
306 se401_read_req(gspca_dev
, SE401_REQ_GET_BRT
, 1);
307 sd
->has_brightness
= !!gspca_dev
->usb_err
;
308 gspca_dev
->usb_err
= 0;
313 /* this function is called at probe and resume time */
314 static int sd_init(struct gspca_dev
*gspca_dev
)
319 /* function called at start time before URB creation */
320 static int sd_isoc_init(struct gspca_dev
*gspca_dev
)
322 gspca_dev
->alt
= 1; /* Ignore the bogus isoc alt settings */
324 return gspca_dev
->usb_err
;
327 /* -- start the camera -- */
328 static int sd_start(struct gspca_dev
*gspca_dev
)
330 struct sd
*sd
= (struct sd
*)gspca_dev
;
331 int mult
= gspca_dev
->cam
.cam_mode
[gspca_dev
->curr_mode
].priv
;
334 se401_write_req(gspca_dev
, SE401_REQ_CAMERA_POWER
, 1, 1);
335 if (gspca_dev
->usb_err
) {
336 /* Sometimes after being idle for a while the se401 won't
337 respond and needs a good kicking */
338 usb_reset_device(gspca_dev
->dev
);
339 gspca_dev
->usb_err
= 0;
340 se401_write_req(gspca_dev
, SE401_REQ_CAMERA_POWER
, 1, 0);
342 se401_write_req(gspca_dev
, SE401_REQ_LED_CONTROL
, 1, 0);
344 se401_set_feature(gspca_dev
, HV7131_REG_MODE_B
, 0x05);
346 /* set size + mode */
347 se401_write_req(gspca_dev
, SE401_REQ_SET_WIDTH
,
348 gspca_dev
->pixfmt
.width
* mult
, 0);
349 se401_write_req(gspca_dev
, SE401_REQ_SET_HEIGHT
,
350 gspca_dev
->pixfmt
.height
* mult
, 0);
352 * HDG: disabled this as it does not seem to do anything
353 * se401_write_req(gspca_dev, SE401_REQ_SET_OUTPUT_MODE,
354 * SE401_FORMAT_BAYER, 0);
358 case 1: /* Raw bayer */
360 case 2: /* 1/4th janggu */
361 mode
= SE401_QUANT_FACT
<< 4; break;
362 case 4: /* 1/16th janggu */
363 mode
= (SE401_QUANT_FACT
<< 4) | 0x02; break;
365 se401_set_feature(gspca_dev
, SE401_OPERATINGMODE
, mode
);
367 se401_set_feature(gspca_dev
, HV7131_REG_ARLV
, sd
->resetlevel
);
371 sd
->restart_stream
= 0;
372 sd
->resetlevel_frame_count
= 0;
373 sd
->resetlevel_adjust_dir
= 0;
374 sd
->expo_change_state
= EXPO_NO_CHANGE
;
376 se401_write_req(gspca_dev
, SE401_REQ_START_CONTINUOUS_CAPTURE
, 0, 0);
378 return gspca_dev
->usb_err
;
381 static void sd_stopN(struct gspca_dev
*gspca_dev
)
383 se401_write_req(gspca_dev
, SE401_REQ_STOP_CONTINUOUS_CAPTURE
, 0, 0);
384 se401_write_req(gspca_dev
, SE401_REQ_LED_CONTROL
, 0, 0);
385 se401_write_req(gspca_dev
, SE401_REQ_CAMERA_POWER
, 0, 0);
388 static void sd_dq_callback(struct gspca_dev
*gspca_dev
)
390 struct sd
*sd
= (struct sd
*)gspca_dev
;
391 unsigned int ahrc
, alrc
;
392 int oldreset
, adjust_dir
;
394 /* Restart the stream if requested do so by pkt_scan */
395 if (sd
->restart_stream
) {
398 sd
->restart_stream
= 0;
401 /* Automatically adjust sensor reset level
402 Hyundai have some really nice docs about this and other sensor
403 related stuff on their homepage: www.hei.co.kr */
404 sd
->resetlevel_frame_count
++;
405 if (sd
->resetlevel_frame_count
< 20)
408 /* For some reason this normally read-only register doesn't get reset
409 to zero after reading them just once... */
410 se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOH
);
411 se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOL
);
412 se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOH
);
413 se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOL
);
414 ahrc
= 256*se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOH
) +
415 se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOL
);
416 alrc
= 256*se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOH
) +
417 se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOL
);
419 /* Not an exact science, but it seems to work pretty well... */
420 oldreset
= sd
->resetlevel
;
422 while (alrc
>= 10 && sd
->resetlevel
< 63) {
426 } else if (ahrc
> 20) {
427 while (ahrc
>= 20 && sd
->resetlevel
> 0) {
432 /* Detect ping-pong-ing and halve adjustment to avoid overshoot */
433 if (sd
->resetlevel
> oldreset
)
437 if (sd
->resetlevel_adjust_dir
&&
438 sd
->resetlevel_adjust_dir
!= adjust_dir
)
439 sd
->resetlevel
= oldreset
+ (sd
->resetlevel
- oldreset
) / 2;
441 if (sd
->resetlevel
!= oldreset
) {
442 sd
->resetlevel_adjust_dir
= adjust_dir
;
443 se401_set_feature(gspca_dev
, HV7131_REG_ARLV
, sd
->resetlevel
);
446 sd
->resetlevel_frame_count
= 0;
449 static void sd_complete_frame(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
451 struct sd
*sd
= (struct sd
*)gspca_dev
;
453 switch (sd
->expo_change_state
) {
455 /* The exposure was changed while this frame
456 was being send, so this frame is ok */
457 sd
->expo_change_state
= EXPO_DROP_FRAME
;
459 case EXPO_DROP_FRAME
:
460 /* The exposure was changed while this frame
461 was being captured, drop it! */
462 gspca_dev
->last_packet_type
= DISCARD_PACKET
;
463 sd
->expo_change_state
= EXPO_NO_CHANGE
;
468 gspca_frame_add(gspca_dev
, LAST_PACKET
, data
, len
);
471 static void sd_pkt_scan_janggu(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
473 struct sd
*sd
= (struct sd
*)gspca_dev
;
474 int imagesize
= gspca_dev
->pixfmt
.width
* gspca_dev
->pixfmt
.height
;
475 int i
, plen
, bits
, pixels
, info
, count
;
477 if (sd
->restart_stream
)
480 /* Sometimes a 1024 bytes garbage bulk packet is send between frames */
481 if (gspca_dev
->last_packet_type
== LAST_PACKET
&& len
== 1024) {
482 gspca_dev
->last_packet_type
= DISCARD_PACKET
;
488 /* Read header if not already be present from prev bulk pkt */
489 if (sd
->packet_read
< 4) {
490 count
= 4 - sd
->packet_read
;
493 memcpy(&sd
->packet
[sd
->packet_read
], &data
[i
], count
);
494 sd
->packet_read
+= count
;
496 if (sd
->packet_read
< 4)
499 bits
= sd
->packet
[3] + (sd
->packet
[2] << 8);
500 pixels
= sd
->packet
[1] + ((sd
->packet
[0] & 0x3f) << 8);
501 info
= (sd
->packet
[0] & 0xc0) >> 6;
502 plen
= ((bits
+ 47) >> 4) << 1;
505 pr_err("invalid packet len %d restarting stream\n",
510 pr_err("unknown frame info value restarting stream\n");
514 /* Read (remainder of) packet contents */
515 count
= plen
- sd
->packet_read
;
518 memcpy(&sd
->packet
[sd
->packet_read
], &data
[i
], count
);
519 sd
->packet_read
+= count
;
521 if (sd
->packet_read
< plen
)
524 sd
->pixels_read
+= pixels
;
528 case 0: /* Frame data */
529 gspca_frame_add(gspca_dev
, INTER_PACKET
, sd
->packet
,
533 if (sd
->pixels_read
!= imagesize
) {
534 pr_err("frame size %d expected %d\n",
535 sd
->pixels_read
, imagesize
);
538 sd_complete_frame(gspca_dev
, sd
->packet
, plen
);
539 return; /* Discard the rest of the bulk packet !! */
541 gspca_frame_add(gspca_dev
, FIRST_PACKET
, sd
->packet
,
543 sd
->pixels_read
= pixels
;
550 sd
->restart_stream
= 1;
551 /* Give userspace a 0 bytes frame, so our dq callback gets
552 called and it can restart the stream */
553 gspca_frame_add(gspca_dev
, FIRST_PACKET
, NULL
, 0);
554 gspca_frame_add(gspca_dev
, LAST_PACKET
, NULL
, 0);
557 static void sd_pkt_scan_bayer(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
559 struct cam
*cam
= &gspca_dev
->cam
;
560 int imagesize
= cam
->cam_mode
[gspca_dev
->curr_mode
].sizeimage
;
562 if (gspca_dev
->image_len
== 0) {
563 gspca_frame_add(gspca_dev
, FIRST_PACKET
, data
, len
);
567 if (gspca_dev
->image_len
+ len
>= imagesize
) {
568 sd_complete_frame(gspca_dev
, data
, len
);
572 gspca_frame_add(gspca_dev
, INTER_PACKET
, data
, len
);
575 static void sd_pkt_scan(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
577 int mult
= gspca_dev
->cam
.cam_mode
[gspca_dev
->curr_mode
].priv
;
582 if (mult
== 1) /* mult == 1 means raw bayer */
583 sd_pkt_scan_bayer(gspca_dev
, data
, len
);
585 sd_pkt_scan_janggu(gspca_dev
, data
, len
);
588 #if IS_ENABLED(CONFIG_INPUT)
589 static int sd_int_pkt_scan(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
591 struct sd
*sd
= (struct sd
*)gspca_dev
;
605 if (sd
->button_state
!= state
) {
606 input_report_key(gspca_dev
->input_dev
, KEY_CAMERA
, state
);
607 input_sync(gspca_dev
->input_dev
);
608 sd
->button_state
= state
;
615 static int sd_s_ctrl(struct v4l2_ctrl
*ctrl
)
617 struct gspca_dev
*gspca_dev
=
618 container_of(ctrl
->handler
, struct gspca_dev
, ctrl_handler
);
619 struct sd
*sd
= (struct sd
*)gspca_dev
;
621 gspca_dev
->usb_err
= 0;
623 if (!gspca_dev
->streaming
)
627 case V4L2_CID_BRIGHTNESS
:
628 setbrightness(gspca_dev
, ctrl
->val
);
631 setgain(gspca_dev
, ctrl
->val
);
633 case V4L2_CID_EXPOSURE
:
634 setexposure(gspca_dev
, ctrl
->val
, sd
->freq
->val
);
637 return gspca_dev
->usb_err
;
640 static const struct v4l2_ctrl_ops sd_ctrl_ops
= {
644 static int sd_init_controls(struct gspca_dev
*gspca_dev
)
646 struct sd
*sd
= (struct sd
*)gspca_dev
;
647 struct v4l2_ctrl_handler
*hdl
= &gspca_dev
->ctrl_handler
;
649 gspca_dev
->vdev
.ctrl_handler
= hdl
;
650 v4l2_ctrl_handler_init(hdl
, 4);
651 if (sd
->has_brightness
)
652 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
653 V4L2_CID_BRIGHTNESS
, 0, 255, 1, 15);
654 /* max is really 63 but > 50 is not pretty */
655 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
656 V4L2_CID_GAIN
, 0, 50, 1, 25);
657 sd
->exposure
= v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
658 V4L2_CID_EXPOSURE
, 0, 32767, 1, 15000);
659 sd
->freq
= v4l2_ctrl_new_std_menu(hdl
, &sd_ctrl_ops
,
660 V4L2_CID_POWER_LINE_FREQUENCY
,
661 V4L2_CID_POWER_LINE_FREQUENCY_60HZ
, 0, 0);
664 pr_err("Could not initialize controls\n");
667 v4l2_ctrl_cluster(2, &sd
->exposure
);
671 /* sub-driver description */
672 static const struct sd_desc sd_desc
= {
676 .init_controls
= sd_init_controls
,
677 .isoc_init
= sd_isoc_init
,
680 .dq_callback
= sd_dq_callback
,
681 .pkt_scan
= sd_pkt_scan
,
682 #if IS_ENABLED(CONFIG_INPUT)
683 .int_pkt_scan
= sd_int_pkt_scan
,
687 /* -- module initialisation -- */
688 static const struct usb_device_id device_table
[] = {
689 {USB_DEVICE(0x03e8, 0x0004)}, /* Endpoints/Aox SE401 */
690 {USB_DEVICE(0x0471, 0x030b)}, /* Philips PCVC665K */
691 {USB_DEVICE(0x047d, 0x5001)}, /* Kensington 67014 */
692 {USB_DEVICE(0x047d, 0x5002)}, /* Kensington 6701(5/7) */
693 {USB_DEVICE(0x047d, 0x5003)}, /* Kensington 67016 */
696 MODULE_DEVICE_TABLE(usb
, device_table
);
698 /* -- device connect -- */
699 static int sd_probe(struct usb_interface
*intf
,
700 const struct usb_device_id
*id
)
702 return gspca_dev_probe(intf
, id
, &sd_desc
, sizeof(struct sd
),
706 static int sd_pre_reset(struct usb_interface
*intf
)
711 static int sd_post_reset(struct usb_interface
*intf
)
716 static struct usb_driver sd_driver
= {
718 .id_table
= device_table
,
720 .disconnect
= gspca_disconnect
,
722 .suspend
= gspca_suspend
,
723 .resume
= gspca_resume
,
724 .reset_resume
= gspca_resume
,
726 .pre_reset
= sd_pre_reset
,
727 .post_reset
= sd_post_reset
,
730 module_usb_driver(sd_driver
);