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

media: adv7180: fix field type to V4L2_FIELD_ALTERNATE

The ADV7180 and ADV7182 transmit whole fields, bottom field followed
by top (or vice-versa, depending on detected video standard). So
for chips that do not have support for explicitly setting the field
mode via I2P, set the field mode to V4L2_FIELD_ALTERNATE.

I2P converts fields into frames using an edge adaptive algorithm. The
frame rate is the same as the 'field rate': e.g. X fields per second
are now X frames per second.
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+samsung@kernel.org>
parent ddc5c1f7
...@@ -644,6 +644,9 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd, ...@@ -644,6 +644,9 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
fmt->width = 720; fmt->width = 720;
fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576; fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;
if (state->field == V4L2_FIELD_ALTERNATE)
fmt->height /= 2;
return 0; return 0;
} }
...@@ -711,11 +714,11 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, ...@@ -711,11 +714,11 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
switch (format->format.field) { switch (format->format.field) {
case V4L2_FIELD_NONE: case V4L2_FIELD_NONE:
if (!(state->chip_info->flags & ADV7180_FLAG_I2P)) if (state->chip_info->flags & ADV7180_FLAG_I2P)
format->format.field = V4L2_FIELD_INTERLACED;
break; break;
/* fall through */
default: default:
format->format.field = V4L2_FIELD_INTERLACED; format->format.field = V4L2_FIELD_ALTERNATE;
break; break;
} }
...@@ -1291,7 +1294,7 @@ static int adv7180_probe(struct i2c_client *client, ...@@ -1291,7 +1294,7 @@ static int adv7180_probe(struct i2c_client *client,
return -ENOMEM; return -ENOMEM;
state->client = client; state->client = client;
state->field = V4L2_FIELD_INTERLACED; state->field = V4L2_FIELD_ALTERNATE;
state->chip_info = (struct adv7180_chip_info *)id->driver_data; state->chip_info = (struct adv7180_chip_info *)id->driver_data;
state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown", state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
......
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