return err;
err = ov9650_set_auto_gain(&sd->gspca_dev, sensor_settings[AUTO_GAIN_CTRL_IDX]);
-
return err;
}
if (width <= 320)
hor_offs /= 2;
- if (err < 0)
- return err;
-
/* Synthesize the vsync/hsync setup */
for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) {
if (res_init_ov9650[i][0] == BRIDGE)
data = OV9650_VGA_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT;
-
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
-
break;
case 352:
data = OV9650_CIF_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT;
-
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
-
break;
case 320:
data = OV9650_QVGA_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT;
-
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
-
break;
case 176:
data = OV9650_QCIF_SELECT | OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT;
-
err = m5602_write_sensor(sd, OV9650_COM7, &data, 1);
break;
}
ov9650_power_down(sd);
sd->sensor = NULL;
-
kfree(sd->sensor_priv);
}
PDEBUG(D_V4L2, "Set exposure to %d", val);
sensor_settings[EXPOSURE_IDX] = val;
-
/* The 6 MSBs */
i2c_data = (val >> 10) & 0x3f;
err = m5602_write_sensor(sd, OV9650_AECHM,
/* The 2 LSBs */
i2c_data = val & 0x03;
err = m5602_write_sensor(sd, OV9650_COM1, &i2c_data, 1);
-
return err;
}
i2c_data = val & 0xff;
err = m5602_write_sensor(sd, OV9650_RED, &i2c_data, 1);
-
return err;
}
i2c_data = val & 0xff;
err = m5602_write_sensor(sd, OV9650_BLUE, &i2c_data, 1);
-
return err;
}
{
struct sd *sd = (struct sd *) gspca_dev;
s32 *sensor_settings = sd->sensor_priv;
+
*val = sensor_settings[HFLIP_IDX];
PDEBUG(D_V4L2, "Read horizontal flip %d", *val);
-
return 0;
}