Lines Matching +full:0 +full:x00aa

37 #define Rev012A 0
64 .priv = 0},
87 .priv = 0},
112 #define SPCA561_INDEX_I2C_BASE 0x8800
113 #define SPCA561_SNAPBIT 0x20
114 #define SPCA561_SNAPCTRL 0x40
117 {0x0000, 0x8114}, /* Software GPIO output data */
118 {0x0001, 0x8114}, /* Software GPIO output data */
119 {0x0000, 0x8112}, /* Some kind of reset */
123 {0x0003, 0x8701}, /* PCLK clock delay adjustment */
124 {0x0001, 0x8703}, /* HSYNC from cmos inverted */
125 {0x0011, 0x8118}, /* Enable and conf sensor */
126 {0x0001, 0x8118}, /* Conf sensor */
127 {0x0092, 0x8804}, /* I know nothing about these */
128 {0x0010, 0x8802}, /* 0x88xx registers, so I won't */
132 {0x0001, 0x000d},
133 {0x0002, 0x0018},
134 {0x0004, 0x0165},
135 {0x0005, 0x0021},
136 {0x0007, 0x00aa},
137 {0x0020, 0x1504},
138 {0x0039, 0x0002},
139 {0x0035, 0x0010},
140 {0x0009, 0x1049},
141 {0x0028, 0x000b},
142 {0x003b, 0x000f},
143 {0x003c, 0x0000},
147 {0x0018, 0x8601}, /* Pixel/line selection for color separation */
148 {0x0000, 0x8602}, /* Optical black level for user setting */
149 {0x0060, 0x8604}, /* Optical black horizontal offset */
150 {0x0002, 0x8605}, /* Optical black vertical offset */
151 {0x0000, 0x8603}, /* Non-automatic optical black level */
152 {0x0002, 0x865b}, /* Horizontal offset for valid pixels */
153 {0x0000, 0x865f}, /* Vertical valid pixels window (x2) */
154 {0x00b0, 0x865d}, /* Horizontal valid pixels window (x2) */
155 {0x0090, 0x865e}, /* Vertical valid lines window (x2) */
156 {0x00e0, 0x8406}, /* Memory buffer threshold */
157 {0x0000, 0x8660}, /* Compensation memory stuff */
158 {0x0002, 0x8201}, /* Output address for r/w serial EEPROM */
159 {0x0008, 0x8200}, /* Clear valid bit for serial EEPROM */
160 {0x0001, 0x8200}, /* OprMode to be executed by hardware */
162 {0x0000, 0x8611}, /* R offset for white balance */
163 {0x00fd, 0x8612}, /* Gr offset for white balance */
164 {0x0003, 0x8613}, /* B offset for white balance */
165 {0x0000, 0x8614}, /* Gb offset for white balance */
167 {0x0035, 0x8651}, /* R gain for white balance */
168 {0x0040, 0x8652}, /* Gr gain for white balance */
169 {0x005f, 0x8653}, /* B gain for white balance */
170 {0x0040, 0x8654}, /* Gb gain for white balance */
171 {0x0002, 0x8502}, /* Maximum average bit rate stuff */
172 {0x0011, 0x8802},
174 {0x0087, 0x8700}, /* Set master clock (96Mhz????) */
175 {0x0081, 0x8702}, /* Master clock output enable */
177 {0x0000, 0x8500}, /* Set image type (352x288 no compression) */
178 /* Originally was 0x0010 (352x288 compression) */
180 {0x0002, 0x865b}, /* Horizontal offset for valid pixels */
181 {0x0003, 0x865c}, /* Vertical offset for valid lines */
185 {0x0003, 0x0121},
186 {0x0004, 0x0165},
187 {0x0005, 0x002f}, /* blanking control column */
188 {0x0006, 0x0000}, /* blanking mode row*/
189 {0x000a, 0x0002},
190 {0x0009, 0x1061}, /* setexposure times && pixel clock
191 * 0001 0 | 000 0110 0001 */
192 {0x0035, 0x0014},
199 {0x8320, 0x3304},
201 {0x8303, 0x0125}, /* image area */
202 {0x8304, 0x0169},
203 {0x8328, 0x000b},
204 {0x833c, 0x0001}, /*fixme: win:07*/
206 {0x832f, 0x1904}, /*fixme: was 0419*/
207 {0x8307, 0x00aa},
208 {0x8301, 0x0003},
209 {0x8302, 0x000e},
214 {0x8339, 0x0000},
215 {0x8307, 0x00aa},
220 {0x29, 0x8118}, /* Control register (various enable bits) */
221 {0x08, 0x8114}, /* GPIO: Led off */
222 {0x0e, 0x8112}, /* 0x0e stream off 0x3e stream on */
223 {0x00, 0x8102}, /* white balance - new */
224 {0x92, 0x8804},
225 {0x04, 0x8802}, /* windows uses 08 */
229 {0x21, 0x8118},
230 {0x10, 0x8500},
231 {0x07, 0x8601},
232 {0x07, 0x8602},
233 {0x04, 0x8501},
235 {0x07, 0x8201}, /* windows uses 02 */
236 {0x08, 0x8200},
237 {0x01, 0x8200},
239 {0x90, 0x8604},
240 {0x00, 0x8605},
241 {0xb0, 0x8603},
244 {0x07, 0x8601}, /* white balance - new */
245 {0x07, 0x8602}, /* white balance - new */
246 {0x00, 0x8610}, /* *red */
247 {0x00, 0x8611}, /* 3f *green */
248 {0x00, 0x8612}, /* green *blue */
249 {0x00, 0x8613}, /* blue *green */
250 {0x43, 0x8614}, /* green *red - white balance - was 0x35 */
251 {0x40, 0x8615}, /* 40 *green - white balance - was 0x35 */
252 {0x71, 0x8616}, /* 7a *blue - white balance - was 0x35 */
253 {0x40, 0x8617}, /* 40 *green - white balance - was 0x35 */
255 {0x0c, 0x8620}, /* 0c */
256 {0xc8, 0x8631}, /* c8 */
257 {0xc8, 0x8634}, /* c8 */
258 {0x23, 0x8635}, /* 23 */
259 {0x1f, 0x8636}, /* 1f */
260 {0xdd, 0x8637}, /* dd */
261 {0xe1, 0x8638}, /* e1 */
262 {0x1d, 0x8639}, /* 1d */
263 {0x21, 0x863a}, /* 21 */
264 {0xe3, 0x863b}, /* e3 */
265 {0xdf, 0x863c}, /* df */
266 {0xf0, 0x8505},
267 {0x32, 0x850a},
268 /* {0x99, 0x8700}, * - white balance - new (removed) */
271 {0x29, 0x8118},
280 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), in reg_w_val()
281 0, /* request */ in reg_w_val()
283 value, index, NULL, 0, 500); in reg_w_val()
284 gspca_dbg(gspca_dev, D_USBO, "reg write: 0x%02x:0x%02x\n", in reg_w_val()
286 if (ret < 0) in reg_w_val()
295 i = 0; in write_vector()
296 while (data[i][1] != 0) { in write_vector()
297 reg_w_val(gspca_dev, data[i][1], data[i][0]); in write_vector()
307 usb_rcvctrlpipe(gspca_dev->dev, 0), in reg_r()
308 0, /* request */ in reg_r()
310 0, /* value */ in reg_r()
319 usb_sndctrlpipe(gspca_dev->dev, 0), in reg_w_buf()
320 0, /* request */ in reg_w_buf()
322 0, /* value */ in reg_w_buf()
330 reg_w_val(gspca_dev, 0x8801, reg); in i2c_write()
331 reg_w_val(gspca_dev, 0x8805, value); in i2c_write()
332 reg_w_val(gspca_dev, 0x8800, value >> 8); in i2c_write()
334 reg_r(gspca_dev, 0x8803, 1); in i2c_write()
335 if (!gspca_dev->usb_buf[0]) in i2c_write()
346 reg_w_val(gspca_dev, 0x8804, 0x92); in i2c_read()
347 reg_w_val(gspca_dev, 0x8801, reg); in i2c_read()
348 reg_w_val(gspca_dev, 0x8802, mode | 0x01); in i2c_read()
350 reg_r(gspca_dev, 0x8803, 1); in i2c_read()
351 if (!gspca_dev->usb_buf[0]) { in i2c_read()
352 reg_r(gspca_dev, 0x8800, 1); in i2c_read()
353 value = gspca_dev->usb_buf[0]; in i2c_read()
354 reg_r(gspca_dev, 0x8805, 1); in i2c_read()
355 return ((int) value << 8) | gspca_dev->usb_buf[0]; in i2c_read()
365 while ((*sensormap)[0]) { in sensor_mapwrite()
366 gspca_dev->usb_buf[0] = (*sensormap)[1]; in sensor_mapwrite()
368 reg_w_buf(gspca_dev, (*sensormap)[0], 2); in sensor_mapwrite()
376 while ((*sensor)[0]) { in write_sensor_72a()
377 i2c_write(gspca_dev, (*sensor)[1], (*sensor)[0]); in write_sensor_72a()
404 reg_r(gspca_dev, 0x8104, 1); in sd_config()
405 data1 = gspca_dev->usb_buf[0]; in sd_config()
406 reg_r(gspca_dev, 0x8105, 1); in sd_config()
407 data2 = gspca_dev->usb_buf[0]; in sd_config()
409 reg_r(gspca_dev, 0x8106, 1); in sd_config()
410 data1 = gspca_dev->usb_buf[0]; in sd_config()
411 reg_r(gspca_dev, 0x8107, 1); in sd_config()
412 data2 = gspca_dev->usb_buf[0]; in sd_config()
431 return 0; in sd_config()
439 return 0; in sd_init_12a()
450 reg_w_val(gspca_dev, 0x8112, 0x30); in sd_init_72a()
451 return 0; in sd_init_72a()
460 reg = 0x8610; in setbrightness()
462 reg = 0x8611; in setbrightness()
464 reg_w_val(gspca_dev, reg + 0, val); /* R */ in setbrightness()
477 red = 0x20 + white * 3 / 8; in setwhite()
478 blue = 0x90 - white * 5 / 8; in setwhite()
480 reg = 0x8614; in setwhite()
482 reg = 0x8651; in setwhite()
483 red += contrast - 0x20; in setwhite()
484 blue += contrast - 0x20; in setwhite()
485 reg_w_val(gspca_dev, 0x8652, contrast + 0x20); /* Gr */ in setwhite()
486 reg_w_val(gspca_dev, 0x8654, contrast + 0x20); /* Gb */ in setwhite()
495 int i, expo = 0; in setexposure()
497 /* Register 0x8309 controls exposure for the spca561, in setexposure()
505 Sometimes this is not enough, the 1-2047 uses bits 0-10, bits 11-12 in setexposure()
513 static const int table[] = { 0, 450, 550, 625, EXPOSURE_MAX }; in setexposure()
515 for (i = 0; i < ARRAY_SIZE(table) - 1; i++) { in setexposure()
525 gspca_dev->usb_buf[0] = expo; in setexposure()
527 reg_w_buf(gspca_dev, 0x8309, 2); in setexposure()
533 /* gain reg low 6 bits 0-63 gain, bit 6 and 7, both double the in setgain()
537 gspca_dev->usb_buf[0] = val; in setgain()
539 gspca_dev->usb_buf[0] = (val / 2) | 0x40; in setgain()
541 gspca_dev->usb_buf[0] = (val / 4) | 0xc0; in setgain()
543 gspca_dev->usb_buf[1] = 0; in setgain()
544 reg_w_buf(gspca_dev, 0x8335, 2); in setgain()
561 {0x92, 0x30, 0x20, 0x00, 0x0c, 0x00, 0x00, 0x00}; in sd_start_12a()
566 reg_w_val(gspca_dev, 0x8500, 0x10 | mode); in sd_start_12a()
571 reg_w_val(gspca_dev, 0x8500, mode); in sd_start_12a()
574 gspca_dev->usb_buf[0] = 0xaa; in sd_start_12a()
575 gspca_dev->usb_buf[1] = 0x00; in sd_start_12a()
576 reg_w_buf(gspca_dev, 0x8307, 2); in sd_start_12a()
577 /* clock - lower 0x8X values lead to fps > 30 */ in sd_start_12a()
578 reg_w_val(gspca_dev, 0x8700, 0x8a); in sd_start_12a()
579 /* 0x8f 0x85 0x27 clock */ in sd_start_12a()
580 reg_w_val(gspca_dev, 0x8112, 0x1e | 0x20); in sd_start_12a()
581 reg_w_val(gspca_dev, 0x850b, 0x03); in sd_start_12a()
583 reg_w_buf(gspca_dev, 0x8391, 8); in sd_start_12a()
584 reg_w_buf(gspca_dev, 0x8390, 8); in sd_start_12a()
586 /* Led ON (bit 3 -> 0 */ in sd_start_12a()
587 reg_w_val(gspca_dev, 0x8114, 0x00); in sd_start_12a()
588 return 0; in sd_start_12a()
604 case 0: in sd_start_72a()
605 Clck = 0x27; /* ms-win 0x87 */ in sd_start_72a()
608 Clck = 0x25; in sd_start_72a()
611 Clck = 0x22; in sd_start_72a()
614 Clck = 0x21; in sd_start_72a()
617 reg_w_val(gspca_dev, 0x8700, Clck); /* 0x27 clock */ in sd_start_72a()
618 reg_w_val(gspca_dev, 0x8702, 0x81); in sd_start_72a()
619 reg_w_val(gspca_dev, 0x8500, mode); /* mode */ in sd_start_72a()
625 reg_w_val(gspca_dev, 0x8112, 0x10 | 0x20); in sd_start_72a()
626 return 0; in sd_start_72a()
634 reg_w_val(gspca_dev, 0x8112, 0x0e); in sd_stopN()
636 reg_w_val(gspca_dev, 0x8114, 0x08); in sd_stopN()
638 reg_w_val(gspca_dev, 0x8112, 0x20); in sd_stopN()
639 /* reg_w_val(gspca_dev, 0x8102, 0x00); ?? */ in sd_stopN()
655 if (sd->ag_cnt < 0) in do_autogain()
657 if (--sd->ag_cnt >= 0) in do_autogain()
663 reg_r(gspca_dev, 0x8621, 1); in do_autogain()
664 Gr = gspca_dev->usb_buf[0]; in do_autogain()
665 reg_r(gspca_dev, 0x8622, 1); in do_autogain()
666 R = gspca_dev->usb_buf[0]; in do_autogain()
667 reg_r(gspca_dev, 0x8623, 1); in do_autogain()
668 B = gspca_dev->usb_buf[0]; in do_autogain()
669 reg_r(gspca_dev, 0x8624, 1); in do_autogain()
670 Gb = gspca_dev->usb_buf[0]; in do_autogain()
677 expotimes = i2c_read(gspca_dev, 0x09, 0x10); in do_autogain()
678 pixelclk = 0x0800; in do_autogain()
679 expotimes = expotimes & 0x07ff; in do_autogain()
680 gainG = i2c_read(gspca_dev, 0x35, 0x10); in do_autogain()
685 if (gainG > 0x3f) in do_autogain()
686 gainG = 0x3f; in do_autogain()
689 i2c_write(gspca_dev, gainG, 0x35); in do_autogain()
691 if (expotimes > 0x0256) in do_autogain()
692 expotimes = 0x0256; in do_autogain()
695 i2c_write(gspca_dev, expotimes | pixelclk, 0x09); in do_autogain()
709 case 0: /* start of frame */ in sd_pkt_scan()
710 gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0); in sd_pkt_scan()
720 if (data[0] & 0x20) { in sd_pkt_scan()
723 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); in sd_pkt_scan()
728 if (data[1] & 0x10) { in sd_pkt_scan()
743 case 0xff: /* drop (empty mpackets) */ in sd_pkt_scan()
755 gspca_dev->usb_err = 0; in sd_s_ctrl()
758 return 0; in sd_s_ctrl()
770 setwhite(gspca_dev, ctrl->val, 0); in sd_s_ctrl()
796 V4L2_CID_HUE, 1, 0x7f, 1, 0x40); in sd_init_controls_12a()
798 V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); in sd_init_controls_12a()
802 V4L2_CID_GAIN, 0, 255, 1, 63); in sd_init_controls_12a()
808 return 0; in sd_init_controls_12a()
819 V4L2_CID_CONTRAST, 0, 0x3f, 1, 0x20); in sd_init_controls_72a()
821 V4L2_CID_HUE, 1, 0x7f, 1, 0x40); in sd_init_controls_72a()
823 V4L2_CID_BRIGHTNESS, 0, 0x3f, 1, 0x20); in sd_init_controls_72a()
825 V4L2_CID_AUTOGAIN, 0, 1, 1, 1); in sd_init_controls_72a()
832 return 0; in sd_init_controls_72a()
868 {USB_DEVICE(0x041e, 0x401a), .driver_info = Rev072A},
869 {USB_DEVICE(0x041e, 0x403b), .driver_info = Rev012A},
870 {USB_DEVICE(0x0458, 0x7004), .driver_info = Rev072A},
871 {USB_DEVICE(0x0461, 0x0815), .driver_info = Rev072A},
872 {USB_DEVICE(0x046d, 0x0928), .driver_info = Rev012A},
873 {USB_DEVICE(0x046d, 0x0929), .driver_info = Rev012A},
874 {USB_DEVICE(0x046d, 0x092a), .driver_info = Rev012A},
875 {USB_DEVICE(0x046d, 0x092b), .driver_info = Rev012A},
876 {USB_DEVICE(0x046d, 0x092c), .driver_info = Rev012A},
877 {USB_DEVICE(0x046d, 0x092d), .driver_info = Rev012A},
878 {USB_DEVICE(0x046d, 0x092e), .driver_info = Rev012A},
879 {USB_DEVICE(0x046d, 0x092f), .driver_info = Rev012A},
880 {USB_DEVICE(0x04fc, 0x0561), .driver_info = Rev072A},
881 {USB_DEVICE(0x060b, 0xa001), .driver_info = Rev072A},
882 {USB_DEVICE(0x10fd, 0x7e50), .driver_info = Rev072A},
883 {USB_DEVICE(0xabcd, 0xcdee), .driver_info = Rev072A},