Lines Matching refs:err
158 int err; in po1030_probe() local
177 err = m5602_write_sensor(sd, preinit_po1030[i][1], in po1030_probe()
180 err = m5602_write_bridge(sd, preinit_po1030[i][1], in po1030_probe()
182 if (err < 0) in po1030_probe()
183 return err; in po1030_probe()
204 int i, err = 0; in po1030_init() local
207 for (i = 0; i < ARRAY_SIZE(init_po1030) && !err; i++) { in po1030_init()
212 err = m5602_write_bridge(sd, in po1030_init()
219 err = m5602_write_sensor(sd, in po1030_init()
228 if (err < 0) in po1030_init()
229 return err; in po1030_init()
283 int i, err = 0; in po1030_start() local
292 err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1); in po1030_start()
293 if (err < 0) in po1030_start()
294 return err; in po1030_start()
297 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1); in po1030_start()
298 if (err < 0) in po1030_start()
299 return err; in po1030_start()
302 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_L, &data, 1); in po1030_start()
303 if (err < 0) in po1030_start()
304 return err; in po1030_start()
307 err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_H, &data, 1); in po1030_start()
308 if (err < 0) in po1030_start()
309 return err; in po1030_start()
312 err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_L, &data, 1); in po1030_start()
320 err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1); in po1030_start()
321 if (err < 0) in po1030_start()
322 return err; in po1030_start()
325 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1); in po1030_start()
326 if (err < 0) in po1030_start()
327 return err; in po1030_start()
330 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_L, &data, 1); in po1030_start()
331 if (err < 0) in po1030_start()
332 return err; in po1030_start()
335 err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_H, &data, 1); in po1030_start()
336 if (err < 0) in po1030_start()
337 return err; in po1030_start()
340 err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_L, &data, 1); in po1030_start()
346 err = m5602_write_bridge(sd, M5602_XB_SENSOR_TYPE, 0x0c); in po1030_start()
347 if (err < 0) in po1030_start()
348 return err; in po1030_start()
350 err = m5602_write_bridge(sd, M5602_XB_LINE_OF_FRAME_H, 0x81); in po1030_start()
351 if (err < 0) in po1030_start()
352 return err; in po1030_start()
354 err = m5602_write_bridge(sd, M5602_XB_PIX_OF_LINE_H, 0x82); in po1030_start()
355 if (err < 0) in po1030_start()
356 return err; in po1030_start()
358 err = m5602_write_bridge(sd, M5602_XB_SIG_INI, 0x01); in po1030_start()
359 if (err < 0) in po1030_start()
360 return err; in po1030_start()
362 err = m5602_write_bridge(sd, M5602_XB_VSYNC_PARA, in po1030_start()
364 if (err < 0) in po1030_start()
365 return err; in po1030_start()
367 err = m5602_write_bridge(sd, M5602_XB_VSYNC_PARA, (ver_offs & 0xff)); in po1030_start()
368 if (err < 0) in po1030_start()
369 return err; in po1030_start()
371 for (i = 0; i < 2 && !err; i++) in po1030_start()
372 err = m5602_write_bridge(sd, M5602_XB_VSYNC_PARA, 0); in po1030_start()
373 if (err < 0) in po1030_start()
374 return err; in po1030_start()
376 err = m5602_write_bridge(sd, M5602_XB_VSYNC_PARA, (height >> 8) & 0xff); in po1030_start()
377 if (err < 0) in po1030_start()
378 return err; in po1030_start()
380 err = m5602_write_bridge(sd, M5602_XB_VSYNC_PARA, (height & 0xff)); in po1030_start()
381 if (err < 0) in po1030_start()
382 return err; in po1030_start()
384 for (i = 0; i < 2 && !err; i++) in po1030_start()
385 err = m5602_write_bridge(sd, M5602_XB_VSYNC_PARA, 0); in po1030_start()
387 for (i = 0; i < 2 && !err; i++) in po1030_start()
388 err = m5602_write_bridge(sd, M5602_XB_SIG_INI, 0); in po1030_start()
390 for (i = 0; i < 2 && !err; i++) in po1030_start()
391 err = m5602_write_bridge(sd, M5602_XB_HSYNC_PARA, 0); in po1030_start()
392 if (err < 0) in po1030_start()
393 return err; in po1030_start()
395 err = m5602_write_bridge(sd, M5602_XB_HSYNC_PARA, (width >> 8) & 0xff); in po1030_start()
396 if (err < 0) in po1030_start()
397 return err; in po1030_start()
399 err = m5602_write_bridge(sd, M5602_XB_HSYNC_PARA, (width & 0xff)); in po1030_start()
400 if (err < 0) in po1030_start()
401 return err; in po1030_start()
403 err = m5602_write_bridge(sd, M5602_XB_SIG_INI, 0); in po1030_start()
404 return err; in po1030_start()
411 int err; in po1030_set_exposure() local
419 err = m5602_write_sensor(sd, PO1030_INTEGLINES_H, in po1030_set_exposure()
421 if (err < 0) in po1030_set_exposure()
422 return err; in po1030_set_exposure()
427 err = m5602_write_sensor(sd, PO1030_INTEGLINES_M, in po1030_set_exposure()
430 return err; in po1030_set_exposure()
437 int err; in po1030_set_gain() local
441 err = m5602_write_sensor(sd, PO1030_GLOBALGAIN, in po1030_set_gain()
443 return err; in po1030_set_gain()
450 int err; in po1030_set_hvflip() local
454 err = m5602_read_sensor(sd, PO1030_CONTROL2, &i2c_data, 1); in po1030_set_hvflip()
455 if (err < 0) in po1030_set_hvflip()
456 return err; in po1030_set_hvflip()
461 err = m5602_write_sensor(sd, PO1030_CONTROL2, in po1030_set_hvflip()
464 return err; in po1030_set_hvflip()
471 int err; in po1030_set_red_balance() local
475 err = m5602_write_sensor(sd, PO1030_RED_GAIN, in po1030_set_red_balance()
477 return err; in po1030_set_red_balance()
484 int err; in po1030_set_blue_balance() local
488 err = m5602_write_sensor(sd, PO1030_BLUE_GAIN, in po1030_set_blue_balance()
491 return err; in po1030_set_blue_balance()
498 int err; in po1030_set_green_balance() local
503 err = m5602_write_sensor(sd, PO1030_GREEN_1_GAIN, in po1030_set_green_balance()
505 if (err < 0) in po1030_set_green_balance()
506 return err; in po1030_set_green_balance()
517 int err; in po1030_set_auto_white_balance() local
519 err = m5602_read_sensor(sd, PO1030_AUTOCTRL1, &i2c_data, 1); in po1030_set_auto_white_balance()
520 if (err < 0) in po1030_set_auto_white_balance()
521 return err; in po1030_set_auto_white_balance()
525 err = m5602_write_sensor(sd, PO1030_AUTOCTRL1, &i2c_data, 1); in po1030_set_auto_white_balance()
526 return err; in po1030_set_auto_white_balance()
534 int err; in po1030_set_auto_exposure() local
536 err = m5602_read_sensor(sd, PO1030_AUTOCTRL1, &i2c_data, 1); in po1030_set_auto_exposure()
537 if (err < 0) in po1030_set_auto_exposure()
538 return err; in po1030_set_auto_exposure()
556 int err; in po1030_s_ctrl() local
563 err = po1030_set_auto_white_balance(gspca_dev, ctrl->val); in po1030_s_ctrl()
564 if (err || ctrl->val) in po1030_s_ctrl()
565 return err; in po1030_s_ctrl()
566 err = po1030_set_green_balance(gspca_dev, sd->green_bal->val); in po1030_s_ctrl()
567 if (err) in po1030_s_ctrl()
568 return err; in po1030_s_ctrl()
569 err = po1030_set_red_balance(gspca_dev, sd->red_bal->val); in po1030_s_ctrl()
570 if (err) in po1030_s_ctrl()
571 return err; in po1030_s_ctrl()
572 err = po1030_set_blue_balance(gspca_dev, sd->blue_bal->val); in po1030_s_ctrl()
575 err = po1030_set_auto_exposure(gspca_dev, ctrl->val); in po1030_s_ctrl()
576 if (err || ctrl->val == V4L2_EXPOSURE_AUTO) in po1030_s_ctrl()
577 return err; in po1030_s_ctrl()
578 err = po1030_set_exposure(gspca_dev, sd->expo->val); in po1030_s_ctrl()
581 err = po1030_set_gain(gspca_dev, ctrl->val); in po1030_s_ctrl()
584 err = po1030_set_hvflip(gspca_dev); in po1030_s_ctrl()
590 return err; in po1030_s_ctrl()