aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 7967a651c4db..fc4548fd441d 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -345,7 +345,6 @@ int ov9650_init(struct sd *sd)
345 return err; 345 return err;
346 346
347 err = ov9650_set_auto_gain(&sd->gspca_dev, sensor_settings[AUTO_GAIN_CTRL_IDX]); 347 err = ov9650_set_auto_gain(&sd->gspca_dev, sensor_settings[AUTO_GAIN_CTRL_IDX]);
348
349 return err; 348 return err;
350} 349}
351 350
@@ -367,9 +366,6 @@ int ov9650_start(struct sd *sd)
367 if (width <= 320) 366 if (width <= 320)
368 hor_offs /= 2; 367 hor_offs /= 2;
369 368
370 if (err < 0)
371 return err;
372
373 /* Synthesize the vsync/hsync setup */ 369 /* Synthesize the vsync/hsync setup */
374 for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) { 370 for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) {
375 if (res_init_ov9650[i][0] == BRIDGE) 371 if (res_init_ov9650[i][0] == BRIDGE)
@@ -435,9 +431,7 @@ int ov9650_start(struct sd *sd)
435 431
436 data = OV9650_VGA_SELECT | OV9650_RGB_SELECT | 432 data = OV9650_VGA_SELECT | OV9650_RGB_SELECT |
437 OV9650_RAW_RGB_SELECT; 433 OV9650_RAW_RGB_SELECT;
438
439 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); 434 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
440
441 break; 435 break;
442 436
443 case 352: 437 case 352:
@@ -445,9 +439,7 @@ int ov9650_start(struct sd *sd)
445 439
446 data = OV9650_CIF_SELECT | OV9650_RGB_SELECT | 440 data = OV9650_CIF_SELECT | OV9650_RGB_SELECT |
447 OV9650_RAW_RGB_SELECT; 441 OV9650_RAW_RGB_SELECT;
448
449 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); 442 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
450
451 break; 443 break;
452 444
453 case 320: 445 case 320:
@@ -455,9 +447,7 @@ int ov9650_start(struct sd *sd)
455 447
456 data = OV9650_QVGA_SELECT | OV9650_RGB_SELECT | 448 data = OV9650_QVGA_SELECT | OV9650_RGB_SELECT |
457 OV9650_RAW_RGB_SELECT; 449 OV9650_RAW_RGB_SELECT;
458
459 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); 450 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
460
461 break; 451 break;
462 452
463 case 176: 453 case 176:
@@ -465,7 +455,6 @@ int ov9650_start(struct sd *sd)
465 455
466 data = OV9650_QCIF_SELECT | OV9650_RGB_SELECT | 456 data = OV9650_QCIF_SELECT | OV9650_RGB_SELECT |
467 OV9650_RAW_RGB_SELECT; 457 OV9650_RAW_RGB_SELECT;
468
469 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); 458 err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
470 break; 459 break;
471 } 460 }
@@ -500,7 +489,6 @@ void ov9650_disconnect(struct sd *sd)
500 ov9650_power_down(sd); 489 ov9650_power_down(sd);
501 490
502 sd->sensor = NULL; 491 sd->sensor = NULL;
503
504 kfree(sd->sensor_priv); 492 kfree(sd->sensor_priv);
505} 493}
506 494
@@ -524,7 +512,6 @@ int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
524 PDEBUG(D_V4L2, "Set exposure to %d", val); 512 PDEBUG(D_V4L2, "Set exposure to %d", val);
525 513
526 sensor_settings[EXPOSURE_IDX] = val; 514 sensor_settings[EXPOSURE_IDX] = val;
527
528 /* The 6 MSBs */ 515 /* The 6 MSBs */
529 i2c_data = (val >> 10) & 0x3f; 516 i2c_data = (val >> 10) & 0x3f;
530 err = m5602_write_sensor(sd, OV9650_AECHM, 517 err = m5602_write_sensor(sd, OV9650_AECHM,
@@ -542,7 +529,6 @@ int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
542 /* The 2 LSBs */ 529 /* The 2 LSBs */
543 i2c_data = val & 0x03; 530 i2c_data = val & 0x03;
544 err = m5602_write_sensor(sd, OV9650_COM1, &i2c_data, 1); 531 err = m5602_write_sensor(sd, OV9650_COM1, &i2c_data, 1);
545
546 return err; 532 return err;
547} 533}
548 534
@@ -610,7 +596,6 @@ int ov9650_set_red_balance(struct gspca_dev *gspca_dev, __s32 val)
610 596
611 i2c_data = val & 0xff; 597 i2c_data = val & 0xff;
612 err = m5602_write_sensor(sd, OV9650_RED, &i2c_data, 1); 598 err = m5602_write_sensor(sd, OV9650_RED, &i2c_data, 1);
613
614 return err; 599 return err;
615} 600}
616 601
@@ -638,7 +623,6 @@ int ov9650_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val)
638 623
639 i2c_data = val & 0xff; 624 i2c_data = val & 0xff;
640 err = m5602_write_sensor(sd, OV9650_BLUE, &i2c_data, 1); 625 err = m5602_write_sensor(sd, OV9650_BLUE, &i2c_data, 1);
641
642 return err; 626 return err;
643} 627}
644 628
@@ -646,9 +630,9 @@ int ov9650_get_hflip(struct gspca_dev *gspca_dev, __s32 *val)
646{ 630{
647 struct sd *sd = (struct sd *) gspca_dev; 631 struct sd *sd = (struct sd *) gspca_dev;
648 s32 *sensor_settings = sd->sensor_priv; 632 s32 *sensor_settings = sd->sensor_priv;
633
649 *val = sensor_settings[HFLIP_IDX]; 634 *val = sensor_settings[HFLIP_IDX];
650 PDEBUG(D_V4L2, "Read horizontal flip %d", *val); 635 PDEBUG(D_V4L2, "Read horizontal flip %d", *val);
651
652 return 0; 636 return 0;
653} 637}
654 638