diff mbox

[1/3,media] adv7180: Add g_std operation

Message ID 1459618940-8170-2-git-send-email-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Niklas Söderlund April 2, 2016, 5:42 p.m. UTC
Add support to get the standard to the adv7180 driver.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/i2c/adv7180.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Hans Verkuil April 3, 2016, 5:50 p.m. UTC | #1
On 04/02/2016 10:42 AM, Niklas Söderlund wrote:
> Add support to get the standard to the adv7180 driver.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Thanks!

	Hans

> ---
>   drivers/media/i2c/adv7180.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> index ff57c1d..d680d76 100644
> --- a/drivers/media/i2c/adv7180.c
> +++ b/drivers/media/i2c/adv7180.c
> @@ -434,6 +434,15 @@ out:
>   	return ret;
>   }
>
> +static int adv7180_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm)
> +{
> +	struct adv7180_state *state = to_state(sd);
> +
> +	*norm = state->curr_norm;
> +
> +	return 0;
> +}
> +
>   static int adv7180_set_power(struct adv7180_state *state, bool on)
>   {
>   	u8 val;
> @@ -719,6 +728,7 @@ static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
>
>   static const struct v4l2_subdev_video_ops adv7180_video_ops = {
>   	.s_std = adv7180_s_std,
> +	.g_std = adv7180_g_std,
>   	.querystd = adv7180_querystd,
>   	.g_input_status = adv7180_g_input_status,
>   	.s_routing = adv7180_s_routing,
>
diff mbox

Patch

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index ff57c1d..d680d76 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -434,6 +434,15 @@  out:
 	return ret;
 }
 
+static int adv7180_g_std(struct v4l2_subdev *sd, v4l2_std_id *norm)
+{
+	struct adv7180_state *state = to_state(sd);
+
+	*norm = state->curr_norm;
+
+	return 0;
+}
+
 static int adv7180_set_power(struct adv7180_state *state, bool on)
 {
 	u8 val;
@@ -719,6 +728,7 @@  static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
 
 static const struct v4l2_subdev_video_ops adv7180_video_ops = {
 	.s_std = adv7180_s_std,
+	.g_std = adv7180_g_std,
 	.querystd = adv7180_querystd,
 	.g_input_status = adv7180_g_input_status,
 	.s_routing = adv7180_s_routing,