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

media: adv7180: add g_frame_interval support

Implement g_frame_interval to return the current standard's frame
interval.
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 6457b626
...@@ -461,6 +461,22 @@ static int adv7180_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm) ...@@ -461,6 +461,22 @@ static int adv7180_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm)
return 0; return 0;
} }
static int adv7180_g_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_interval *fi)
{
struct adv7180_state *state = to_state(sd);
if (state->curr_norm & V4L2_STD_525_60) {
fi->interval.numerator = 1001;
fi->interval.denominator = 30000;
} else {
fi->interval.numerator = 1;
fi->interval.denominator = 25;
}
return 0;
}
static void adv7180_set_power_pin(struct adv7180_state *state, bool on) static void adv7180_set_power_pin(struct adv7180_state *state, bool on)
{ {
if (!state->pwdn_gpio) if (!state->pwdn_gpio)
...@@ -820,6 +836,7 @@ static int adv7180_subscribe_event(struct v4l2_subdev *sd, ...@@ -820,6 +836,7 @@ static int adv7180_subscribe_event(struct v4l2_subdev *sd,
static const struct v4l2_subdev_video_ops adv7180_video_ops = { static const struct v4l2_subdev_video_ops adv7180_video_ops = {
.s_std = adv7180_s_std, .s_std = adv7180_s_std,
.g_std = adv7180_g_std, .g_std = adv7180_g_std,
.g_frame_interval = adv7180_g_frame_interval,
.querystd = adv7180_querystd, .querystd = adv7180_querystd,
.g_input_status = adv7180_g_input_status, .g_input_status = adv7180_g_input_status,
.s_routing = adv7180_s_routing, .s_routing = adv7180_s_routing,
......
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