Lines Matching +full:0 +full:x185
51 if (gspca_dev->usb_err < 0) in reg_r()
52 return 0; in reg_r()
53 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), in reg_r()
54 0x00, in reg_r()
56 0x00, in reg_r()
61 gspca_dbg(gspca_dev, D_USBI, "reg_r 0x%x=0x%02x\n", in reg_r()
62 index, gspca_dev->usb_buf[0]); in reg_r()
63 if (ret < 0) { in reg_r()
64 pr_err("reg_r 0x%x err %d\n", index, ret); in reg_r()
66 return 0; in reg_r()
69 return gspca_dev->usb_buf[0]; in reg_r()
78 if (gspca_dev->usb_err < 0) in reg_w()
80 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), in reg_w()
81 0x01, in reg_w()
86 0, in reg_w()
88 gspca_dbg(gspca_dev, D_USBO, "reg_w 0x%x:=0x%02x\n", index, val); in reg_w()
89 if (ret < 0) { in reg_w()
90 pr_err("reg_w 0x%x err %d\n", index, ret); in reg_w()
107 return 0; in sd_config()
112 int i = 0; in stk1135_serial_wait_ready()
118 pr_err("serial bus timeout: status=0x%02x\n", val); in stk1135_serial_wait_ready()
122 } while ((val & 0x10) || !(val & 0x05)); in stk1135_serial_wait_ready()
124 return 0; in stk1135_serial_wait_ready()
131 reg_w(gspca_dev, STK1135_REG_SICTL, 0x20); in sensor_read_8()
135 return 0; in sensor_read_8()
144 sensor_read_8(gspca_dev, 0xf1); in sensor_read_16()
153 reg_w(gspca_dev, STK1135_REG_SICTL, 0x01); in sensor_write_8()
164 sensor_write_8(gspca_dev, 0xf1, data & 0xff); in sensor_write_16()
172 sensor_write_16(gspca_dev, 0xf0, page); in sensor_set_page()
180 return sensor_read_16(gspca_dev, reg & 0xff); in sensor_read()
186 sensor_write_16(gspca_dev, reg & 0xff, val); in sensor_write()
206 { 0x00d, 0x000b }, { 0x00d, 0x0008 }, { 0x035, 0x0022 }, in stk1135_configure_mt9m112()
208 { 0x106, 0x700e }, in stk1135_configure_mt9m112()
210 { 0x2dd, 0x18e0 }, /* B-R thresholds, */ in stk1135_configure_mt9m112()
213 { 0x21f, 0x0180 }, /* Cb and Cr limits */ in stk1135_configure_mt9m112()
214 { 0x220, 0xc814 }, { 0x221, 0x8080 }, /* lum limits, RGB gain */ in stk1135_configure_mt9m112()
215 { 0x222, 0xa078 }, { 0x223, 0xa078 }, /* R, B limit */ in stk1135_configure_mt9m112()
216 { 0x224, 0x5f20 }, { 0x228, 0xea02 }, /* mtx adj lim, adv ctl */ in stk1135_configure_mt9m112()
217 { 0x229, 0x867a }, /* wide gates */ in stk1135_configure_mt9m112()
221 { 0x25e, 0x594c }, { 0x25f, 0x4d51 }, { 0x260, 0x0002 }, in stk1135_configure_mt9m112()
223 { 0x2ef, 0x0008 }, { 0x2f2, 0x0000 }, in stk1135_configure_mt9m112()
225 { 0x202, 0x00ee }, { 0x203, 0x3923 }, { 0x204, 0x0724 }, in stk1135_configure_mt9m112()
227 { 0x209, 0x00cd }, { 0x20a, 0x0093 }, { 0x20b, 0x0004 },/*K1-3*/ in stk1135_configure_mt9m112()
228 { 0x20c, 0x005c }, { 0x20d, 0x00d9 }, { 0x20e, 0x0053 },/*K4-6*/ in stk1135_configure_mt9m112()
229 { 0x20f, 0x0008 }, { 0x210, 0x0091 }, { 0x211, 0x00cf },/*K7-9*/ in stk1135_configure_mt9m112()
230 { 0x215, 0x0000 }, /* delta mtx signs */ in stk1135_configure_mt9m112()
232 { 0x216, 0x0000 }, { 0x217, 0x0000 }, { 0x218, 0x0000 },/*D1-3*/ in stk1135_configure_mt9m112()
233 { 0x219, 0x0000 }, { 0x21a, 0x0000 }, { 0x21b, 0x0000 },/*D4-6*/ in stk1135_configure_mt9m112()
234 { 0x21c, 0x0000 }, { 0x21d, 0x0000 }, { 0x21e, 0x0000 },/*D7-9*/ in stk1135_configure_mt9m112()
236 { 0x106, 0xf00e }, { 0x106, 0x700e }, in stk1135_configure_mt9m112()
239 { 0x180, 0x0007 }, /* control */ in stk1135_configure_mt9m112()
240 /* vertical knee 0, 2+1, 4+3 */ in stk1135_configure_mt9m112()
241 { 0x181, 0xde13 }, { 0x182, 0xebe2 }, { 0x183, 0x00f6 }, /* R */ in stk1135_configure_mt9m112()
242 { 0x184, 0xe114 }, { 0x185, 0xeadd }, { 0x186, 0xfdf6 }, /* G */ in stk1135_configure_mt9m112()
243 { 0x187, 0xe511 }, { 0x188, 0xede6 }, { 0x189, 0xfbf7 }, /* B */ in stk1135_configure_mt9m112()
244 /* horizontal knee 0, 2+1, 4+3, 5 */ in stk1135_configure_mt9m112()
245 { 0x18a, 0xd613 }, { 0x18b, 0xedec }, /* R .. */ in stk1135_configure_mt9m112()
246 { 0x18c, 0xf9f2 }, { 0x18d, 0x0000 }, /* .. R */ in stk1135_configure_mt9m112()
247 { 0x18e, 0xd815 }, { 0x18f, 0xe9ea }, /* G .. */ in stk1135_configure_mt9m112()
248 { 0x190, 0xf9f1 }, { 0x191, 0x0002 }, /* .. G */ in stk1135_configure_mt9m112()
249 { 0x192, 0xde10 }, { 0x193, 0xefef }, /* B .. */ in stk1135_configure_mt9m112()
250 { 0x194, 0xfbf4 }, { 0x195, 0x0002 }, /* .. B */ in stk1135_configure_mt9m112()
252 { 0x1b6, 0x0e06 }, { 0x1b7, 0x2713 }, /* R */ in stk1135_configure_mt9m112()
253 { 0x1b8, 0x1106 }, { 0x1b9, 0x2713 }, /* G */ in stk1135_configure_mt9m112()
254 { 0x1ba, 0x0c03 }, { 0x1bb, 0x2a0f }, /* B */ in stk1135_configure_mt9m112()
256 { 0x1bc, 0x1208 }, { 0x1bd, 0x1a16 }, { 0x1be, 0x0022 }, /* R */ in stk1135_configure_mt9m112()
257 { 0x1bf, 0x150a }, { 0x1c0, 0x1c1a }, { 0x1c1, 0x002d }, /* G */ in stk1135_configure_mt9m112()
258 { 0x1c2, 0x1109 }, { 0x1c3, 0x1414 }, { 0x1c4, 0x002a }, /* B */ in stk1135_configure_mt9m112()
259 { 0x106, 0x740e }, /* enable lens shading correction */ in stk1135_configure_mt9m112()
262 { 0x153, 0x0b03 }, { 0x154, 0x4722 }, { 0x155, 0xac82 }, in stk1135_configure_mt9m112()
263 { 0x156, 0xdac7 }, { 0x157, 0xf5e9 }, { 0x158, 0xff00 }, in stk1135_configure_mt9m112()
265 { 0x1dc, 0x0b03 }, { 0x1dd, 0x4722 }, { 0x1de, 0xac82 }, in stk1135_configure_mt9m112()
266 { 0x1df, 0xdac7 }, { 0x1e0, 0xf5e9 }, { 0x1e1, 0xff00 }, in stk1135_configure_mt9m112()
269 { 0x13a, 0x4300 }, { 0x19b, 0x4300 }, /* for context A, B */ in stk1135_configure_mt9m112()
270 { 0x108, 0x0180 }, /* format control - enable bayer row flip */ in stk1135_configure_mt9m112()
272 { 0x22f, 0xd100 }, { 0x29c, 0xd100 }, /* AE A, B */ in stk1135_configure_mt9m112()
274 /* default prg conf, prg ctl - by 0x2d2, prg advance - PA1 */ in stk1135_configure_mt9m112()
275 { 0x2d2, 0x0000 }, { 0x2cc, 0x0004 }, { 0x2cb, 0x0001 }, in stk1135_configure_mt9m112()
277 { 0x22e, 0x0c3c }, { 0x267, 0x1010 }, /* AE tgt ctl, gain lim */ in stk1135_configure_mt9m112()
280 { 0x065, 0xa000 }, /* clk ctl - enable PLL (clear bit 14) */ in stk1135_configure_mt9m112()
281 { 0x066, 0x2003 }, { 0x067, 0x0501 }, /* PLL M=128, N=3, P=1 */ in stk1135_configure_mt9m112()
282 { 0x065, 0x2000 }, /* disable PLL bypass (clear bit 15) */ in stk1135_configure_mt9m112()
284 { 0x005, 0x01b8 }, { 0x007, 0x00d8 }, /* horiz blanking B, A */ in stk1135_configure_mt9m112()
287 { 0x239, 0x06c0 }, { 0x23b, 0x040e }, /* for context A */ in stk1135_configure_mt9m112()
288 { 0x23a, 0x06c0 }, { 0x23c, 0x0564 }, /* for context B */ in stk1135_configure_mt9m112()
290 { 0x257, 0x0208 }, { 0x258, 0x0271 }, /* for context A */ in stk1135_configure_mt9m112()
291 { 0x259, 0x0209 }, { 0x25a, 0x0271 }, /* for context B */ in stk1135_configure_mt9m112()
293 { 0x25c, 0x120d }, { 0x25d, 0x1712 }, /* flicker 60Hz, 50Hz */ in stk1135_configure_mt9m112()
294 { 0x264, 0x5e1c }, /* reserved */ in stk1135_configure_mt9m112()
296 { 0x25b, 0x0003 }, { 0x236, 0x7810 }, { 0x237, 0x8304 }, in stk1135_configure_mt9m112()
298 { 0x008, 0x0021 }, /* vert blanking A */ in stk1135_configure_mt9m112()
303 for (i = 0; i < ARRAY_SIZE(cfg); i++) in stk1135_configure_mt9m112()
310 sensor_write(gspca_dev, 0x1a7, width); in stk1135_configure_mt9m112()
311 sensor_write(gspca_dev, 0x1aa, height); in stk1135_configure_mt9m112()
313 sensor_write(gspca_dev, 0x0c8, 0x0000); in stk1135_configure_mt9m112()
315 sensor_write(gspca_dev, 0x2c8, 0x0000); in stk1135_configure_mt9m112()
317 sensor_write(gspca_dev, 0x1a1, width); in stk1135_configure_mt9m112()
318 sensor_write(gspca_dev, 0x1a4, height); in stk1135_configure_mt9m112()
320 sensor_write(gspca_dev, 0x0c8, 0x0008); in stk1135_configure_mt9m112()
322 sensor_write(gspca_dev, 0x2c8, 0x040b); in stk1135_configure_mt9m112()
329 reg_w(gspca_dev, STK1135_REG_TMGEN, 0x12); in stk1135_configure_clock()
331 /* and positive edge clocked pulse high when pixel counter = 0 */ in stk1135_configure_clock()
332 reg_w(gspca_dev, STK1135_REG_TCP1 + 0, 0x41); in stk1135_configure_clock()
333 reg_w(gspca_dev, STK1135_REG_TCP1 + 1, 0x00); in stk1135_configure_clock()
334 reg_w(gspca_dev, STK1135_REG_TCP1 + 2, 0x00); in stk1135_configure_clock()
335 reg_w(gspca_dev, STK1135_REG_TCP1 + 3, 0x00); in stk1135_configure_clock()
338 reg_w(gspca_dev, STK1135_REG_SENSO + 0, 0x10); in stk1135_configure_clock()
340 reg_w(gspca_dev, STK1135_REG_SENSO + 1, 0x00); in stk1135_configure_clock()
342 reg_w(gspca_dev, STK1135_REG_SENSO + 3, 0x07); in stk1135_configure_clock()
344 reg_w(gspca_dev, STK1135_REG_PLLFD, 0x06); in stk1135_configure_clock()
346 reg_w(gspca_dev, STK1135_REG_TMGEN, 0x80); in stk1135_configure_clock()
348 reg_w(gspca_dev, STK1135_REG_SENSO + 2, 0x04); in stk1135_configure_clock()
350 /* set serial interface clock divider (30MHz/0x1f*16+2) = 60240 kHz) */ in stk1135_configure_clock()
351 reg_w(gspca_dev, STK1135_REG_SICTL + 2, 0x1f); in stk1135_configure_clock()
359 /* set capture end Y position to 0 */ in stk1135_camera_disable()
360 reg_w(gspca_dev, STK1135_REG_CIEPO + 2, 0x00); in stk1135_camera_disable()
361 reg_w(gspca_dev, STK1135_REG_CIEPO + 3, 0x00); in stk1135_camera_disable()
363 reg_w_mask(gspca_dev, STK1135_REG_SCTRL, 0x00, 0x80); in stk1135_camera_disable()
366 sensor_write_mask(gspca_dev, 0x00d, 0x0004, 0x000c); in stk1135_camera_disable()
369 reg_w_mask(gspca_dev, STK1135_REG_SENSO + 2, 0x00, 0x01); in stk1135_camera_disable()
371 reg_w(gspca_dev, STK1135_REG_TMGEN, 0x00); in stk1135_camera_disable()
373 reg_w(gspca_dev, STK1135_REG_SENSO + 1, 0x20); in stk1135_camera_disable()
375 reg_w(gspca_dev, STK1135_REG_SENSO, 0x00); in stk1135_camera_disable()
378 reg_w(gspca_dev, STK1135_REG_GCTRL, 0x49); in stk1135_camera_disable()
389 reg_w(gspca_dev, STK1135_REG_GCTRL + 2, 0x78); in sd_init()
393 reg_w(gspca_dev, STK1135_REG_GCTRL + 3, 0x80); in sd_init()
395 reg_w(gspca_dev, STK1135_REG_ICTRL + 1, 0x00); in sd_init()
396 reg_w(gspca_dev, STK1135_REG_ICTRL + 3, 0x03); in sd_init()
398 reg_w(gspca_dev, STK1135_REG_RMCTL + 1, 0x00); in sd_init()
399 reg_w(gspca_dev, STK1135_REG_RMCTL + 3, 0x02); in sd_init()
402 reg_w(gspca_dev, STK1135_REG_SICTL, 0x80); in sd_init()
403 reg_w(gspca_dev, STK1135_REG_SICTL, 0x00); in sd_init()
405 reg_w(gspca_dev, STK1135_REG_SICTL + 3, 0xba); in sd_init()
407 reg_w(gspca_dev, STK1135_REG_ASIC + 3, 0x00); in sd_init()
412 sd->sensor_page = 0xff; in sd_init()
413 sensor_id = sensor_read(gspca_dev, 0x000); in sd_init()
416 case 0x148c: in sd_init()
422 pr_info("Detected sensor type %s (0x%x)\n", sensor_name, sensor_id); in sd_init()
440 /* set capture start position X = 0, Y = 0 */ in sd_start()
441 reg_w(gspca_dev, STK1135_REG_CISPO + 0, 0x00); in sd_start()
442 reg_w(gspca_dev, STK1135_REG_CISPO + 1, 0x00); in sd_start()
443 reg_w(gspca_dev, STK1135_REG_CISPO + 2, 0x00); in sd_start()
444 reg_w(gspca_dev, STK1135_REG_CISPO + 3, 0x00); in sd_start()
449 reg_w(gspca_dev, STK1135_REG_CIEPO + 0, width & 0xff); in sd_start()
451 reg_w(gspca_dev, STK1135_REG_CIEPO + 2, height & 0xff); in sd_start()
455 reg_w(gspca_dev, STK1135_REG_SCTRL, 0x20); in sd_start()
460 reg_w_mask(gspca_dev, STK1135_REG_SCTRL, 0x80, 0x80); in sd_start()
462 if (gspca_dev->usb_err >= 0) in sd_start()
463 gspca_dbg(gspca_dev, D_STREAM, "camera started alt: 0x%02x\n", in sd_start()
466 sd->pkt_seq = 0; in sd_start()
475 usb_set_interface(dev, gspca_dev->iface, 0); in sd_stopN()
498 /* GPIO 8 is flip sensor (1 = normal position, 0 = flipped to back) */ in sd_pkt_scan()
504 sd->flip_debounce = 0; in sd_pkt_scan()
519 sd->pkt_seq = 0; in sd_pkt_scan()
526 gspca_frame_add(gspca_dev, LAST_PACKET, data, 0); in sd_pkt_scan()
538 sensor_write_mask(gspca_dev, 0x020, val ? 0x0002 : 0x0000 , 0x0002); in sethflip()
547 sensor_write_mask(gspca_dev, 0x020, val ? 0x0001 : 0x0000 , 0x0001); in setvflip()
566 gspca_dev->usb_err = 0; in sd_s_ctrl()
569 return 0; in sd_s_ctrl()
595 V4L2_CID_HFLIP, 0, 1, 1, 0); in sd_init_controls()
597 V4L2_CID_VFLIP, 0, 1, 1, 0); in sd_init_controls()
603 return 0; in sd_init_controls()
621 if (fsize->index != 0 || fsize->pixel_format != V4L2_PIX_FMT_SBGGR8) in stk1135_enum_framesizes()
632 return 0; in stk1135_enum_framesizes()
651 {USB_DEVICE(0x174f, 0x6a31)}, /* ASUS laptop, MT9M112 sensor */