]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
media: i2c: ov23850: add g_input_status
authorBhanu Murthy V <bmurthyv@nvidia.com>
Fri, 13 May 2016 23:40:42 +0000 (16:40 -0700)
committerWenjia Zhou <wenjiaz@nvidia.com>
Wed, 27 Jul 2016 22:25:12 +0000 (15:25 -0700)
Add g_input_status video op and return the status
based on the pw->state value.

Bug 200184502

Change-Id: Id5ee756fa4142783aad81ac12d798e42cfb0ff53
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1147841
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
drivers/media/i2c/ov23850.c

index e2cfc491ddef52983865ca28e41b40c514ae795d..408ac46545f3c703faa10331b426181f1d4cfb6b 100644 (file)
@@ -555,9 +555,21 @@ exit:
        return err;
 }
 
+static int ov23850_g_input_status(struct v4l2_subdev *sd, u32 *status)
+{
+       struct i2c_client *client = v4l2_get_subdevdata(sd);
+       struct camera_common_data *s_data = to_camera_common_data(client);
+       struct ov23850 *priv = (struct ov23850 *)s_data->priv;
+       struct camera_common_power_rail *pw = &priv->power;
+
+       *status = pw->state == SWITCH_ON;
+       return 0;
+}
+
 static struct v4l2_subdev_video_ops ov23850_subdev_video_ops = {
        .s_stream       = ov23850_s_stream,
        .g_mbus_config  = camera_common_g_mbus_config,
+       .g_input_status = ov23850_g_input_status,
 };
 
 static struct v4l2_subdev_core_ops ov23850_subdev_core_ops = {