@@ -971,15 +971,36 @@ static int ov5645_set_format(struct v4l2_subdev *sd,
static int ov5645_init_state(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state)
{
+ struct v4l2_subdev_route routes[1] = {
+ {
+ .sink_pad = OV5645_PAD_IMAGE,
+ .sink_stream = 0,
+ .source_pad = OV5645_PAD_SOURCE,
+ .source_stream = 0,
+ .flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE |
+ V4L2_SUBDEV_ROUTE_FL_IMMUTABLE,
+ },
+ };
+ struct v4l2_subdev_krouting routing = {
+ .len_routes = ARRAY_SIZE(routes),
+ .num_routes = ARRAY_SIZE(routes),
+ .routes = routes,
+ };
struct v4l2_subdev_format fmt = {
.which = V4L2_SUBDEV_FORMAT_TRY,
.pad = OV5645_PAD_SOURCE,
+ .stream = 0,
.format = {
.code = MEDIA_BUS_FMT_UYVY8_1X16,
.width = ov5645_mode_info_data[1].width,
.height = ov5645_mode_info_data[1].height,
},
};
+ int ret;
+
+ ret = v4l2_subdev_set_routing(subdev, sd_state, &routing);
+ if (ret)
+ return ret;
ov5645_set_format(subdev, sd_state, &fmt);
@@ -1206,7 +1227,7 @@ static int ov5645_probe(struct i2c_client *client)
v4l2_i2c_subdev_init(&ov5645->sd, client, &ov5645_subdev_ops);
ov5645->sd.internal_ops = &ov5645_internal_ops;
ov5645->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE |
- V4L2_SUBDEV_FL_HAS_EVENTS;
+ V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_STREAMS;
ov5645->pads[OV5645_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
ov5645->pads[OV5645_PAD_IMAGE].flags = MEDIA_PAD_FL_SINK |
MEDIA_PAD_FL_INTERNAL;