diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2018-07-26 13:27:16 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-07-27 15:04:04 +0300 |
commit | 38566d28ea9114f9019e7f9804d6db5cd98bf6dd (patch) | |
tree | 6b996ceb7d32ca11a4538406a85513244dedf0fd /drivers/media/i2c | |
parent | 6457b6263f0f11a9bff4e03a0141820ae9c81460 (diff) | |
download | linux-38566d28ea9114f9019e7f9804d6db5cd98bf6dd.tar.xz |
media: adv7180: add g_frame_interval support
Implement g_frame_interval to return the current standard's frame
interval.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/adv7180.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 5a2751a688b8..de10367d550b 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -461,6 +461,22 @@ static int adv7180_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm) 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) { if (!state->pwdn_gpio) @@ -820,6 +836,7 @@ static int adv7180_subscribe_event(struct v4l2_subdev *sd, static const struct v4l2_subdev_video_ops adv7180_video_ops = { .s_std = adv7180_s_std, .g_std = adv7180_g_std, + .g_frame_interval = adv7180_g_frame_interval, .querystd = adv7180_querystd, .g_input_status = adv7180_g_input_status, .s_routing = adv7180_s_routing, |