Lines Matching +full:0 +full:x5400
54 Return 0 on success, -1 otherwise.
62 if (sd->gspca_dev.usb_err < 0) in w9968cf_write_fsb()
70 ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, in w9968cf_write_fsb()
72 value, 0x06, sd->gspca_dev.usb_buf, 6, 500); in w9968cf_write_fsb()
73 if (ret < 0) { in w9968cf_write_fsb()
81 Return 0 on success, a negative number otherwise.
87 if (sd->gspca_dev.usb_err < 0) in w9968cf_write_sb()
96 usb_sndctrlpipe(sd->gspca_dev.dev, 0), in w9968cf_write_sb()
97 0, in w9968cf_write_sb()
99 value, 0x01, NULL, 0, 500); in w9968cf_write_sb()
103 if (ret < 0) { in w9968cf_write_sb()
111 Return 0 on success, a negative number otherwise.
117 if (sd->gspca_dev.usb_err < 0) in w9968cf_read_sb()
126 usb_rcvctrlpipe(sd->gspca_dev.dev, 0), in w9968cf_read_sb()
129 0, 0x01, sd->gspca_dev.usb_buf, 2, 500); in w9968cf_read_sb()
130 if (ret >= 0) { in w9968cf_read_sb()
131 ret = sd->gspca_dev.usb_buf[0] | in w9968cf_read_sb()
140 memset(sd->gspca_dev.usb_buf, 0, 2); in w9968cf_read_sb()
151 Return 0 on success, a negative number otherwise.
158 reg_w(sd, 0x39, 0x0010); /* JPEG clock enable */ in w9968cf_upload_quantizationtables()
160 for (i = 0, j = 0; i < 32; i++, j += 2) { in w9968cf_upload_quantizationtables()
163 reg_w(sd, 0x40 + i, a); in w9968cf_upload_quantizationtables()
164 reg_w(sd, 0x60 + i, b); in w9968cf_upload_quantizationtables()
166 reg_w(sd, 0x39, 0x0012); /* JPEG encoder enable */ in w9968cf_upload_quantizationtables()
179 w9968cf_write_sb(sd, 0x0011); /* SDE=1, SDA=0, SCL=1 */ in w9968cf_smbus_start()
180 w9968cf_write_sb(sd, 0x0010); /* SDE=1, SDA=0, SCL=0 */ in w9968cf_smbus_start()
185 w9968cf_write_sb(sd, 0x0010); /* SDE=1, SDA=0, SCL=0 */ in w9968cf_smbus_stop()
186 w9968cf_write_sb(sd, 0x0011); /* SDE=1, SDA=0, SCL=1 */ in w9968cf_smbus_stop()
187 w9968cf_write_sb(sd, 0x0013); /* SDE=1, SDA=1, SCL=1 */ in w9968cf_smbus_stop()
195 for (bit = 0 ; bit < 8 ; bit++) { in w9968cf_smbus_write_byte()
196 sda = (v & 0x80) ? 2 : 0; in w9968cf_smbus_write_byte()
198 /* SDE=1, SDA=sda, SCL=0 */ in w9968cf_smbus_write_byte()
199 w9968cf_write_sb(sd, 0x10 | sda); in w9968cf_smbus_write_byte()
201 w9968cf_write_sb(sd, 0x11 | sda); in w9968cf_smbus_write_byte()
202 /* SDE=1, SDA=sda, SCL=0 */ in w9968cf_smbus_write_byte()
203 w9968cf_write_sb(sd, 0x10 | sda); in w9968cf_smbus_write_byte()
213 *v = 0; in w9968cf_smbus_read_byte()
214 for (bit = 0 ; bit < 8 ; bit++) { in w9968cf_smbus_read_byte()
217 w9968cf_write_sb(sd, 0x0013); in w9968cf_smbus_read_byte()
218 *v |= (w9968cf_read_sb(sd) & 0x0008) ? 1 : 0; in w9968cf_smbus_read_byte()
219 /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_read_byte()
220 w9968cf_write_sb(sd, 0x0012); in w9968cf_smbus_read_byte()
228 w9968cf_write_sb(sd, 0x0013); /* SDE=1, SDA=1, SCL=1 */ in w9968cf_smbus_write_nack()
229 w9968cf_write_sb(sd, 0x0012); /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_write_nack()
238 w9968cf_write_sb(sd, 0x0012); /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_read_ack()
239 w9968cf_write_sb(sd, 0x0013); /* SDE=1, SDA=1, SCL=1 */ in w9968cf_smbus_read_ack()
241 w9968cf_write_sb(sd, 0x0012); /* SDE=1, SDA=1, SCL=0 */ in w9968cf_smbus_read_ack()
242 if (sda >= 0 && (sda & 0x08)) { in w9968cf_smbus_read_ack()
254 data[0] = 0x082f | ((sd->sensor_addr & 0x80) ? 0x1500 : 0x0); in w9968cf_i2c_w()
255 data[0] |= (sd->sensor_addr & 0x40) ? 0x4000 : 0x0; in w9968cf_i2c_w()
256 data[1] = 0x2082 | ((sd->sensor_addr & 0x40) ? 0x0005 : 0x0); in w9968cf_i2c_w()
257 data[1] |= (sd->sensor_addr & 0x20) ? 0x0150 : 0x0; in w9968cf_i2c_w()
258 data[1] |= (sd->sensor_addr & 0x10) ? 0x5400 : 0x0; in w9968cf_i2c_w()
259 data[2] = 0x8208 | ((sd->sensor_addr & 0x08) ? 0x0015 : 0x0); in w9968cf_i2c_w()
260 data[2] |= (sd->sensor_addr & 0x04) ? 0x0540 : 0x0; in w9968cf_i2c_w()
261 data[2] |= (sd->sensor_addr & 0x02) ? 0x5000 : 0x0; in w9968cf_i2c_w()
262 data[3] = 0x1d20 | ((sd->sensor_addr & 0x02) ? 0x0001 : 0x0); in w9968cf_i2c_w()
263 data[3] |= (sd->sensor_addr & 0x01) ? 0x0054 : 0x0; in w9968cf_i2c_w()
267 data[0] = 0x8208 | ((reg & 0x80) ? 0x0015 : 0x0); in w9968cf_i2c_w()
268 data[0] |= (reg & 0x40) ? 0x0540 : 0x0; in w9968cf_i2c_w()
269 data[0] |= (reg & 0x20) ? 0x5000 : 0x0; in w9968cf_i2c_w()
270 data[1] = 0x0820 | ((reg & 0x20) ? 0x0001 : 0x0); in w9968cf_i2c_w()
271 data[1] |= (reg & 0x10) ? 0x0054 : 0x0; in w9968cf_i2c_w()
272 data[1] |= (reg & 0x08) ? 0x1500 : 0x0; in w9968cf_i2c_w()
273 data[1] |= (reg & 0x04) ? 0x4000 : 0x0; in w9968cf_i2c_w()
274 data[2] = 0x2082 | ((reg & 0x04) ? 0x0005 : 0x0); in w9968cf_i2c_w()
275 data[2] |= (reg & 0x02) ? 0x0150 : 0x0; in w9968cf_i2c_w()
276 data[2] |= (reg & 0x01) ? 0x5400 : 0x0; in w9968cf_i2c_w()
277 data[3] = 0x001d; in w9968cf_i2c_w()
281 data[0] = 0x8208 | ((value & 0x80) ? 0x0015 : 0x0); in w9968cf_i2c_w()
282 data[0] |= (value & 0x40) ? 0x0540 : 0x0; in w9968cf_i2c_w()
283 data[0] |= (value & 0x20) ? 0x5000 : 0x0; in w9968cf_i2c_w()
284 data[1] = 0x0820 | ((value & 0x20) ? 0x0001 : 0x0); in w9968cf_i2c_w()
285 data[1] |= (value & 0x10) ? 0x0054 : 0x0; in w9968cf_i2c_w()
286 data[1] |= (value & 0x08) ? 0x1500 : 0x0; in w9968cf_i2c_w()
287 data[1] |= (value & 0x04) ? 0x4000 : 0x0; in w9968cf_i2c_w()
288 data[2] = 0x2082 | ((value & 0x04) ? 0x0005 : 0x0); in w9968cf_i2c_w()
289 data[2] |= (value & 0x02) ? 0x0150 : 0x0; in w9968cf_i2c_w()
290 data[2] |= (value & 0x01) ? 0x5400 : 0x0; in w9968cf_i2c_w()
291 data[3] = 0xfe1d; in w9968cf_i2c_w()
295 gspca_dbg(gspca_dev, D_USBO, "i2c 0x%02x -> [0x%02x]\n", value, reg); in w9968cf_i2c_w()
302 int ret = 0; in w9968cf_i2c_r()
306 w9968cf_write_sb(sd, 0x0013); /* don't change ! */ in w9968cf_i2c_r()
325 w9968cf_write_sb(sd, 0x0030); in w9968cf_i2c_r()
327 if (sd->gspca_dev.usb_err >= 0) { in w9968cf_i2c_r()
329 gspca_dbg(gspca_dev, D_USBI, "i2c [0x%02X] -> 0x%02X\n", in w9968cf_i2c_r()
332 gspca_err(gspca_dev, "i2c read [0x%02x] failed\n", reg); in w9968cf_i2c_r()
339 Return 0 on success, a negative number otherwise.
343 reg_w(sd, 0x00, 0xff00); /* power-down */ in w9968cf_configure()
344 reg_w(sd, 0x00, 0xbf17); /* reset everything */ in w9968cf_configure()
345 reg_w(sd, 0x00, 0xbf10); /* normal operation */ in w9968cf_configure()
346 reg_w(sd, 0x01, 0x0010); /* serial bus, SDS high */ in w9968cf_configure()
347 reg_w(sd, 0x01, 0x0000); /* serial bus, SDS low */ in w9968cf_configure()
348 reg_w(sd, 0x01, 0x0010); /* ..high 'beep-beep' */ in w9968cf_configure()
349 reg_w(sd, 0x01, 0x0030); /* Set sda scl to FSB mode */ in w9968cf_configure()
357 y0 = 0x0000, in w9968cf_init()
364 reg_w(sd, 0x00, 0xff00); /* power off */ in w9968cf_init()
365 reg_w(sd, 0x00, 0xbf10); /* power on */ in w9968cf_init()
367 reg_w(sd, 0x03, 0x405d); /* DRAM timings */ in w9968cf_init()
368 reg_w(sd, 0x04, 0x0030); /* SDRAM timings */ in w9968cf_init()
370 reg_w(sd, 0x20, y0 & 0xffff); /* Y buf.0, low */ in w9968cf_init()
371 reg_w(sd, 0x21, y0 >> 16); /* Y buf.0, high */ in w9968cf_init()
372 reg_w(sd, 0x24, u0 & 0xffff); /* U buf.0, low */ in w9968cf_init()
373 reg_w(sd, 0x25, u0 >> 16); /* U buf.0, high */ in w9968cf_init()
374 reg_w(sd, 0x28, v0 & 0xffff); /* V buf.0, low */ in w9968cf_init()
375 reg_w(sd, 0x29, v0 >> 16); /* V buf.0, high */ in w9968cf_init()
377 reg_w(sd, 0x22, y1 & 0xffff); /* Y buf.1, low */ in w9968cf_init()
378 reg_w(sd, 0x23, y1 >> 16); /* Y buf.1, high */ in w9968cf_init()
379 reg_w(sd, 0x26, u1 & 0xffff); /* U buf.1, low */ in w9968cf_init()
380 reg_w(sd, 0x27, u1 >> 16); /* U buf.1, high */ in w9968cf_init()
381 reg_w(sd, 0x2a, v1 & 0xffff); /* V buf.1, low */ in w9968cf_init()
382 reg_w(sd, 0x2b, v1 >> 16); /* V buf.1, high */ in w9968cf_init()
384 reg_w(sd, 0x32, y1 & 0xffff); /* JPEG buf 0 low */ in w9968cf_init()
385 reg_w(sd, 0x33, y1 >> 16); /* JPEG buf 0 high */ in w9968cf_init()
387 reg_w(sd, 0x34, y1 & 0xffff); /* JPEG buf 1 low */ in w9968cf_init()
388 reg_w(sd, 0x35, y1 >> 16); /* JPEG bug 1 high */ in w9968cf_init()
390 reg_w(sd, 0x36, 0x0000);/* JPEG restart interval */ in w9968cf_init()
391 reg_w(sd, 0x37, 0x0804);/*JPEG VLE FIFO threshold*/ in w9968cf_init()
392 reg_w(sd, 0x38, 0x0000);/* disable hw up-scaling */ in w9968cf_init()
393 reg_w(sd, 0x3f, 0x0000); /* JPEG/MCTL test data */ in w9968cf_init()
445 reg_w(sd, 0x10, start_cropx + x); in w9968cf_set_crop_window()
446 reg_w(sd, 0x11, start_cropy + y); in w9968cf_set_crop_window()
447 reg_w(sd, 0x12, start_cropx + x + cw); in w9968cf_set_crop_window()
448 reg_w(sd, 0x13, start_cropy + y + ch); in w9968cf_set_crop_window()
457 reg_w(sd, 0x14, sd->gspca_dev.pixfmt.width); in w9968cf_mode_init_regs()
458 reg_w(sd, 0x15, sd->gspca_dev.pixfmt.height); in w9968cf_mode_init_regs()
461 reg_w(sd, 0x30, sd->gspca_dev.pixfmt.width); in w9968cf_mode_init_regs()
462 reg_w(sd, 0x31, sd->gspca_dev.pixfmt.height); in w9968cf_mode_init_regs()
467 reg_w(sd, 0x2c, sd->gspca_dev.pixfmt.width / 2); in w9968cf_mode_init_regs()
468 reg_w(sd, 0x2d, sd->gspca_dev.pixfmt.width / 4); in w9968cf_mode_init_regs()
470 reg_w(sd, 0x2c, sd->gspca_dev.pixfmt.width); in w9968cf_mode_init_regs()
472 reg_w(sd, 0x00, 0xbf17); /* reset everything */ in w9968cf_mode_init_regs()
473 reg_w(sd, 0x00, 0xbf10); /* normal operation */ in w9968cf_mode_init_regs()
477 reg_w(sd, 0x3d, val & 0xffff); /* low bits */ in w9968cf_mode_init_regs()
478 reg_w(sd, 0x3e, val >> 16); /* high bits */ in w9968cf_mode_init_regs()
484 sd->gspca_dev.pixfmt.width, 0x22); /* JPEG 420 */ in w9968cf_mode_init_regs()
497 hs_polarity = 0; in w9968cf_mode_init_regs()
508 /* val |= 0x0002; YUV422P */ in w9968cf_mode_init_regs()
509 val |= 0x0003; /* YUV420P */ in w9968cf_mode_init_regs()
511 val |= 0x0080; /* Enable HW double buffering */ in w9968cf_mode_init_regs()
513 /* val |= 0x0020; enable clamping */ in w9968cf_mode_init_regs()
514 /* val |= 0x0008; enable (1-2-1) filter */ in w9968cf_mode_init_regs()
515 /* val |= 0x000c; enable (2-3-6-3-2) filter */ in w9968cf_mode_init_regs()
517 val |= 0x8000; /* capt. enable */ in w9968cf_mode_init_regs()
519 reg_w(sd, 0x16, val); in w9968cf_mode_init_regs()
521 sd->gspca_dev.empty_packet = 0; in w9968cf_mode_init_regs()
527 reg_w(sd, 0x39, 0x0000); /* disable JPEG encoder */ in w9968cf_stop0()
528 reg_w(sd, 0x16, 0x0000); /* stop video capture */ in w9968cf_stop0()
531 /* The w9968cf docs say that a 0 sized packet means EOF (and also SOF
548 data[0] == 0xff && in w9968cf_pkt_scan()
549 data[1] == 0xd8) { in w9968cf_pkt_scan()
551 NULL, 0); in w9968cf_pkt_scan()
563 NULL, 0); in w9968cf_pkt_scan()
565 NULL, 0); in w9968cf_pkt_scan()
566 gspca_dev->empty_packet = 0; in w9968cf_pkt_scan()