22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24 #define MODULE_NAME "spca500"
41 #define AiptekPocketDV 1
43 #define CreativePCCam300 3
46 #define IntelPocketPCCamera 6
48 #define LogitechClickSmart310 8
49 #define LogitechClickSmart510 9
50 #define LogitechTraveler 10
51 #define MustekGsmart300 11
53 #define PalmPixDC85 13
54 #define ToptroIndus 14
62 .sizeimage = 320 * 240 * 3 / 8 + 590,
67 .sizeimage = 640 * 480 * 3 / 8 + 590,
75 .sizeimage = 176 * 144 * 3 / 8 + 590,
80 .sizeimage = 352 * 288 * 3 / 8 + 590,
86 #define SPCA500_OFFSET_PADDINGLB 2
87 #define SPCA500_OFFSET_PADDINGHB 3
88 #define SPCA500_OFFSET_MODE 4
89 #define SPCA500_OFFSET_IMGWIDTH 5
90 #define SPCA500_OFFSET_IMGHEIGHT 6
91 #define SPCA500_OFFSET_IMGMODE 7
92 #define SPCA500_OFFSET_QTBLINDEX 8
93 #define SPCA500_OFFSET_FRAMSEQ 9
94 #define SPCA500_OFFSET_CDSPINFO 10
95 #define SPCA500_OFFSET_GPIO 11
96 #define SPCA500_OFFSET_AUGPIO 12
97 #define SPCA500_OFFSET_DATA 16
100 static const __u16 spca500_visual_defaults[][3] = {
101 {0x00, 0x0003, 0x816b},
106 {0x00, 0x0000, 0x8167},
107 {0x00, 0x0020, 0x8168},
108 {0x00, 0x0003, 0x816b},
113 {0x00, 0x0000, 0x816a},
114 {0x00, 0x0020, 0x8169},
115 {0x00, 0x0050, 0x8157},
116 {0x00, 0x0030, 0x8158},
117 {0x00, 0x0028, 0x8159},
118 {0x00, 0x000a, 0x815a},
119 {0x00, 0x0001, 0x8202},
120 {0x0c, 0x0004, 0x0000},
124 static const __u16 Clicksmart510_defaults[][3] = {
125 {0x00, 0x00, 0x8211},
126 {0x00, 0x01, 0x82c0},
127 {0x00, 0x10, 0x82cb},
128 {0x00, 0x0f, 0x800d},
129 {0x00, 0x82, 0x8225},
130 {0x00, 0x21, 0x8228},
131 {0x00, 0x00, 0x8203},
132 {0x00, 0x00, 0x8204},
133 {0x00, 0x08, 0x8205},
134 {0x00, 0xf8, 0x8206},
135 {0x00, 0x28, 0x8207},
136 {0x00, 0xa0, 0x8208},
137 {0x00, 0x08, 0x824a},
138 {0x00, 0x08, 0x8214},
139 {0x00, 0x80, 0x82c1},
140 {0x00, 0x00, 0x82c2},
141 {0x00, 0x00, 0x82ca},
142 {0x00, 0x80, 0x82c1},
143 {0x00, 0x04, 0x82c2},
144 {0x00, 0x00, 0x82ca},
145 {0x00, 0xfc, 0x8100},
146 {0x00, 0xfc, 0x8105},
147 {0x00, 0x30, 0x8101},
148 {0x00, 0x00, 0x8102},
149 {0x00, 0x00, 0x8103},
150 {0x00, 0x66, 0x8107},
151 {0x00, 0x00, 0x816b},
152 {0x00, 0x00, 0x8155},
153 {0x00, 0x01, 0x8156},
154 {0x00, 0x60, 0x8157},
155 {0x00, 0x40, 0x8158},
156 {0x00, 0x0a, 0x8159},
157 {0x00, 0x06, 0x815a},
158 {0x00, 0x00, 0x813f},
159 {0x00, 0x00, 0x8200},
160 {0x00, 0x19, 0x8201},
161 {0x00, 0x00, 0x82c1},
162 {0x00, 0xa0, 0x82c2},
163 {0x00, 0x00, 0x82ca},
164 {0x00, 0x00, 0x8117},
165 {0x00, 0x00, 0x8118},
166 {0x00, 0x65, 0x8119},
167 {0x00, 0x00, 0x811a},
168 {0x00, 0x00, 0x811b},
169 {0x00, 0x55, 0x811c},
170 {0x00, 0x65, 0x811d},
171 {0x00, 0x55, 0x811e},
172 {0x00, 0x16, 0x811f},
173 {0x00, 0x19, 0x8120},
174 {0x00, 0x80, 0x8103},
175 {0x00, 0x83, 0x816b},
176 {0x00, 0x25, 0x8168},
177 {0x00, 0x01, 0x820f},
178 {0x00, 0xff, 0x8115},
179 {0x00, 0x48, 0x8116},
180 {0x00, 0x50, 0x8151},
181 {0x00, 0x40, 0x8152},
182 {0x00, 0x78, 0x8153},
183 {0x00, 0x40, 0x8154},
184 {0x00, 0x00, 0x8167},
185 {0x00, 0x20, 0x8168},
186 {0x00, 0x00, 0x816a},
187 {0x00, 0x03, 0x816b},
188 {0x00, 0x20, 0x8169},
189 {0x00, 0x60, 0x8157},
190 {0x00, 0x00, 0x8190},
191 {0x00, 0x00, 0x81a1},
192 {0x00, 0x00, 0x81b2},
193 {0x00, 0x27, 0x8191},
194 {0x00, 0x27, 0x81a2},
195 {0x00, 0x27, 0x81b3},
196 {0x00, 0x4b, 0x8192},
197 {0x00, 0x4b, 0x81a3},
198 {0x00, 0x4b, 0x81b4},
199 {0x00, 0x66, 0x8193},
200 {0x00, 0x66, 0x81a4},
201 {0x00, 0x66, 0x81b5},
202 {0x00, 0x79, 0x8194},
203 {0x00, 0x79, 0x81a5},
204 {0x00, 0x79, 0x81b6},
205 {0x00, 0x8a, 0x8195},
206 {0x00, 0x8a, 0x81a6},
207 {0x00, 0x8a, 0x81b7},
208 {0x00, 0x9b, 0x8196},
209 {0x00, 0x9b, 0x81a7},
210 {0x00, 0x9b, 0x81b8},
211 {0x00, 0xa6, 0x8197},
212 {0x00, 0xa6, 0x81a8},
213 {0x00, 0xa6, 0x81b9},
214 {0x00, 0xb2, 0x8198},
215 {0x00, 0xb2, 0x81a9},
216 {0x00, 0xb2, 0x81ba},
217 {0x00, 0xbe, 0x8199},
218 {0x00, 0xbe, 0x81aa},
219 {0x00, 0xbe, 0x81bb},
220 {0x00, 0xc8, 0x819a},
221 {0x00, 0xc8, 0x81ab},
222 {0x00, 0xc8, 0x81bc},
223 {0x00, 0xd2, 0x819b},
224 {0x00, 0xd2, 0x81ac},
225 {0x00, 0xd2, 0x81bd},
226 {0x00, 0xdb, 0x819c},
227 {0x00, 0xdb, 0x81ad},
228 {0x00, 0xdb, 0x81be},
229 {0x00, 0xe4, 0x819d},
230 {0x00, 0xe4, 0x81ae},
231 {0x00, 0xe4, 0x81bf},
232 {0x00, 0xed, 0x819e},
233 {0x00, 0xed, 0x81af},
234 {0x00, 0xed, 0x81c0},
235 {0x00, 0xf7, 0x819f},
236 {0x00, 0xf7, 0x81b0},
237 {0x00, 0xf7, 0x81c1},
238 {0x00, 0xff, 0x81a0},
239 {0x00, 0xff, 0x81b1},
240 {0x00, 0xff, 0x81c2},
241 {0x00, 0x03, 0x8156},
242 {0x00, 0x00, 0x8211},
243 {0x00, 0x20, 0x8168},
244 {0x00, 0x01, 0x8202},
245 {0x00, 0x30, 0x8101},
246 {0x00, 0x00, 0x8111},
247 {0x00, 0x00, 0x8112},
248 {0x00, 0x00, 0x8113},
249 {0x00, 0x00, 0x8114},
253 static const __u8 qtable_creative_pccam[2][64] = {
255 0x05, 0x03, 0x03, 0x05, 0x07, 0x0c, 0x0f, 0x12,
256 0x04, 0x04, 0x04, 0x06, 0x08, 0x11, 0x12, 0x11,
257 0x04, 0x04, 0x05, 0x07, 0x0c, 0x11, 0x15, 0x11,
258 0x04, 0x05, 0x07, 0x09, 0x0f, 0x1a, 0x18, 0x13,
259 0x05, 0x07, 0x0b, 0x11, 0x14, 0x21, 0x1f, 0x17,
260 0x07, 0x0b, 0x11, 0x13, 0x18, 0x1f, 0x22, 0x1c,
261 0x0f, 0x13, 0x17, 0x1a, 0x1f, 0x24, 0x24, 0x1e,
262 0x16, 0x1c, 0x1d, 0x1d, 0x22, 0x1e, 0x1f, 0x1e},
264 0x05, 0x05, 0x07, 0x0e, 0x1e, 0x1e, 0x1e, 0x1e,
265 0x05, 0x06, 0x08, 0x14, 0x1e, 0x1e, 0x1e, 0x1e,
266 0x07, 0x08, 0x11, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
267 0x0e, 0x14, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
268 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
269 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
270 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
271 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e}
274 static const __u8 qtable_kodak_ez200[2][64] = {
276 0x02, 0x01, 0x01, 0x02, 0x02, 0x04, 0x05, 0x06,
277 0x01, 0x01, 0x01, 0x02, 0x03, 0x06, 0x06, 0x06,
278 0x01, 0x01, 0x02, 0x02, 0x04, 0x06, 0x07, 0x06,
279 0x01, 0x02, 0x02, 0x03, 0x05, 0x09, 0x08, 0x06,
280 0x02, 0x02, 0x04, 0x06, 0x07, 0x0b, 0x0a, 0x08,
281 0x02, 0x04, 0x06, 0x06, 0x08, 0x0a, 0x0b, 0x09,
282 0x05, 0x06, 0x08, 0x09, 0x0a, 0x0c, 0x0c, 0x0a,
283 0x07, 0x09, 0x0a, 0x0a, 0x0b, 0x0a, 0x0a, 0x0a},
285 0x02, 0x02, 0x02, 0x05, 0x0a, 0x0a, 0x0a, 0x0a,
286 0x02, 0x02, 0x03, 0x07, 0x0a, 0x0a, 0x0a, 0x0a,
287 0x02, 0x03, 0x06, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a,
288 0x05, 0x07, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a,
289 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a,
290 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a,
291 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a,
292 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a}
295 static const __u8 qtable_pocketdv[2][64] = {
297 0x06, 0x04, 0x04, 0x06, 0x0a, 0x10, 0x14, 0x18,
298 0x05, 0x05, 0x06, 0x08, 0x0a, 0x17, 0x18, 0x16,
299 0x06, 0x05, 0x06, 0x0a, 0x10, 0x17, 0x1c, 0x16,
300 0x06, 0x07, 0x09, 0x0c, 0x14, 0x23, 0x20, 0x19,
301 0x07, 0x09, 0x0f, 0x16, 0x1b, 0x2c, 0x29, 0x1f,
302 0x0a, 0x0e, 0x16, 0x1a, 0x20, 0x2a, 0x2d, 0x25,
303 0x14, 0x1a, 0x1f, 0x23, 0x29, 0x30, 0x30, 0x28,
304 0x1d, 0x25, 0x26, 0x27, 0x2d, 0x28, 0x29, 0x28,
307 0x07, 0x07, 0x0a, 0x13, 0x28, 0x28, 0x28, 0x28,
308 0x07, 0x08, 0x0a, 0x1a, 0x28, 0x28, 0x28, 0x28,
309 0x0a, 0x0a, 0x16, 0x28, 0x28, 0x28, 0x28, 0x28,
310 0x13, 0x1a, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
311 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
312 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
313 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
314 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28}
323 usb_rcvctrlpipe(gspca_dev->
dev, 0),
327 index, gspca_dev->
usb_buf, length, 500);
330 static int reg_w(
struct gspca_dev *gspca_dev,
335 PDEBUG(D_USBO,
"reg write: [0x%02x] = 0x%02x", index, value);
337 usb_sndctrlpipe(gspca_dev->
dev, 0),
340 value, index,
NULL, 0, 500);
342 pr_err(
"reg write: error %d\n", ret);
347 static int reg_r_12(
struct gspca_dev *gspca_dev,
356 usb_rcvctrlpipe(gspca_dev->
dev, 0),
364 pr_err(
"reg_r_12 err %d\n", ret);
375 static int reg_r_wait(
struct gspca_dev *gspca_dev,
381 ret = reg_r_12(gspca_dev, reg, index, 1);
389 static int write_vector(
struct gspca_dev *gspca_dev,
394 while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) {
395 ret = reg_w(gspca_dev, data[i][0], data[i][2], data[i][1]);
403 static int spca50x_setup_qtable(
struct gspca_dev *gspca_dev,
407 const __u8 qtable[2][64])
412 for (i = 0; i < 64; i++) {
413 err = reg_w(gspca_dev, request, ybase + i, qtable[0][i]);
419 for (i = 0; i < 64; i++) {
420 err = reg_w(gspca_dev, request, cbase + i, qtable[1][i]);
427 static void spca500_ping310(
struct gspca_dev *gspca_dev)
429 reg_r(gspca_dev, 0x0d04, 2);
430 PDEBUG(D_STREAM,
"ClickSmart310 ping 0x0d04 0x%02x 0x%02x",
434 static void spca500_clksmart310_init(
struct gspca_dev *gspca_dev)
436 reg_r(gspca_dev, 0x0d05, 2);
437 PDEBUG(D_STREAM,
"ClickSmart310 init 0x0d05 0x%02x 0x%02x",
439 reg_w(gspca_dev, 0x00, 0x8167, 0x5a);
440 spca500_ping310(gspca_dev);
442 reg_w(gspca_dev, 0x00, 0x8168, 0x22);
443 reg_w(gspca_dev, 0x00, 0x816a, 0xc0);
444 reg_w(gspca_dev, 0x00, 0x816b, 0x0b);
445 reg_w(gspca_dev, 0x00, 0x8169, 0x25);
446 reg_w(gspca_dev, 0x00, 0x8157, 0x5b);
447 reg_w(gspca_dev, 0x00, 0x8158, 0x5b);
448 reg_w(gspca_dev, 0x00, 0x813f, 0x03);
449 reg_w(gspca_dev, 0x00, 0x8151, 0x4a);
450 reg_w(gspca_dev, 0x00, 0x8153, 0x78);
451 reg_w(gspca_dev, 0x00, 0x0d01, 0x04);
453 reg_w(gspca_dev, 0x00, 0x0d02, 0x01);
454 reg_w(gspca_dev, 0x00, 0x8169, 0x25);
455 reg_w(gspca_dev, 0x00, 0x0d01, 0x02);
458 static void spca500_setmode(
struct gspca_dev *gspca_dev,
464 reg_w(gspca_dev, 0, 0x8001, xmult);
467 reg_w(gspca_dev, 0, 0x8002, ymult);
471 reg_w(gspca_dev, 0, 0x8003, mode << 4);
474 static int spca500_full_reset(
struct gspca_dev *gspca_dev)
479 err = reg_w(gspca_dev, 0xe0, 0x0001, 0x0000);
484 err = reg_r_wait(gspca_dev, 0x06, 0x0000, 0x0000);
487 err = reg_w(gspca_dev, 0xe0, 0x0000, 0x0000);
490 err = reg_r_wait(gspca_dev, 0x06, 0, 0);
505 static int spca500_synch310(
struct gspca_dev *gspca_dev)
508 PDEBUG(
D_ERR,
"Set packet size: set interface error");
511 spca500_ping310(gspca_dev);
513 reg_r(gspca_dev, 0x0d00, 1);
516 PDEBUG(D_PACK,
"ClickSmart310 sync alt: %d", gspca_dev->
alt);
521 gspca_dev->
alt) < 0) {
522 PDEBUG(
D_ERR,
"Set packet size: set interface error");
530 static void spca500_reinit(
struct gspca_dev *gspca_dev)
537 reg_w(gspca_dev, 0x00, 0x0d01, 0x01);
538 reg_w(gspca_dev, 0x00, 0x0d03, 0x00);
539 reg_w(gspca_dev, 0x00, 0x0d02, 0x01);
542 reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
544 err = spca50x_setup_qtable(gspca_dev, 0x00, 0x8800, 0x8840,
547 PDEBUG(
D_ERR|D_STREAM,
"spca50x_setup_qtable failed on init");
550 reg_w(gspca_dev, 0x00, 0x8880, 2);
552 reg_w(gspca_dev, 0x00, 0x800a, 0x00);
554 reg_w(gspca_dev, 0x00, 0x820f, 0x01);
556 reg_w(gspca_dev, 0x00, 0x870a, 0x04);
558 reg_w(gspca_dev, 0, 0x8003, 0x00);
560 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
562 if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0) {
563 reg_r(gspca_dev, 0x816b, 1);
565 reg_w(gspca_dev, 0x00, 0x816b, Data);
570 static int sd_config(
struct gspca_dev *gspca_dev,
573 struct sd *
sd = (
struct sd *) gspca_dev;
576 cam = &gspca_dev->
cam;
589 static int sd_init(
struct gspca_dev *gspca_dev)
591 struct sd *sd = (
struct sd *) gspca_dev;
594 PDEBUG(D_STREAM,
"SPCA500 init");
596 spca500_clksmart310_init(gspca_dev);
599 PDEBUG(D_STREAM,
"SPCA500 init done");
603 static int sd_start(
struct gspca_dev *gspca_dev)
605 struct sd *sd = (
struct sd *) gspca_dev;
624 reg_r(gspca_dev, 0x8a04, 1);
625 PDEBUG(D_STREAM,
"Spca500 Sensor Address 0x%02x",
627 PDEBUG(D_STREAM,
"Spca500 curr_mode: %d Xmult: 0x%02x, Ymult: 0x%02x",
633 spca500_setmode(gspca_dev, xmult, ymult);
636 reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
637 reg_w(gspca_dev, 0x00, 0x8880, 3);
638 err = spca50x_setup_qtable(gspca_dev,
639 0x00, 0x8800, 0x8840,
640 qtable_creative_pccam);
644 reg_w(gspca_dev, 0x00, 0x870a, 0x04);
647 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
649 if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
652 reg_r(gspca_dev, 0x816b, 1);
654 reg_w(gspca_dev, 0x00, 0x816b, Data);
656 spca500_synch310(gspca_dev);
658 write_vector(gspca_dev, spca500_visual_defaults);
659 spca500_setmode(gspca_dev, xmult, ymult);
661 err = reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
664 reg_w(gspca_dev, 0x00, 0x8880, 3);
665 err = spca50x_setup_qtable(gspca_dev,
666 0x00, 0x8800, 0x8840,
667 qtable_creative_pccam);
672 reg_w(gspca_dev, 0x00, 0x870a, 0x04);
675 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
677 if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
680 reg_r(gspca_dev, 0x816b, 1);
682 reg_w(gspca_dev, 0x00, 0x816b, Data);
690 err = spca500_full_reset(gspca_dev);
695 err = reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
698 reg_w(gspca_dev, 0x00, 0x8880, 3);
699 err = spca50x_setup_qtable(gspca_dev,
700 0x00, 0x8800, 0x8840,
701 qtable_creative_pccam);
705 spca500_setmode(gspca_dev, xmult, ymult);
706 reg_w(gspca_dev, 0x20, 0x0001, 0x0004);
709 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
711 if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
714 reg_r(gspca_dev, 0x816b, 1);
716 reg_w(gspca_dev, 0x00, 0x816b, Data);
723 err = spca500_full_reset(gspca_dev);
727 reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
728 reg_w(gspca_dev, 0x00, 0x8880, 0);
729 err = spca50x_setup_qtable(gspca_dev,
730 0x00, 0x8800, 0x8840,
734 spca500_setmode(gspca_dev, xmult, ymult);
736 reg_w(gspca_dev, 0x20, 0x0001, 0x0004);
739 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
741 if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
744 reg_r(gspca_dev, 0x816b, 1);
746 reg_w(gspca_dev, 0x00, 0x816b, Data);
760 spca500_reinit(gspca_dev);
761 reg_w(gspca_dev, 0x00, 0x0d01, 0x01);
763 reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
765 err = spca50x_setup_qtable(gspca_dev,
766 0x00, 0x8800, 0x8840, qtable_pocketdv);
769 reg_w(gspca_dev, 0x00, 0x8880, 2);
772 reg_w(gspca_dev, 0x00, 0x800a, 0x00);
774 reg_w(gspca_dev, 0x00, 0x820f, 0x01);
776 reg_w(gspca_dev, 0x00, 0x870a, 0x04);
778 spca500_setmode(gspca_dev, xmult, ymult);
780 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
782 reg_r_wait(gspca_dev, 0, 0x8000, 0x44);
784 reg_r(gspca_dev, 0x816b, 1);
786 reg_w(gspca_dev, 0x00, 0x816b, Data);
790 reg_w(gspca_dev, 0x02, 0x00, 0x00);
792 reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
794 err = spca50x_setup_qtable(gspca_dev,
796 0x8840, qtable_creative_pccam);
799 reg_w(gspca_dev, 0x00, 0x8880, 3);
800 reg_w(gspca_dev, 0x00, 0x800a, 0x00);
802 reg_w(gspca_dev, 0x00, 0x870a, 0x04);
804 spca500_setmode(gspca_dev, xmult, ymult);
807 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
808 reg_r_wait(gspca_dev, 0, 0x8000, 0x44);
810 reg_r(gspca_dev, 0x816b, 1);
812 reg_w(gspca_dev, 0x00, 0x816b, Data);
813 write_vector(gspca_dev, Clicksmart510_defaults);
819 static void sd_stopN(
struct gspca_dev *gspca_dev)
821 reg_w(gspca_dev, 0, 0x8003, 0x00);
824 reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
825 reg_r(gspca_dev, 0x8000, 1);
826 PDEBUG(D_STREAM,
"stop SPCA500 done reg8000: 0x%2x",
830 static void sd_pkt_scan(
struct gspca_dev *gspca_dev,
834 struct sd *sd = (
struct sd *) gspca_dev;
836 static __u8 ffd9[] = {0xff, 0xd9};
839 if (data[0] == 0xff) {
840 if (data[1] != 0x01) {
861 if (data[i] == 0xff) {
874 static void setbrightness(
struct gspca_dev *gspca_dev,
s32 val)
876 reg_w(gspca_dev, 0x00, 0x8167,
880 static void setcontrast(
struct gspca_dev *gspca_dev,
s32 val)
882 reg_w(gspca_dev, 0x00, 0x8168, val);
885 static void setcolors(
struct gspca_dev *gspca_dev,
s32 val)
887 reg_w(gspca_dev, 0x00, 0x8169, val);
892 struct gspca_dev *gspca_dev =
902 setbrightness(gspca_dev, ctrl->
val);
905 setcontrast(gspca_dev, ctrl->
val);
908 setcolors(gspca_dev, ctrl->
val);
918 static int sd_init_controls(
struct gspca_dev *gspca_dev)
922 gspca_dev->
vdev.ctrl_handler = hdl;
932 pr_err(
"Could not initialize controls\n");
943 .init_controls = sd_init_controls,
946 .pkt_scan = sd_pkt_scan,
951 {USB_DEVICE(0x040a, 0x0300), .driver_info =
KodakEZ200},
956 {USB_DEVICE(0x04a5, 0x300c), .driver_info =
BenqDC1016},
957 {USB_DEVICE(0x04fc, 0x7333), .driver_info =
PalmPixDC85},
959 {USB_DEVICE(0x055f, 0xc220), .driver_info =
Gsmartmini},
960 {USB_DEVICE(0x06bd, 0x0404), .driver_info =
AgfaCl20},
961 {USB_DEVICE(0x06be, 0x0800), .driver_info =
Optimedia},
962 {USB_DEVICE(0x084d, 0x0003), .driver_info =
DLinkDSC350},
964 {USB_DEVICE(0x2899, 0x012c), .driver_info =
ToptroIndus},
978 static struct usb_driver sd_driver = {
980 .id_table = device_table,
984 .suspend = gspca_suspend,
985 .resume = gspca_resume,
986 .reset_resume = gspca_resume,