2 * SPCA505 chip based cameras initialization data
4 * V4L2 by Jean-Francis Moine <http://moinejf.free.fr>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #define MODULE_NAME "spca505"
26 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
27 MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver");
28 MODULE_LICENSE("GPL");
30 /* specific webcam descriptor */
32 struct gspca_dev gspca_dev; /* !! must be the first item */
34 unsigned char brightness;
37 #define IntelPCCameraPro 0
41 /* V4L2 controls supported by the driver */
42 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val);
43 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val);
45 static struct ctrl sd_ctrls[] = {
46 #define SD_BRIGHTNESS 0
49 .id = V4L2_CID_BRIGHTNESS,
50 .type = V4L2_CTRL_TYPE_INTEGER,
57 .set = sd_setbrightness,
58 .get = sd_getbrightness,
62 static struct v4l2_pix_format vga_mode[] = {
63 {160, 120, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE,
65 .sizeimage = 160 * 120 * 3 / 2,
66 .colorspace = V4L2_COLORSPACE_SRGB,
68 {176, 144, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE,
70 .sizeimage = 176 * 144 * 3 / 2,
71 .colorspace = V4L2_COLORSPACE_SRGB,
73 {320, 240, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE,
75 .sizeimage = 320 * 240 * 3 / 2,
76 .colorspace = V4L2_COLORSPACE_SRGB,
78 {352, 288, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE,
80 .sizeimage = 352 * 288 * 3 / 2,
81 .colorspace = V4L2_COLORSPACE_SRGB,
83 {640, 480, V4L2_PIX_FMT_SPCA505, V4L2_FIELD_NONE,
85 .sizeimage = 640 * 480 * 3 / 2,
86 .colorspace = V4L2_COLORSPACE_SRGB,
90 #define SPCA50X_OFFSET_DATA 10
92 #define SPCA50X_REG_USB 0x02 /* spca505 501 */
94 #define SPCA50X_USB_CTRL 0x00 /* spca505 */
95 #define SPCA50X_CUSB_ENABLE 0x01 /* spca505 */
96 #define SPCA50X_REG_GLOBAL 0x03 /* spca505 */
97 #define SPCA50X_GMISC0_IDSEL 0x01 /* Global control device ID select spca505 */
98 #define SPCA50X_GLOBAL_MISC0 0x00 /* Global control miscellaneous 0 spca505 */
100 #define SPCA50X_GLOBAL_MISC1 0x01 /* 505 */
101 #define SPCA50X_GLOBAL_MISC3 0x03 /* 505 */
102 #define SPCA50X_GMISC3_SAA7113RST 0x20 /* Not sure about this one spca505 */
105 * Data to initialize a SPCA505. Common to the CCD and external modes
107 static const __u16 spca505_init_data[][3] = {
108 /* line bmRequest,value,index */
110 {SPCA50X_REG_GLOBAL, SPCA50X_GMISC3_SAA7113RST, SPCA50X_GLOBAL_MISC3},
112 /* 1822 */ {SPCA50X_REG_GLOBAL, 0x00, SPCA50X_GLOBAL_MISC3},
113 /* 1825 */ {SPCA50X_REG_GLOBAL, 0x00, SPCA50X_GLOBAL_MISC1},
114 /* Block USB reset */
115 /* 1828 */ {SPCA50X_REG_GLOBAL, SPCA50X_GMISC0_IDSEL,
116 SPCA50X_GLOBAL_MISC0},
118 /* 1831 */ {0x5, 0x01, 0x10},
119 /* Maybe power down some stuff */
120 /* 1834 */ {0x5, 0x0f, 0x11},
122 /* Setup internal CCD ? */
123 /* 1837 */ {0x6, 0x10, 0x08},
124 /* 1840 */ {0x6, 0x00, 0x09},
125 /* 1843 */ {0x6, 0x00, 0x0a},
126 /* 1846 */ {0x6, 0x00, 0x0b},
127 /* 1849 */ {0x6, 0x10, 0x0c},
128 /* 1852 */ {0x6, 0x00, 0x0d},
129 /* 1855 */ {0x6, 0x00, 0x0e},
130 /* 1858 */ {0x6, 0x00, 0x0f},
131 /* 1861 */ {0x6, 0x10, 0x10},
132 /* 1864 */ {0x6, 0x02, 0x11},
133 /* 1867 */ {0x6, 0x00, 0x12},
134 /* 1870 */ {0x6, 0x04, 0x13},
135 /* 1873 */ {0x6, 0x02, 0x14},
136 /* 1876 */ {0x6, 0x8a, 0x51},
137 /* 1879 */ {0x6, 0x40, 0x52},
138 /* 1882 */ {0x6, 0xb6, 0x53},
139 /* 1885 */ {0x6, 0x3d, 0x54},
144 * Data to initialize the camera using the internal CCD
146 static const __u16 spca505_open_data_ccd[][3] = {
147 /* line bmRequest,value,index */
148 /* Internal CCD data set */
149 /* 1891 */ {0x3, 0x04, 0x01},
150 /* This could be a reset */
151 /* 1894 */ {0x3, 0x00, 0x01},
153 /* Setup compression and image registers. 0x6 and 0x7 seem to be
154 related to H&V hold, and are resolution mode specific */
155 /* 1897 */ {0x4, 0x10, 0x01},
156 /* DIFF(0x50), was (0x10) */
157 /* 1900 */ {0x4, 0x00, 0x04},
158 /* 1903 */ {0x4, 0x00, 0x05},
159 /* 1906 */ {0x4, 0x20, 0x06},
160 /* 1909 */ {0x4, 0x20, 0x07},
162 /* 1912 */ {0x8, 0x0a, 0x00},
163 /* DIFF (0x4a), was (0xa) */
165 /* 1915 */ {0x5, 0x00, 0x10},
166 /* 1918 */ {0x5, 0x00, 0x11},
167 /* 1921 */ {0x5, 0x00, 0x00},
168 /* DIFF not written */
169 /* 1924 */ {0x5, 0x00, 0x01},
170 /* DIFF not written */
171 /* 1927 */ {0x5, 0x00, 0x02},
172 /* DIFF not written */
173 /* 1930 */ {0x5, 0x00, 0x03},
174 /* DIFF not written */
175 /* 1933 */ {0x5, 0x00, 0x04},
176 /* DIFF not written */
177 /* 1936 */ {0x5, 0x80, 0x05},
178 /* DIFF not written */
179 /* 1939 */ {0x5, 0xe0, 0x06},
180 /* DIFF not written */
181 /* 1942 */ {0x5, 0x20, 0x07},
182 /* DIFF not written */
183 /* 1945 */ {0x5, 0xa0, 0x08},
184 /* DIFF not written */
185 /* 1948 */ {0x5, 0x0, 0x12},
186 /* DIFF not written */
187 /* 1951 */ {0x5, 0x02, 0x0f},
188 /* DIFF not written */
189 /* 1954 */ {0x5, 0x10, 0x46},
190 /* DIFF not written */
191 /* 1957 */ {0x5, 0x8, 0x4a},
192 /* DIFF not written */
194 /* 1960 */ {0x3, 0x08, 0x03},
195 /* DIFF (0x3,0x28,0x3) */
196 /* 1963 */ {0x3, 0x08, 0x01},
197 /* 1966 */ {0x3, 0x0c, 0x03},
198 /* DIFF not written */
199 /* 1969 */ {0x3, 0x21, 0x00},
202 /* Extra block copied from init to hopefully ensure CCD is in a sane state */
203 /* 1837 */ {0x6, 0x10, 0x08},
204 /* 1840 */ {0x6, 0x00, 0x09},
205 /* 1843 */ {0x6, 0x00, 0x0a},
206 /* 1846 */ {0x6, 0x00, 0x0b},
207 /* 1849 */ {0x6, 0x10, 0x0c},
208 /* 1852 */ {0x6, 0x00, 0x0d},
209 /* 1855 */ {0x6, 0x00, 0x0e},
210 /* 1858 */ {0x6, 0x00, 0x0f},
211 /* 1861 */ {0x6, 0x10, 0x10},
212 /* 1864 */ {0x6, 0x02, 0x11},
213 /* 1867 */ {0x6, 0x00, 0x12},
214 /* 1870 */ {0x6, 0x04, 0x13},
215 /* 1873 */ {0x6, 0x02, 0x14},
216 /* 1876 */ {0x6, 0x8a, 0x51},
217 /* 1879 */ {0x6, 0x40, 0x52},
218 /* 1882 */ {0x6, 0xb6, 0x53},
219 /* 1885 */ {0x6, 0x3d, 0x54},
220 /* End of extra block */
222 /* 1972 */ {0x6, 0x3f, 0x1},
224 /* 1975 */ {0x6, 0x10, 0x02},
225 /* 1978 */ {0x6, 0x64, 0x07},
226 /* 1981 */ {0x6, 0x10, 0x08},
227 /* 1984 */ {0x6, 0x00, 0x09},
228 /* 1987 */ {0x6, 0x00, 0x0a},
229 /* 1990 */ {0x6, 0x00, 0x0b},
230 /* 1993 */ {0x6, 0x10, 0x0c},
231 /* 1996 */ {0x6, 0x00, 0x0d},
232 /* 1999 */ {0x6, 0x00, 0x0e},
233 /* 2002 */ {0x6, 0x00, 0x0f},
234 /* 2005 */ {0x6, 0x10, 0x10},
235 /* 2008 */ {0x6, 0x02, 0x11},
236 /* 2011 */ {0x6, 0x00, 0x12},
237 /* 2014 */ {0x6, 0x04, 0x13},
238 /* 2017 */ {0x6, 0x02, 0x14},
239 /* 2020 */ {0x6, 0x8a, 0x51},
240 /* 2023 */ {0x6, 0x40, 0x52},
241 /* 2026 */ {0x6, 0xb6, 0x53},
242 /* 2029 */ {0x6, 0x3d, 0x54},
243 /* 2032 */ {0x6, 0x60, 0x57},
244 /* 2035 */ {0x6, 0x20, 0x58},
245 /* 2038 */ {0x6, 0x15, 0x59},
246 /* 2041 */ {0x6, 0x05, 0x5a},
248 /* 2044 */ {0x5, 0x01, 0xc0},
249 /* 2047 */ {0x5, 0x10, 0xcb},
250 /* 2050 */ {0x5, 0x80, 0xc1},
252 /* 2053 */ {0x5, 0x0, 0xc2},
254 /* 2056 */ {0x5, 0x00, 0xca},
255 /* 2059 */ {0x5, 0x80, 0xc1},
257 /* 2062 */ {0x5, 0x04, 0xc2},
258 /* 2065 */ {0x5, 0x00, 0xca},
259 /* 2068 */ {0x5, 0x0, 0xc1},
261 /* 2071 */ {0x5, 0x00, 0xc2},
262 /* 2074 */ {0x5, 0x00, 0xca},
263 /* 2077 */ {0x5, 0x40, 0xc1},
265 /* 2080 */ {0x5, 0x17, 0xc2},
266 /* 2083 */ {0x5, 0x00, 0xca},
267 /* 2086 */ {0x5, 0x80, 0xc1},
269 /* 2089 */ {0x5, 0x06, 0xc2},
270 /* 2092 */ {0x5, 0x00, 0xca},
271 /* 2095 */ {0x5, 0x80, 0xc1},
273 /* 2098 */ {0x5, 0x04, 0xc2},
274 /* 2101 */ {0x5, 0x00, 0xca},
276 /* 2104 */ {0x3, 0x4c, 0x3},
277 /* 2107 */ {0x3, 0x18, 0x1},
279 /* 2110 */ {0x6, 0x70, 0x51},
280 /* 2113 */ {0x6, 0xbe, 0x53},
281 /* 2116 */ {0x6, 0x71, 0x57},
282 /* 2119 */ {0x6, 0x20, 0x58},
283 /* 2122 */ {0x6, 0x05, 0x59},
284 /* 2125 */ {0x6, 0x15, 0x5a},
286 /* 2128 */ {0x4, 0x00, 0x08},
287 /* Compress = OFF (0x1 to turn on) */
288 /* 2131 */ {0x4, 0x12, 0x09},
289 /* 2134 */ {0x4, 0x21, 0x0a},
290 /* 2137 */ {0x4, 0x10, 0x0b},
291 /* 2140 */ {0x4, 0x21, 0x0c},
292 /* 2143 */ {0x4, 0x05, 0x00},
293 /* was 5 (Image Type ? ) */
294 /* 2146 */ {0x4, 0x00, 0x01},
296 /* 2149 */ {0x6, 0x3f, 0x01},
298 /* 2152 */ {0x4, 0x00, 0x04},
299 /* 2155 */ {0x4, 0x00, 0x05},
300 /* 2158 */ {0x4, 0x40, 0x06},
301 /* 2161 */ {0x4, 0x40, 0x07},
303 /* 2164 */ {0x6, 0x1c, 0x17},
304 /* 2167 */ {0x6, 0xe2, 0x19},
305 /* 2170 */ {0x6, 0x1c, 0x1b},
306 /* 2173 */ {0x6, 0xe2, 0x1d},
307 /* 2176 */ {0x6, 0xaa, 0x1f},
308 /* 2179 */ {0x6, 0x70, 0x20},
310 /* 2182 */ {0x5, 0x01, 0x10},
311 /* 2185 */ {0x5, 0x00, 0x11},
312 /* 2188 */ {0x5, 0x01, 0x00},
313 /* 2191 */ {0x5, 0x05, 0x01},
314 /* 2194 */ {0x5, 0x00, 0xc1},
316 /* 2197 */ {0x5, 0x00, 0xc2},
317 /* 2200 */ {0x5, 0x00, 0xca},
319 /* 2203 */ {0x6, 0x70, 0x51},
320 /* 2206 */ {0x6, 0xbe, 0x53},
325 Made by Tomasz Zablocki (skalamandra@poczta.onet.pl)
326 * SPCA505b chip based cameras initialization data
330 #define initial_brightness 0x7f /* 0x0(white)-0xff(black) */
331 /* #define initial_brightness 0x0 //0x0(white)-0xff(black) */
333 * Data to initialize a SPCA505. Common to the CCD and external modes
335 static const __u16 spca505b_init_data[][3] = {
337 {0x02, 0x00, 0x00}, /* init */
397 * Data to initialize the camera using the internal CCD
399 static const __u16 spca505b_open_data_ccd[][3] = {
401 /* {0x02,0x00,0x00}, */
402 {0x03, 0x04, 0x01}, /* rst */
428 {0x05, initial_brightness >> 6, 0x00},
429 {0x05, initial_brightness << 2, 0x01},
439 {0x05, 128, 0x14}, /* max exposure off (0=on) */
458 {0x06, 0x11, 0x10}, /* contrast */
523 {0x06, 0x4d, 0x51}, /* maybe saturation (4d) */
524 {0x06, 0x84, 0x53}, /* making green (84) */
525 {0x06, 0x00, 0x57}, /* sharpness (1) */
530 {0x06, 0x18, 0x0c}, /* maybe hue (18) */
534 {0x06, 0x18, 0x10}, /* maybe contrast (18) */
538 {0x04, 0x00, 0x08}, /* compression */
543 {0x04, 0x1d, 0x00}, /* imagetype (1d) */
544 {0x04, 0x41, 0x01}, /* hardware snapcontrol */
562 {0x05, initial_brightness >> 6, 0x00},
563 {0x05, initial_brightness << 2, 0x01},
571 static int reg_write(struct usb_device *dev,
572 __u16 reg, __u16 index, __u16 value)
576 ret = usb_control_msg(dev,
577 usb_sndctrlpipe(dev, 0),
579 USB_TYPE_VENDOR | USB_RECIP_DEVICE,
580 value, index, NULL, 0, 500);
581 PDEBUG(D_PACK, "reg write: 0x%02x,0x%02x:0x%02x, 0x%x",
582 reg, index, value, ret);
584 PDEBUG(D_ERR, "reg write: error %d", ret);
588 /* returns: negative is error, pos or zero is data */
589 static int reg_read(struct gspca_dev *gspca_dev,
590 __u16 reg, /* bRequest */
591 __u16 index, /* wIndex */
592 __u16 length) /* wLength (1 or 2 only) */
596 gspca_dev->usb_buf[1] = 0;
597 ret = usb_control_msg(gspca_dev->dev,
598 usb_rcvctrlpipe(gspca_dev->dev, 0),
600 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
601 (__u16) 0, /* value */
603 gspca_dev->usb_buf, length,
606 PDEBUG(D_ERR, "reg_read err %d", ret);
609 return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
612 static int write_vector(struct gspca_dev *gspca_dev,
613 const __u16 data[][3])
615 struct usb_device *dev = gspca_dev->dev;
618 while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) {
619 ret = reg_write(dev, data[i][0], data[i][2], data[i][1]);
622 "Register write failed for 0x%x,0x%x,0x%x",
623 data[i][0], data[i][1], data[i][2]);
631 /* this function is called at probe time */
632 static int sd_config(struct gspca_dev *gspca_dev,
633 const struct usb_device_id *id)
635 struct sd *sd = (struct sd *) gspca_dev;
638 cam = &gspca_dev->cam;
640 cam->cam_mode = vga_mode;
641 sd->subtype = id->driver_info;
642 if (sd->subtype != IntelPCCameraPro)
643 cam->nmodes = sizeof vga_mode / sizeof vga_mode[0];
644 else /* no 640x480 for IntelPCCameraPro */
645 cam->nmodes = sizeof vga_mode / sizeof vga_mode[0] - 1;
646 sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value;
648 if (sd->subtype == Nxultra) {
649 if (write_vector(gspca_dev, spca505b_init_data))
652 if (write_vector(gspca_dev, spca505_init_data))
658 /* this function is called at probe and resume time */
659 static int sd_init(struct gspca_dev *gspca_dev)
661 struct sd *sd = (struct sd *) gspca_dev;
664 PDEBUG(D_STREAM, "Initializing SPCA505");
665 if (sd->subtype == Nxultra)
666 write_vector(gspca_dev, spca505b_open_data_ccd);
668 write_vector(gspca_dev, spca505_open_data_ccd);
669 ret = reg_read(gspca_dev, 6, 0x16, 2);
672 PDEBUG(D_ERR|D_STREAM,
673 "register read failed for after vector read err = %d",
678 "After vector read returns : 0x%x should be 0x0101",
681 ret = reg_write(gspca_dev->dev, 6, 0x16, 0x0a);
683 PDEBUG(D_ERR, "register write failed for (6,0xa,0x16) err=%d",
687 reg_write(gspca_dev->dev, 5, 0xc2, 18);
691 static int sd_start(struct gspca_dev *gspca_dev)
693 struct usb_device *dev = gspca_dev->dev;
696 /* necessary because without it we can see stream
697 * only once after loading module */
698 /* stopping usb registers Tomasz change */
699 reg_write(dev, 0x02, 0x0, 0x0);
700 switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
702 reg_write(dev, 0x04, 0x00, 0x00);
703 reg_write(dev, 0x04, 0x06, 0x10);
704 reg_write(dev, 0x04, 0x07, 0x10);
707 reg_write(dev, 0x04, 0x00, 0x01);
708 reg_write(dev, 0x04, 0x06, 0x1a);
709 reg_write(dev, 0x04, 0x07, 0x1a);
712 reg_write(dev, 0x04, 0x00, 0x02);
713 reg_write(dev, 0x04, 0x06, 0x1c);
714 reg_write(dev, 0x04, 0x07, 0x1d);
717 reg_write(dev, 0x04, 0x00, 0x04);
718 reg_write(dev, 0x04, 0x06, 0x34);
719 reg_write(dev, 0x04, 0x07, 0x34);
723 reg_write(dev, 0x04, 0x00, 0x05);
724 reg_write(dev, 0x04, 0x06, 0x40);
725 reg_write(dev, 0x04, 0x07, 0x40);
728 /* Enable ISO packet machine - should we do this here or in ISOC init ? */
729 ret = reg_write(dev, SPCA50X_REG_USB,
731 SPCA50X_CUSB_ENABLE);
733 /* reg_write(dev, 0x5, 0x0, 0x0); */
734 /* reg_write(dev, 0x5, 0x0, 0x1); */
735 /* reg_write(dev, 0x5, 0x11, 0x2); */
739 static void sd_stopN(struct gspca_dev *gspca_dev)
741 /* Disable ISO packet machine */
742 reg_write(gspca_dev->dev, 0x02, 0x00, 0x00);
745 static void sd_stop0(struct gspca_dev *gspca_dev)
747 /* This maybe reset or power control */
748 reg_write(gspca_dev->dev, 0x03, 0x03, 0x20);
749 reg_write(gspca_dev->dev, 0x03, 0x01, 0x0);
750 reg_write(gspca_dev->dev, 0x03, 0x00, 0x1);
751 reg_write(gspca_dev->dev, 0x05, 0x10, 0x1);
752 reg_write(gspca_dev->dev, 0x05, 0x11, 0xf);
755 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
756 struct gspca_frame *frame, /* target */
757 __u8 *data, /* isoc packet */
758 int len) /* iso packet length */
761 case 0: /* start of frame */
762 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
764 data += SPCA50X_OFFSET_DATA;
765 len -= SPCA50X_OFFSET_DATA;
766 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
769 case 0xff: /* drop */
770 /* gspca_dev->last_packet_type = DISCARD_PACKET; */
775 gspca_frame_add(gspca_dev, INTER_PACKET, frame,
781 static void setbrightness(struct gspca_dev *gspca_dev)
783 struct sd *sd = (struct sd *) gspca_dev;
785 __u8 brightness = sd->brightness;
786 reg_write(gspca_dev->dev, 5, 0x00, (255 - brightness) >> 6);
787 reg_write(gspca_dev->dev, 5, 0x01, (255 - brightness) << 2);
790 static void getbrightness(struct gspca_dev *gspca_dev)
792 struct sd *sd = (struct sd *) gspca_dev;
795 - ((reg_read(gspca_dev, 5, 0x01, 1) >> 2)
796 + (reg_read(gspca_dev, 5, 0x0, 1) << 6));
799 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
801 struct sd *sd = (struct sd *) gspca_dev;
803 sd->brightness = val;
804 if (gspca_dev->streaming)
805 setbrightness(gspca_dev);
809 static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
811 struct sd *sd = (struct sd *) gspca_dev;
813 getbrightness(gspca_dev);
814 *val = sd->brightness;
818 /* sub-driver description */
819 static const struct sd_desc sd_desc = {
822 .nctrls = ARRAY_SIZE(sd_ctrls),
828 .pkt_scan = sd_pkt_scan,
831 /* -- module initialisation -- */
832 static const __devinitdata struct usb_device_id device_table[] = {
833 {USB_DEVICE(0x041e, 0x401d), .driver_info = Nxultra},
834 {USB_DEVICE(0x0733, 0x0430), .driver_info = IntelPCCameraPro},
835 /*fixme: may be UsbGrabberPV321 BRIDGE_SPCA506 SENSOR_SAA7113 */
838 MODULE_DEVICE_TABLE(usb, device_table);
840 /* -- device connect -- */
841 static int sd_probe(struct usb_interface *intf,
842 const struct usb_device_id *id)
844 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
848 static struct usb_driver sd_driver = {
850 .id_table = device_table,
852 .disconnect = gspca_disconnect,
854 .suspend = gspca_suspend,
855 .resume = gspca_resume,
859 /* -- module insert / remove -- */
860 static int __init sd_mod_init(void)
862 if (usb_register(&sd_driver) < 0)
864 PDEBUG(D_PROBE, "registered");
867 static void __exit sd_mod_exit(void)
869 usb_deregister(&sd_driver);
870 PDEBUG(D_PROBE, "deregistered");
873 module_init(sd_mod_init);
874 module_exit(sd_mod_exit);