2 * GSPCA Endpoints (formerly known as AOX) se401 USB Camera sub Driver
4 * Copyright (C) 2011 Hans de Goede <hdegoede@redhat.com>
6 * Based on the v4l1 se401 driver which is:
8 * Copyright (c) 2000 Jeroen B. Vreeken (pe1rxq@amsat.org)
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
28 #define MODULE_NAME "se401"
30 #define BULK_SIZE 4096
31 #define PACKET_SIZE 1024
32 #define READ_REQ_SIZE 64
33 #define MAX_MODES ((READ_REQ_SIZE - 6) / 4)
34 /* The se401 compression algorithm uses a fixed quant factor, which
35 can be configured by setting the high nibble of the SE401_OPERATINGMODE
36 feature. This needs to exactly match what is in libv4l! */
37 #define SE401_QUANT_FACT 8
39 #include <linux/input.h>
40 #include <linux/slab.h>
44 MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
45 MODULE_DESCRIPTION("Endpoints se401");
46 MODULE_LICENSE("GPL");
48 /* exposure change state machine states */
55 /* specific webcam descriptor */
57 struct gspca_dev gspca_dev
; /* !! must be the first item */
58 struct { /* exposure/freq control cluster */
59 struct v4l2_ctrl
*exposure
;
60 struct v4l2_ctrl
*freq
;
63 struct v4l2_pix_format fmts
[MAX_MODES
];
66 u8 packet
[PACKET_SIZE
];
70 u8 resetlevel_frame_count
;
71 int resetlevel_adjust_dir
;
72 int expo_change_state
;
76 static void se401_write_req(struct gspca_dev
*gspca_dev
, u16 req
, u16 value
,
81 if (gspca_dev
->usb_err
< 0)
84 err
= usb_control_msg(gspca_dev
->dev
,
85 usb_sndctrlpipe(gspca_dev
->dev
, 0), req
,
86 USB_DIR_OUT
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
87 value
, 0, NULL
, 0, 1000);
90 pr_err("write req failed req %#04x val %#04x error %d\n",
92 gspca_dev
->usb_err
= err
;
96 static void se401_read_req(struct gspca_dev
*gspca_dev
, u16 req
, int silent
)
100 if (gspca_dev
->usb_err
< 0)
103 if (USB_BUF_SZ
< READ_REQ_SIZE
) {
104 pr_err("USB_BUF_SZ too small!!\n");
105 gspca_dev
->usb_err
= -ENOBUFS
;
109 err
= usb_control_msg(gspca_dev
->dev
,
110 usb_rcvctrlpipe(gspca_dev
->dev
, 0), req
,
111 USB_DIR_IN
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
112 0, 0, gspca_dev
->usb_buf
, READ_REQ_SIZE
, 1000);
115 pr_err("read req failed req %#04x error %d\n",
117 gspca_dev
->usb_err
= err
;
121 static void se401_set_feature(struct gspca_dev
*gspca_dev
,
122 u16 selector
, u16 param
)
126 if (gspca_dev
->usb_err
< 0)
129 err
= usb_control_msg(gspca_dev
->dev
,
130 usb_sndctrlpipe(gspca_dev
->dev
, 0),
131 SE401_REQ_SET_EXT_FEATURE
,
132 USB_DIR_OUT
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
133 param
, selector
, NULL
, 0, 1000);
135 pr_err("set feature failed sel %#04x param %#04x error %d\n",
136 selector
, param
, err
);
137 gspca_dev
->usb_err
= err
;
141 static int se401_get_feature(struct gspca_dev
*gspca_dev
, u16 selector
)
145 if (gspca_dev
->usb_err
< 0)
146 return gspca_dev
->usb_err
;
148 if (USB_BUF_SZ
< 2) {
149 pr_err("USB_BUF_SZ too small!!\n");
150 gspca_dev
->usb_err
= -ENOBUFS
;
151 return gspca_dev
->usb_err
;
154 err
= usb_control_msg(gspca_dev
->dev
,
155 usb_rcvctrlpipe(gspca_dev
->dev
, 0),
156 SE401_REQ_GET_EXT_FEATURE
,
157 USB_DIR_IN
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
158 0, selector
, gspca_dev
->usb_buf
, 2, 1000);
160 pr_err("get feature failed sel %#04x error %d\n",
162 gspca_dev
->usb_err
= err
;
165 return gspca_dev
->usb_buf
[0] | (gspca_dev
->usb_buf
[1] << 8);
168 static void setbrightness(struct gspca_dev
*gspca_dev
, s32 val
)
170 /* HDG: this does not seem to do anything on my cam */
171 se401_write_req(gspca_dev
, SE401_REQ_SET_BRT
, val
, 0);
174 static void setgain(struct gspca_dev
*gspca_dev
, s32 val
)
179 se401_set_feature(gspca_dev
, HV7131_REG_ARCG
, gain
);
180 /* green color gain */
181 se401_set_feature(gspca_dev
, HV7131_REG_AGCG
, gain
);
182 /* blue color gain */
183 se401_set_feature(gspca_dev
, HV7131_REG_ABCG
, gain
);
186 static void setexposure(struct gspca_dev
*gspca_dev
, s32 val
, s32 freq
)
188 struct sd
*sd
= (struct sd
*) gspca_dev
;
189 int integration
= val
<< 6;
190 u8 expose_h
, expose_m
, expose_l
;
192 /* Do this before the set_feature calls, for proper timing wrt
193 the interrupt driven pkt_scan. Note we may still race but that
194 is not a big issue, the expo change state machine is merely for
195 avoiding underexposed frames getting send out, if one sneaks
197 sd
->expo_change_state
= EXPO_CHANGED
;
199 if (freq
== V4L2_CID_POWER_LINE_FREQUENCY_50HZ
)
200 integration
= integration
- integration
% 106667;
201 if (freq
== V4L2_CID_POWER_LINE_FREQUENCY_60HZ
)
202 integration
= integration
- integration
% 88889;
204 expose_h
= (integration
>> 16);
205 expose_m
= (integration
>> 8);
206 expose_l
= integration
;
208 /* integration time low */
209 se401_set_feature(gspca_dev
, HV7131_REG_TITL
, expose_l
);
210 /* integration time mid */
211 se401_set_feature(gspca_dev
, HV7131_REG_TITM
, expose_m
);
212 /* integration time high */
213 se401_set_feature(gspca_dev
, HV7131_REG_TITU
, expose_h
);
216 static int sd_config(struct gspca_dev
*gspca_dev
,
217 const struct usb_device_id
*id
)
219 struct sd
*sd
= (struct sd
*)gspca_dev
;
220 struct cam
*cam
= &gspca_dev
->cam
;
221 u8
*cd
= gspca_dev
->usb_buf
;
223 int widths
[MAX_MODES
], heights
[MAX_MODES
];
225 /* Read the camera descriptor */
226 se401_read_req(gspca_dev
, SE401_REQ_GET_CAMERA_DESCRIPTOR
, 1);
227 if (gspca_dev
->usb_err
) {
228 /* Sometimes after being idle for a while the se401 won't
229 respond and needs a good kicking */
230 usb_reset_device(gspca_dev
->dev
);
231 gspca_dev
->usb_err
= 0;
232 se401_read_req(gspca_dev
, SE401_REQ_GET_CAMERA_DESCRIPTOR
, 0);
235 /* Some cameras start with their LED on */
236 se401_write_req(gspca_dev
, SE401_REQ_LED_CONTROL
, 0, 0);
237 if (gspca_dev
->usb_err
)
238 return gspca_dev
->usb_err
;
241 pr_err("Wrong descriptor type\n");
245 if (!(cd
[2] & SE401_FORMAT_BAYER
)) {
246 pr_err("Bayer format not supported!\n");
251 pr_info("ExtraFeatures: %d\n", cd
[3]);
253 n
= cd
[4] | (cd
[5] << 8);
255 pr_err("Too many frame sizes\n");
259 for (i
= 0; i
< n
; i
++) {
260 widths
[i
] = cd
[6 + i
* 4 + 0] | (cd
[6 + i
* 4 + 1] << 8);
261 heights
[i
] = cd
[6 + i
* 4 + 2] | (cd
[6 + i
* 4 + 3] << 8);
264 for (i
= 0; i
< n
; i
++) {
265 sd
->fmts
[i
].width
= widths
[i
];
266 sd
->fmts
[i
].height
= heights
[i
];
267 sd
->fmts
[i
].field
= V4L2_FIELD_NONE
;
268 sd
->fmts
[i
].colorspace
= V4L2_COLORSPACE_SRGB
;
269 sd
->fmts
[i
].priv
= 1;
271 /* janggu compression only works for 1/4th or 1/16th res */
272 for (j
= 0; j
< n
; j
++) {
273 if (widths
[j
] / 2 == widths
[i
] &&
274 heights
[j
] / 2 == heights
[i
]) {
275 sd
->fmts
[i
].priv
= 2;
279 /* 1/16th if available too is better then 1/4th, because
280 we then use a larger area of the sensor */
281 for (j
= 0; j
< n
; j
++) {
282 if (widths
[j
] / 4 == widths
[i
] &&
283 heights
[j
] / 4 == heights
[i
]) {
284 sd
->fmts
[i
].priv
= 4;
289 if (sd
->fmts
[i
].priv
== 1) {
290 /* Not a 1/4th or 1/16th res, use bayer */
291 sd
->fmts
[i
].pixelformat
= V4L2_PIX_FMT_SBGGR8
;
292 sd
->fmts
[i
].bytesperline
= widths
[i
];
293 sd
->fmts
[i
].sizeimage
= widths
[i
] * heights
[i
];
294 pr_info("Frame size: %dx%d bayer\n",
295 widths
[i
], heights
[i
]);
297 /* Found a match use janggu compression */
298 sd
->fmts
[i
].pixelformat
= V4L2_PIX_FMT_SE401
;
299 sd
->fmts
[i
].bytesperline
= 0;
300 sd
->fmts
[i
].sizeimage
= widths
[i
] * heights
[i
] * 3;
301 pr_info("Frame size: %dx%d 1/%dth janggu\n",
302 widths
[i
], heights
[i
],
303 sd
->fmts
[i
].priv
* sd
->fmts
[i
].priv
);
307 cam
->cam_mode
= sd
->fmts
;
310 cam
->bulk_size
= BULK_SIZE
;
312 sd
->resetlevel
= 0x2d; /* Set initial resetlevel */
314 /* See if the camera supports brightness */
315 se401_read_req(gspca_dev
, SE401_REQ_GET_BRT
, 1);
316 sd
->has_brightness
= !!gspca_dev
->usb_err
;
317 gspca_dev
->usb_err
= 0;
322 /* this function is called at probe and resume time */
323 static int sd_init(struct gspca_dev
*gspca_dev
)
328 /* function called at start time before URB creation */
329 static int sd_isoc_init(struct gspca_dev
*gspca_dev
)
331 gspca_dev
->alt
= 1; /* Ignore the bogus isoc alt settings */
333 return gspca_dev
->usb_err
;
336 /* -- start the camera -- */
337 static int sd_start(struct gspca_dev
*gspca_dev
)
339 struct sd
*sd
= (struct sd
*)gspca_dev
;
340 int mult
= gspca_dev
->cam
.cam_mode
[gspca_dev
->curr_mode
].priv
;
343 se401_write_req(gspca_dev
, SE401_REQ_CAMERA_POWER
, 1, 1);
344 if (gspca_dev
->usb_err
) {
345 /* Sometimes after being idle for a while the se401 won't
346 respond and needs a good kicking */
347 usb_reset_device(gspca_dev
->dev
);
348 gspca_dev
->usb_err
= 0;
349 se401_write_req(gspca_dev
, SE401_REQ_CAMERA_POWER
, 1, 0);
351 se401_write_req(gspca_dev
, SE401_REQ_LED_CONTROL
, 1, 0);
353 se401_set_feature(gspca_dev
, HV7131_REG_MODE_B
, 0x05);
355 /* set size + mode */
356 se401_write_req(gspca_dev
, SE401_REQ_SET_WIDTH
,
357 gspca_dev
->pixfmt
.width
* mult
, 0);
358 se401_write_req(gspca_dev
, SE401_REQ_SET_HEIGHT
,
359 gspca_dev
->pixfmt
.height
* mult
, 0);
361 * HDG: disabled this as it does not seem to do anything
362 * se401_write_req(gspca_dev, SE401_REQ_SET_OUTPUT_MODE,
363 * SE401_FORMAT_BAYER, 0);
367 case 1: /* Raw bayer */
369 case 2: /* 1/4th janggu */
370 mode
= SE401_QUANT_FACT
<< 4; break;
371 case 4: /* 1/16th janggu */
372 mode
= (SE401_QUANT_FACT
<< 4) | 0x02; break;
374 se401_set_feature(gspca_dev
, SE401_OPERATINGMODE
, mode
);
376 se401_set_feature(gspca_dev
, HV7131_REG_ARLV
, sd
->resetlevel
);
380 sd
->restart_stream
= 0;
381 sd
->resetlevel_frame_count
= 0;
382 sd
->resetlevel_adjust_dir
= 0;
383 sd
->expo_change_state
= EXPO_NO_CHANGE
;
385 se401_write_req(gspca_dev
, SE401_REQ_START_CONTINUOUS_CAPTURE
, 0, 0);
387 return gspca_dev
->usb_err
;
390 static void sd_stopN(struct gspca_dev
*gspca_dev
)
392 se401_write_req(gspca_dev
, SE401_REQ_STOP_CONTINUOUS_CAPTURE
, 0, 0);
393 se401_write_req(gspca_dev
, SE401_REQ_LED_CONTROL
, 0, 0);
394 se401_write_req(gspca_dev
, SE401_REQ_CAMERA_POWER
, 0, 0);
397 static void sd_dq_callback(struct gspca_dev
*gspca_dev
)
399 struct sd
*sd
= (struct sd
*)gspca_dev
;
400 unsigned int ahrc
, alrc
;
401 int oldreset
, adjust_dir
;
403 /* Restart the stream if requested do so by pkt_scan */
404 if (sd
->restart_stream
) {
407 sd
->restart_stream
= 0;
410 /* Automatically adjust sensor reset level
411 Hyundai have some really nice docs about this and other sensor
412 related stuff on their homepage: www.hei.co.kr */
413 sd
->resetlevel_frame_count
++;
414 if (sd
->resetlevel_frame_count
< 20)
417 /* For some reason this normally read-only register doesn't get reset
418 to zero after reading them just once... */
419 se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOH
);
420 se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOL
);
421 se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOH
);
422 se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOL
);
423 ahrc
= 256*se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOH
) +
424 se401_get_feature(gspca_dev
, HV7131_REG_HIREFNOL
);
425 alrc
= 256*se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOH
) +
426 se401_get_feature(gspca_dev
, HV7131_REG_LOREFNOL
);
428 /* Not an exact science, but it seems to work pretty well... */
429 oldreset
= sd
->resetlevel
;
431 while (alrc
>= 10 && sd
->resetlevel
< 63) {
435 } else if (ahrc
> 20) {
436 while (ahrc
>= 20 && sd
->resetlevel
> 0) {
441 /* Detect ping-pong-ing and halve adjustment to avoid overshoot */
442 if (sd
->resetlevel
> oldreset
)
446 if (sd
->resetlevel_adjust_dir
&&
447 sd
->resetlevel_adjust_dir
!= adjust_dir
)
448 sd
->resetlevel
= oldreset
+ (sd
->resetlevel
- oldreset
) / 2;
450 if (sd
->resetlevel
!= oldreset
) {
451 sd
->resetlevel_adjust_dir
= adjust_dir
;
452 se401_set_feature(gspca_dev
, HV7131_REG_ARLV
, sd
->resetlevel
);
455 sd
->resetlevel_frame_count
= 0;
458 static void sd_complete_frame(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
460 struct sd
*sd
= (struct sd
*)gspca_dev
;
462 switch (sd
->expo_change_state
) {
464 /* The exposure was changed while this frame
465 was being send, so this frame is ok */
466 sd
->expo_change_state
= EXPO_DROP_FRAME
;
468 case EXPO_DROP_FRAME
:
469 /* The exposure was changed while this frame
470 was being captured, drop it! */
471 gspca_dev
->last_packet_type
= DISCARD_PACKET
;
472 sd
->expo_change_state
= EXPO_NO_CHANGE
;
477 gspca_frame_add(gspca_dev
, LAST_PACKET
, data
, len
);
480 static void sd_pkt_scan_janggu(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
482 struct sd
*sd
= (struct sd
*)gspca_dev
;
483 int imagesize
= gspca_dev
->pixfmt
.width
* gspca_dev
->pixfmt
.height
;
484 int i
, plen
, bits
, pixels
, info
, count
;
486 if (sd
->restart_stream
)
489 /* Sometimes a 1024 bytes garbage bulk packet is send between frames */
490 if (gspca_dev
->last_packet_type
== LAST_PACKET
&& len
== 1024) {
491 gspca_dev
->last_packet_type
= DISCARD_PACKET
;
497 /* Read header if not already be present from prev bulk pkt */
498 if (sd
->packet_read
< 4) {
499 count
= 4 - sd
->packet_read
;
502 memcpy(&sd
->packet
[sd
->packet_read
], &data
[i
], count
);
503 sd
->packet_read
+= count
;
505 if (sd
->packet_read
< 4)
508 bits
= sd
->packet
[3] + (sd
->packet
[2] << 8);
509 pixels
= sd
->packet
[1] + ((sd
->packet
[0] & 0x3f) << 8);
510 info
= (sd
->packet
[0] & 0xc0) >> 6;
511 plen
= ((bits
+ 47) >> 4) << 1;
514 pr_err("invalid packet len %d restarting stream\n",
519 pr_err("unknown frame info value restarting stream\n");
523 /* Read (remainder of) packet contents */
524 count
= plen
- sd
->packet_read
;
527 memcpy(&sd
->packet
[sd
->packet_read
], &data
[i
], count
);
528 sd
->packet_read
+= count
;
530 if (sd
->packet_read
< plen
)
533 sd
->pixels_read
+= pixels
;
537 case 0: /* Frame data */
538 gspca_frame_add(gspca_dev
, INTER_PACKET
, sd
->packet
,
542 if (sd
->pixels_read
!= imagesize
) {
543 pr_err("frame size %d expected %d\n",
544 sd
->pixels_read
, imagesize
);
547 sd_complete_frame(gspca_dev
, sd
->packet
, plen
);
548 return; /* Discard the rest of the bulk packet !! */
550 gspca_frame_add(gspca_dev
, FIRST_PACKET
, sd
->packet
,
552 sd
->pixels_read
= pixels
;
559 sd
->restart_stream
= 1;
560 /* Give userspace a 0 bytes frame, so our dq callback gets
561 called and it can restart the stream */
562 gspca_frame_add(gspca_dev
, FIRST_PACKET
, NULL
, 0);
563 gspca_frame_add(gspca_dev
, LAST_PACKET
, NULL
, 0);
566 static void sd_pkt_scan_bayer(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
568 struct cam
*cam
= &gspca_dev
->cam
;
569 int imagesize
= cam
->cam_mode
[gspca_dev
->curr_mode
].sizeimage
;
571 if (gspca_dev
->image_len
== 0) {
572 gspca_frame_add(gspca_dev
, FIRST_PACKET
, data
, len
);
576 if (gspca_dev
->image_len
+ len
>= imagesize
) {
577 sd_complete_frame(gspca_dev
, data
, len
);
581 gspca_frame_add(gspca_dev
, INTER_PACKET
, data
, len
);
584 static void sd_pkt_scan(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
586 int mult
= gspca_dev
->cam
.cam_mode
[gspca_dev
->curr_mode
].priv
;
591 if (mult
== 1) /* mult == 1 means raw bayer */
592 sd_pkt_scan_bayer(gspca_dev
, data
, len
);
594 sd_pkt_scan_janggu(gspca_dev
, data
, len
);
597 #if IS_ENABLED(CONFIG_INPUT)
598 static int sd_int_pkt_scan(struct gspca_dev
*gspca_dev
, u8
*data
, int len
)
600 struct sd
*sd
= (struct sd
*)gspca_dev
;
614 if (sd
->button_state
!= state
) {
615 input_report_key(gspca_dev
->input_dev
, KEY_CAMERA
, state
);
616 input_sync(gspca_dev
->input_dev
);
617 sd
->button_state
= state
;
624 static int sd_s_ctrl(struct v4l2_ctrl
*ctrl
)
626 struct gspca_dev
*gspca_dev
=
627 container_of(ctrl
->handler
, struct gspca_dev
, ctrl_handler
);
628 struct sd
*sd
= (struct sd
*)gspca_dev
;
630 gspca_dev
->usb_err
= 0;
632 if (!gspca_dev
->streaming
)
636 case V4L2_CID_BRIGHTNESS
:
637 setbrightness(gspca_dev
, ctrl
->val
);
640 setgain(gspca_dev
, ctrl
->val
);
642 case V4L2_CID_EXPOSURE
:
643 setexposure(gspca_dev
, ctrl
->val
, sd
->freq
->val
);
646 return gspca_dev
->usb_err
;
649 static const struct v4l2_ctrl_ops sd_ctrl_ops
= {
653 static int sd_init_controls(struct gspca_dev
*gspca_dev
)
655 struct sd
*sd
= (struct sd
*)gspca_dev
;
656 struct v4l2_ctrl_handler
*hdl
= &gspca_dev
->ctrl_handler
;
658 gspca_dev
->vdev
.ctrl_handler
= hdl
;
659 v4l2_ctrl_handler_init(hdl
, 4);
660 if (sd
->has_brightness
)
661 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
662 V4L2_CID_BRIGHTNESS
, 0, 255, 1, 15);
663 /* max is really 63 but > 50 is not pretty */
664 v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
665 V4L2_CID_GAIN
, 0, 50, 1, 25);
666 sd
->exposure
= v4l2_ctrl_new_std(hdl
, &sd_ctrl_ops
,
667 V4L2_CID_EXPOSURE
, 0, 32767, 1, 15000);
668 sd
->freq
= v4l2_ctrl_new_std_menu(hdl
, &sd_ctrl_ops
,
669 V4L2_CID_POWER_LINE_FREQUENCY
,
670 V4L2_CID_POWER_LINE_FREQUENCY_60HZ
, 0, 0);
673 pr_err("Could not initialize controls\n");
676 v4l2_ctrl_cluster(2, &sd
->exposure
);
680 /* sub-driver description */
681 static const struct sd_desc sd_desc
= {
685 .init_controls
= sd_init_controls
,
686 .isoc_init
= sd_isoc_init
,
689 .dq_callback
= sd_dq_callback
,
690 .pkt_scan
= sd_pkt_scan
,
691 #if IS_ENABLED(CONFIG_INPUT)
692 .int_pkt_scan
= sd_int_pkt_scan
,
696 /* -- module initialisation -- */
697 static const struct usb_device_id device_table
[] = {
698 {USB_DEVICE(0x03e8, 0x0004)}, /* Endpoints/Aox SE401 */
699 {USB_DEVICE(0x0471, 0x030b)}, /* Philips PCVC665K */
700 {USB_DEVICE(0x047d, 0x5001)}, /* Kensington 67014 */
701 {USB_DEVICE(0x047d, 0x5002)}, /* Kensington 6701(5/7) */
702 {USB_DEVICE(0x047d, 0x5003)}, /* Kensington 67016 */
705 MODULE_DEVICE_TABLE(usb
, device_table
);
707 /* -- device connect -- */
708 static int sd_probe(struct usb_interface
*intf
,
709 const struct usb_device_id
*id
)
711 return gspca_dev_probe(intf
, id
, &sd_desc
, sizeof(struct sd
),
715 static int sd_pre_reset(struct usb_interface
*intf
)
720 static int sd_post_reset(struct usb_interface
*intf
)
725 static struct usb_driver sd_driver
= {
727 .id_table
= device_table
,
729 .disconnect
= gspca_disconnect
,
731 .suspend
= gspca_suspend
,
732 .resume
= gspca_resume
,
733 .reset_resume
= gspca_resume
,
735 .pre_reset
= sd_pre_reset
,
736 .post_reset
= sd_post_reset
,
739 module_usb_driver(sd_driver
);