Commit e0ad7a9b authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Mauro Carvalho Chehab

[media] media: adv7180: fill in mbus format in set_fmt

If the V4L2_SUBDEV_FORMAT_TRY is used in set_fmt the width, height etc
would not be filled.
Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 6de690dd
...@@ -711,6 +711,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, ...@@ -711,6 +711,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
{ {
struct adv7180_state *state = to_state(sd); struct adv7180_state *state = to_state(sd);
struct v4l2_mbus_framefmt *framefmt; struct v4l2_mbus_framefmt *framefmt;
int ret;
switch (format->format.field) { switch (format->format.field) {
case V4L2_FIELD_NONE: case V4L2_FIELD_NONE:
...@@ -722,8 +723,9 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, ...@@ -722,8 +723,9 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
break; break;
} }
ret = adv7180_mbus_fmt(sd, &format->format);
if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) { if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
framefmt = &format->format;
if (state->field != format->format.field) { if (state->field != format->format.field) {
state->field = format->format.field; state->field = format->format.field;
adv7180_set_power(state, false); adv7180_set_power(state, false);
...@@ -735,7 +737,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, ...@@ -735,7 +737,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
*framefmt = format->format; *framefmt = format->format;
} }
return adv7180_mbus_fmt(sd, framefmt); return ret;
} }
static int adv7180_g_mbus_config(struct v4l2_subdev *sd, static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
......
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