Commit 3c19a954 authored by Erik Andr?n's avatar Erik Andr?n Committed by Mauro Carvalho Chehab

V4L/DVB (11427): gspca - m5602: Minor cleanups

Remove an unnecessary error check and reorder some code.
Signed-off-by: default avatarErik Andr?n <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5196d7c6
...@@ -345,7 +345,6 @@ int ov9650_init(struct sd *sd) ...@@ -345,7 +345,6 @@ int ov9650_init(struct sd *sd)
return err; return err;
err = ov9650_set_auto_gain(&sd->gspca_dev, sensor_settings[AUTO_GAIN_CTRL_IDX]); err = ov9650_set_auto_gain(&sd->gspca_dev, sensor_settings[AUTO_GAIN_CTRL_IDX]);
return err; return err;
} }
...@@ -367,9 +366,6 @@ int ov9650_start(struct sd *sd) ...@@ -367,9 +366,6 @@ int ov9650_start(struct sd *sd)
if (width <= 320) if (width <= 320)
hor_offs /= 2; hor_offs /= 2;
if (err < 0)
return err;
/* Synthesize the vsync/hsync setup */ /* Synthesize the vsync/hsync setup */
for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) { for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) {
if (res_init_ov9650[i][0] == BRIDGE) if (res_init_ov9650[i][0] == BRIDGE)
...@@ -435,9 +431,7 @@ int ov9650_start(struct sd *sd) ...@@ -435,9 +431,7 @@ int ov9650_start(struct sd *sd)
data = OV9650_VGA_SELECT | OV9650_RGB_SELECT | data = OV9650_VGA_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT; OV9650_RAW_RGB_SELECT;
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
break; break;
case 352: case 352:
...@@ -445,9 +439,7 @@ int ov9650_start(struct sd *sd) ...@@ -445,9 +439,7 @@ int ov9650_start(struct sd *sd)
data = OV9650_CIF_SELECT | OV9650_RGB_SELECT | data = OV9650_CIF_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT; OV9650_RAW_RGB_SELECT;
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
break; break;
case 320: case 320:
...@@ -455,9 +447,7 @@ int ov9650_start(struct sd *sd) ...@@ -455,9 +447,7 @@ int ov9650_start(struct sd *sd)
data = OV9650_QVGA_SELECT | OV9650_RGB_SELECT | data = OV9650_QVGA_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT; OV9650_RAW_RGB_SELECT;
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
break; break;
case 176: case 176:
...@@ -465,7 +455,6 @@ int ov9650_start(struct sd *sd) ...@@ -465,7 +455,6 @@ int ov9650_start(struct sd *sd)
data = OV9650_QCIF_SELECT | OV9650_RGB_SELECT | data = OV9650_QCIF_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT; OV9650_RAW_RGB_SELECT;
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1); err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
break; break;
} }
...@@ -500,7 +489,6 @@ void ov9650_disconnect(struct sd *sd) ...@@ -500,7 +489,6 @@ void ov9650_disconnect(struct sd *sd)
ov9650_power_down(sd); ov9650_power_down(sd);
sd->sensor = NULL; sd->sensor = NULL;
kfree(sd->sensor_priv); kfree(sd->sensor_priv);
} }
...@@ -524,7 +512,6 @@ int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val) ...@@ -524,7 +512,6 @@ int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
PDEBUG(D_V4L2, "Set exposure to %d", val); PDEBUG(D_V4L2, "Set exposure to %d", val);
sensor_settings[EXPOSURE_IDX] = val; sensor_settings[EXPOSURE_IDX] = val;
/* The 6 MSBs */ /* The 6 MSBs */
i2c_data = (val >> 10) & 0x3f; i2c_data = (val >> 10) & 0x3f;
err = m5602_write_sensor(sd, OV9650_AECHM, err = m5602_write_sensor(sd, OV9650_AECHM,
...@@ -542,7 +529,6 @@ int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val) ...@@ -542,7 +529,6 @@ int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
/* The 2 LSBs */ /* The 2 LSBs */
i2c_data = val & 0x03; i2c_data = val & 0x03;
err = m5602_write_sensor(sd, OV9650_COM1, &i2c_data, 1); err = m5602_write_sensor(sd, OV9650_COM1, &i2c_data, 1);
return err; return err;
} }
...@@ -610,7 +596,6 @@ int ov9650_set_red_balance(struct gspca_dev *gspca_dev, __s32 val) ...@@ -610,7 +596,6 @@ int ov9650_set_red_balance(struct gspca_dev *gspca_dev, __s32 val)
i2c_data = val & 0xff; i2c_data = val & 0xff;
err = m5602_write_sensor(sd, OV9650_RED, &i2c_data, 1); err = m5602_write_sensor(sd, OV9650_RED, &i2c_data, 1);
return err; return err;
} }
...@@ -638,7 +623,6 @@ int ov9650_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val) ...@@ -638,7 +623,6 @@ int ov9650_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val)
i2c_data = val & 0xff; i2c_data = val & 0xff;
err = m5602_write_sensor(sd, OV9650_BLUE, &i2c_data, 1); err = m5602_write_sensor(sd, OV9650_BLUE, &i2c_data, 1);
return err; return err;
} }
...@@ -646,9 +630,9 @@ int ov9650_get_hflip(struct gspca_dev *gspca_dev, __s32 *val) ...@@ -646,9 +630,9 @@ int ov9650_get_hflip(struct gspca_dev *gspca_dev, __s32 *val)
{ {
struct sd *sd = (struct sd *) gspca_dev; struct sd *sd = (struct sd *) gspca_dev;
s32 *sensor_settings = sd->sensor_priv; s32 *sensor_settings = sd->sensor_priv;
*val = sensor_settings[HFLIP_IDX]; *val = sensor_settings[HFLIP_IDX];
PDEBUG(D_V4L2, "Read horizontal flip %d", *val); PDEBUG(D_V4L2, "Read horizontal flip %d", *val);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment