mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
media: i2c: ds90ub953: Use v4l2_subdev_get_frame_desc_passthrough
Use the new v4l2_subdev_get_frame_desc_passthrough helper for .get_frame_desc. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
a564839e63
commit
3ff6b67e0a
|
|
@ -424,65 +424,6 @@ static int ub953_set_routing(struct v4l2_subdev *sd,
|
|||
return _ub953_set_routing(sd, state, routing);
|
||||
}
|
||||
|
||||
static int ub953_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
|
||||
struct v4l2_mbus_frame_desc *fd)
|
||||
{
|
||||
struct ub953_data *priv = sd_to_ub953(sd);
|
||||
struct v4l2_mbus_frame_desc source_fd;
|
||||
struct v4l2_subdev_route *route;
|
||||
struct v4l2_subdev_state *state;
|
||||
int ret;
|
||||
|
||||
if (pad != UB953_PAD_SOURCE)
|
||||
return -EINVAL;
|
||||
|
||||
ret = v4l2_subdev_call(priv->source_sd, pad, get_frame_desc,
|
||||
priv->source_sd_pad, &source_fd);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
fd->type = V4L2_MBUS_FRAME_DESC_TYPE_CSI2;
|
||||
|
||||
state = v4l2_subdev_lock_and_get_active_state(sd);
|
||||
|
||||
for_each_active_route(&state->routing, route) {
|
||||
struct v4l2_mbus_frame_desc_entry *source_entry = NULL;
|
||||
unsigned int i;
|
||||
|
||||
if (route->source_pad != pad)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < source_fd.num_entries; i++) {
|
||||
if (source_fd.entry[i].stream == route->sink_stream) {
|
||||
source_entry = &source_fd.entry[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!source_entry) {
|
||||
dev_err(&priv->client->dev,
|
||||
"Failed to find stream from source frame desc\n");
|
||||
ret = -EPIPE;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
fd->entry[fd->num_entries].stream = route->source_stream;
|
||||
fd->entry[fd->num_entries].flags = source_entry->flags;
|
||||
fd->entry[fd->num_entries].length = source_entry->length;
|
||||
fd->entry[fd->num_entries].pixelcode = source_entry->pixelcode;
|
||||
fd->entry[fd->num_entries].bus.csi2.vc =
|
||||
source_entry->bus.csi2.vc;
|
||||
fd->entry[fd->num_entries].bus.csi2.dt =
|
||||
source_entry->bus.csi2.dt;
|
||||
|
||||
fd->num_entries++;
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
v4l2_subdev_unlock_state(state);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ub953_set_fmt(struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_state *state,
|
||||
|
|
@ -694,7 +635,7 @@ static const struct v4l2_subdev_pad_ops ub953_pad_ops = {
|
|||
.enable_streams = ub953_enable_streams,
|
||||
.disable_streams = ub953_disable_streams,
|
||||
.set_routing = ub953_set_routing,
|
||||
.get_frame_desc = ub953_get_frame_desc,
|
||||
.get_frame_desc = v4l2_subdev_get_frame_desc_passthrough,
|
||||
.get_fmt = v4l2_subdev_get_fmt,
|
||||
.set_fmt = ub953_set_fmt,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user