Lines Matching +full:0 +full:x5400
53 Return 0 on success, -1 otherwise.
61 if (sd->gspca_dev.usb_err < 0) in w9968cf_write_fsb()
69 ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, in w9968cf_write_fsb()
71 value, 0x06, sd->gspca_dev.usb_buf, 6, 500); in w9968cf_write_fsb()
72 if (ret < 0) { in w9968cf_write_fsb()
80 Return 0 on success, a negative number otherwise.
86 if (sd->gspca_dev.usb_err < 0) in w9968cf_write_sb()
95 usb_sndctrlpipe(sd->gspca_dev.dev, 0), in w9968cf_write_sb()
96 0, in w9968cf_write_sb()
98 value, 0x01, NULL, 0, 500); in w9968cf_write_sb()
102 if (ret < 0) { in w9968cf_write_sb()
110 Return 0 on success, a negative number otherwise.
116 if (sd->gspca_dev.usb_err < 0) in w9968cf_read_sb()
125 usb_rcvctrlpipe(sd->gspca_dev.dev, 0), in w9968cf_read_sb()
128 0, 0x01, sd->gspca_dev.usb_buf, 2, 500); in w9968cf_read_sb()
129 if (ret >= 0) { in w9968cf_read_sb()
130 ret = sd->gspca_dev.usb_buf[0] | in w9968cf_read_sb()
139 memset(sd->gspca_dev.usb_buf, 0, 2); in w9968cf_read_sb()
150 Return 0 on success, a negative number otherwise.
157 reg_w(sd, 0x39, 0x0010); /* JPEG clock enable */ in w9968cf_upload_quantizationtables()
159 for (i = 0, j = 0; i < 32; i++, j += 2) { in w9968cf_upload_quantizationtables()
162 reg_w(sd, 0x40 + i, a); in w9968cf_upload_quantizationtables()
163 reg_w(sd, 0x60 + i, b); in w9968cf_upload_quantizationtables()
165 reg_w(sd, 0x39, 0x0012); /* JPEG encoder enable */ in w9968cf_upload_quantizationtables()
178 w9968cf_write_sb(sd, 0x0011); /* SDE=1, SDA=0, SCL=1 */ in w9968cf_smbus_start()
179 w9968cf_write_sb(sd, 0x0010); /* SDE=1, SDA=0, SCL=0 */ in w9968cf_smbus_start()
184 w9968cf_write_sb(sd, 0x0010); /* SDE=1, SDA=0, SCL=0 */ in w9968cf_smbus_stop()
185 w9968cf_write_sb(sd, 0x0011); /* SDE=1, SDA=0, SCL=1 */ in w9968cf_smbus_stop()
186 w9968cf_write_sb(sd, 0x0013); /* SDE=1, SDA=1, SCL=1 */ in w9968cf_smbus_stop()
194 for (bit = 0 ; bit < 8 ; bit++) { in w9968cf_smbus_write_byte()
195 sda = (v & 0x80) ? 2 : 0; in w9968cf_smbus_write_byte()
197 /* SDE=1, SDA=sda, SCL=0 */ in w9968cf_smbus_write_byte()
198 w9968cf_write_sb(sd, 0x10 | sda); in w9968cf_smbus_write_byte()
200 w9968cf_write_sb(sd, 0x11 | sda); in w9968cf_smbus_write_byte()
201 /* SDE=1, SDA=sda, SCL=0 */ in w9968cf_smbus_write_byte()
202 w9968cf_write_sb(sd, 0x10 | sda); in w9968cf_smbus_write_byte()
212 *v = 0; in w9968cf_smbus_read_byte()
213 for (bit = 0 ; bit < 8 ; bit++) { in w9968cf_smbus_read_byte()
216 w9968cf_write_sb(sd, 0x0013); in w9968cf_smbus_read_byte()
217 *v |= (w9968cf_read_sb(sd) & 0x0008) ? 1 : 0; in w9968cf_smbus_read_byte()
218 /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_read_byte()
219 w9968cf_write_sb(sd, 0x0012); in w9968cf_smbus_read_byte()
227 w9968cf_write_sb(sd, 0x0013); /* SDE=1, SDA=1, SCL=1 */ in w9968cf_smbus_write_nack()
228 w9968cf_write_sb(sd, 0x0012); /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_write_nack()
237 w9968cf_write_sb(sd, 0x0012); /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_read_ack()
238 w9968cf_write_sb(sd, 0x0013); /* SDE=1, SDA=1, SCL=1 */ in w9968cf_smbus_read_ack()
240 w9968cf_write_sb(sd, 0x0012); /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_read_ack()
241 if (sda >= 0 && (sda & 0x08)) { in w9968cf_smbus_read_ack()
253 data[0] = 0x082f | ((sd->sensor_addr & 0x80) ? 0x1500 : 0x0); in w9968cf_i2c_w()
254 data[0] |= (sd->sensor_addr & 0x40) ? 0x4000 : 0x0; in w9968cf_i2c_w()
255 data[1] = 0x2082 | ((sd->sensor_addr & 0x40) ? 0x0005 : 0x0); in w9968cf_i2c_w()
256 data[1] |= (sd->sensor_addr & 0x20) ? 0x0150 : 0x0; in w9968cf_i2c_w()
257 data[1] |= (sd->sensor_addr & 0x10) ? 0x5400 : 0x0; in w9968cf_i2c_w()
258 data[2] = 0x8208 | ((sd->sensor_addr & 0x08) ? 0x0015 : 0x0); in w9968cf_i2c_w()
259 data[2] |= (sd->sensor_addr & 0x04) ? 0x0540 : 0x0; in w9968cf_i2c_w()
260 data[2] |= (sd->sensor_addr & 0x02) ? 0x5000 : 0x0; in w9968cf_i2c_w()
261 data[3] = 0x1d20 | ((sd->sensor_addr & 0x02) ? 0x0001 : 0x0); in w9968cf_i2c_w()
262 data[3] |= (sd->sensor_addr & 0x01) ? 0x0054 : 0x0; in w9968cf_i2c_w()
266 data[0] = 0x8208 | ((reg & 0x80) ? 0x0015 : 0x0); in w9968cf_i2c_w()
267 data[0] |= (reg & 0x40) ? 0x0540 : 0x0; in w9968cf_i2c_w()
268 data[0] |= (reg & 0x20) ? 0x5000 : 0x0; in w9968cf_i2c_w()
269 data[1] = 0x0820 | ((reg & 0x20) ? 0x0001 : 0x0); in w9968cf_i2c_w()
270 data[1] |= (reg & 0x10) ? 0x0054 : 0x0; in w9968cf_i2c_w()
271 data[1] |= (reg & 0x08) ? 0x1500 : 0x0; in w9968cf_i2c_w()
272 data[1] |= (reg & 0x04) ? 0x4000 : 0x0; in w9968cf_i2c_w()
273 data[2] = 0x2082 | ((reg & 0x04) ? 0x0005 : 0x0); in w9968cf_i2c_w()
274 data[2] |= (reg & 0x02) ? 0x0150 : 0x0; in w9968cf_i2c_w()
275 data[2] |= (reg & 0x01) ? 0x5400 : 0x0; in w9968cf_i2c_w()
276 data[3] = 0x001d; in w9968cf_i2c_w()
280 data[0] = 0x8208 | ((value & 0x80) ? 0x0015 : 0x0); in w9968cf_i2c_w()
281 data[0] |= (value & 0x40) ? 0x0540 : 0x0; in w9968cf_i2c_w()
282 data[0] |= (value & 0x20) ? 0x5000 : 0x0; in w9968cf_i2c_w()
283 data[1] = 0x0820 | ((value & 0x20) ? 0x0001 : 0x0); in w9968cf_i2c_w()
284 data[1] |= (value & 0x10) ? 0x0054 : 0x0; in w9968cf_i2c_w()
285 data[1] |= (value & 0x08) ? 0x1500 : 0x0; in w9968cf_i2c_w()
286 data[1] |= (value & 0x04) ? 0x4000 : 0x0; in w9968cf_i2c_w()
287 data[2] = 0x2082 | ((value & 0x04) ? 0x0005 : 0x0); in w9968cf_i2c_w()
288 data[2] |= (value & 0x02) ? 0x0150 : 0x0; in w9968cf_i2c_w()
289 data[2] |= (value & 0x01) ? 0x5400 : 0x0; in w9968cf_i2c_w()
290 data[3] = 0xfe1d; in w9968cf_i2c_w()
294 gspca_dbg(gspca_dev, D_USBO, "i2c 0x%02x -> [0x%02x]\n", value, reg); in w9968cf_i2c_w()
301 int ret = 0; in w9968cf_i2c_r()
305 w9968cf_write_sb(sd, 0x0013); /* don't change ! */ in w9968cf_i2c_r()
324 w9968cf_write_sb(sd, 0x0030); in w9968cf_i2c_r()
326 if (sd->gspca_dev.usb_err >= 0) { in w9968cf_i2c_r()
328 gspca_dbg(gspca_dev, D_USBI, "i2c [0x%02X] -> 0x%02X\n", in w9968cf_i2c_r()
331 gspca_err(gspca_dev, "i2c read [0x%02x] failed\n", reg); in w9968cf_i2c_r()
338 Return 0 on success, a negative number otherwise.
342 reg_w(sd, 0x00, 0xff00); /* power-down */ in w9968cf_configure()
343 reg_w(sd, 0x00, 0xbf17); /* reset everything */ in w9968cf_configure()
344 reg_w(sd, 0x00, 0xbf10); /* normal operation */ in w9968cf_configure()
345 reg_w(sd, 0x01, 0x0010); /* serial bus, SDS high */ in w9968cf_configure()
346 reg_w(sd, 0x01, 0x0000); /* serial bus, SDS low */ in w9968cf_configure()
347 reg_w(sd, 0x01, 0x0010); /* ..high 'beep-beep' */ in w9968cf_configure()
348 reg_w(sd, 0x01, 0x0030); /* Set sda scl to FSB mode */ in w9968cf_configure()
356 y0 = 0x0000, in w9968cf_init()
363 reg_w(sd, 0x00, 0xff00); /* power off */ in w9968cf_init()
364 reg_w(sd, 0x00, 0xbf10); /* power on */ in w9968cf_init()
366 reg_w(sd, 0x03, 0x405d); /* DRAM timings */ in w9968cf_init()
367 reg_w(sd, 0x04, 0x0030); /* SDRAM timings */ in w9968cf_init()
369 reg_w(sd, 0x20, y0 & 0xffff); /* Y buf.0, low */ in w9968cf_init()
370 reg_w(sd, 0x21, y0 >> 16); /* Y buf.0, high */ in w9968cf_init()
371 reg_w(sd, 0x24, u0 & 0xffff); /* U buf.0, low */ in w9968cf_init()
372 reg_w(sd, 0x25, u0 >> 16); /* U buf.0, high */ in w9968cf_init()
373 reg_w(sd, 0x28, v0 & 0xffff); /* V buf.0, low */ in w9968cf_init()
374 reg_w(sd, 0x29, v0 >> 16); /* V buf.0, high */ in w9968cf_init()
376 reg_w(sd, 0x22, y1 & 0xffff); /* Y buf.1, low */ in w9968cf_init()
377 reg_w(sd, 0x23, y1 >> 16); /* Y buf.1, high */ in w9968cf_init()
378 reg_w(sd, 0x26, u1 & 0xffff); /* U buf.1, low */ in w9968cf_init()
379 reg_w(sd, 0x27, u1 >> 16); /* U buf.1, high */ in w9968cf_init()
380 reg_w(sd, 0x2a, v1 & 0xffff); /* V buf.1, low */ in w9968cf_init()
381 reg_w(sd, 0x2b, v1 >> 16); /* V buf.1, high */ in w9968cf_init()
383 reg_w(sd, 0x32, y1 & 0xffff); /* JPEG buf 0 low */ in w9968cf_init()
384 reg_w(sd, 0x33, y1 >> 16); /* JPEG buf 0 high */ in w9968cf_init()
386 reg_w(sd, 0x34, y1 & 0xffff); /* JPEG buf 1 low */ in w9968cf_init()
387 reg_w(sd, 0x35, y1 >> 16); /* JPEG bug 1 high */ in w9968cf_init()
389 reg_w(sd, 0x36, 0x0000);/* JPEG restart interval */ in w9968cf_init()
390 reg_w(sd, 0x37, 0x0804);/*JPEG VLE FIFO threshold*/ in w9968cf_init()
391 reg_w(sd, 0x38, 0x0000);/* disable hw up-scaling */ in w9968cf_init()
392 reg_w(sd, 0x3f, 0x0000); /* JPEG/MCTL test data */ in w9968cf_init()
444 reg_w(sd, 0x10, start_cropx + x); in w9968cf_set_crop_window()
445 reg_w(sd, 0x11, start_cropy + y); in w9968cf_set_crop_window()
446 reg_w(sd, 0x12, start_cropx + x + cw); in w9968cf_set_crop_window()
447 reg_w(sd, 0x13, start_cropy + y + ch); in w9968cf_set_crop_window()
456 reg_w(sd, 0x14, sd->gspca_dev.pixfmt.width); in w9968cf_mode_init_regs()
457 reg_w(sd, 0x15, sd->gspca_dev.pixfmt.height); in w9968cf_mode_init_regs()
460 reg_w(sd, 0x30, sd->gspca_dev.pixfmt.width); in w9968cf_mode_init_regs()
461 reg_w(sd, 0x31, sd->gspca_dev.pixfmt.height); in w9968cf_mode_init_regs()
466 reg_w(sd, 0x2c, sd->gspca_dev.pixfmt.width / 2); in w9968cf_mode_init_regs()
467 reg_w(sd, 0x2d, sd->gspca_dev.pixfmt.width / 4); in w9968cf_mode_init_regs()
469 reg_w(sd, 0x2c, sd->gspca_dev.pixfmt.width); in w9968cf_mode_init_regs()
471 reg_w(sd, 0x00, 0xbf17); /* reset everything */ in w9968cf_mode_init_regs()
472 reg_w(sd, 0x00, 0xbf10); /* normal operation */ in w9968cf_mode_init_regs()
476 reg_w(sd, 0x3d, val & 0xffff); /* low bits */ in w9968cf_mode_init_regs()
477 reg_w(sd, 0x3e, val >> 16); /* high bits */ in w9968cf_mode_init_regs()
483 sd->gspca_dev.pixfmt.width, 0x22); /* JPEG 420 */ in w9968cf_mode_init_regs()
496 hs_polarity = 0; in w9968cf_mode_init_regs()
507 /* val |= 0x0002; YUV422P */ in w9968cf_mode_init_regs()
508 val |= 0x0003; /* YUV420P */ in w9968cf_mode_init_regs()
510 val |= 0x0080; /* Enable HW double buffering */ in w9968cf_mode_init_regs()
512 /* val |= 0x0020; enable clamping */ in w9968cf_mode_init_regs()
513 /* val |= 0x0008; enable (1-2-1) filter */ in w9968cf_mode_init_regs()
514 /* val |= 0x000c; enable (2-3-6-3-2) filter */ in w9968cf_mode_init_regs()
516 val |= 0x8000; /* capt. enable */ in w9968cf_mode_init_regs()
518 reg_w(sd, 0x16, val); in w9968cf_mode_init_regs()
520 sd->gspca_dev.empty_packet = 0; in w9968cf_mode_init_regs()
526 reg_w(sd, 0x39, 0x0000); /* disable JPEG encoder */ in w9968cf_stop0()
527 reg_w(sd, 0x16, 0x0000); /* stop video capture */ in w9968cf_stop0()
530 /* The w9968cf docs say that a 0 sized packet means EOF (and also SOF
547 data[0] == 0xff && in w9968cf_pkt_scan()
548 data[1] == 0xd8) { in w9968cf_pkt_scan()
550 NULL, 0); in w9968cf_pkt_scan()
562 NULL, 0); in w9968cf_pkt_scan()
564 NULL, 0); in w9968cf_pkt_scan()
565 gspca_dev->empty_packet = 0; in w9968cf_pkt_scan()