diff options
author | Niklas Söderlund | 2016-04-02 19:42:19 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2016-04-20 21:06:58 +0200 |
commit | 64b3df9223aa4d0e809bbf5a8b006fcc884b7c90 (patch) | |
tree | c6c5603467ad96ed4dd2d1c2709c0b3d393a4e4c /drivers/media/i2c/adv7180.c | |
parent | [media] adv7180: Add g_std operation (diff) | |
download | kernel-qcow2-linux-64b3df9223aa4d0e809bbf5a8b006fcc884b7c90.tar.gz kernel-qcow2-linux-64b3df9223aa4d0e809bbf5a8b006fcc884b7c90.tar.xz kernel-qcow2-linux-64b3df9223aa4d0e809bbf5a8b006fcc884b7c90.zip |
[media] adv7180: Add cropcap operation
Add support to get the pixel aspect ratio depending on the current
standard (50 vs 60 Hz).
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@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/adv7180.c')
-rw-r--r-- | drivers/media/i2c/adv7180.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index d680d7656e2f..80ded7007e55 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -726,6 +726,21 @@ static int adv7180_g_mbus_config(struct v4l2_subdev *sd, return 0; } +static int adv7180_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *cropcap) +{ + struct adv7180_state *state = to_state(sd); + + if (state->curr_norm & V4L2_STD_525_60) { + cropcap->pixelaspect.numerator = 11; + cropcap->pixelaspect.denominator = 10; + } else { + cropcap->pixelaspect.numerator = 54; + cropcap->pixelaspect.denominator = 59; + } + + return 0; +} + static const struct v4l2_subdev_video_ops adv7180_video_ops = { .s_std = adv7180_s_std, .g_std = adv7180_g_std, @@ -733,6 +748,7 @@ static const struct v4l2_subdev_video_ops adv7180_video_ops = { .g_input_status = adv7180_g_input_status, .s_routing = adv7180_s_routing, .g_mbus_config = adv7180_g_mbus_config, + .cropcap = adv7180_cropcap, }; |