width_flag;
}
-static int mt9v022_set_crop(struct soc_camera_device *icd,
- struct v4l2_rect *rect)
+static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
{
- struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
+ struct v4l2_rect *rect = &a->c;
+ struct i2c_client *client = sd->priv;
+ struct soc_camera_device *icd = client->dev.platform_data;
int ret;
/* Like in example app. Contradicts the datasheet though */
struct mt9v022 *mt9v022 = to_mt9v022(client);
struct soc_camera_device *icd = client->dev.platform_data;
struct v4l2_pix_format *pix = &f->fmt.pix;
- struct v4l2_rect rect = {
- .left = icd->rect_current.left,
- .top = icd->rect_current.top,
- .width = pix->width,
- .height = pix->height,
+ struct v4l2_crop a = {
+ .c = {
+ .left = icd->rect_current.left,
+ .top = icd->rect_current.top,
+ .width = pix->width,
+ .height = pix->height,
+ },
};
/* The caller provides a supported format, as verified per call to
}
/* No support for scaling on this camera, just crop. */
- return mt9v022_set_crop(icd, &rect);
+ return mt9v022_s_crop(sd, &a);
}
static int mt9v022_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
static struct soc_camera_ops mt9v022_ops = {
.init = mt9v022_init,
- .set_crop = mt9v022_set_crop,
.set_bus_param = mt9v022_set_bus_param,
.query_bus_param = mt9v022_query_bus_param,
.controls = mt9v022_controls,
.s_stream = mt9v022_s_stream,
.s_fmt = mt9v022_s_fmt,
.try_fmt = mt9v022_try_fmt,
+ .s_crop = mt9v022_s_crop,
};
static struct v4l2_subdev_ops mt9v022_subdev_ops = {