greybus: camera: Register capabilities operation
authorJacopo Mondi <jacopo.mondi@linaro.org>
Thu, 17 Mar 2016 10:02:03 +0000 (11:02 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 17 Mar 2016 17:18:54 +0000 (10:18 -0700)
Register the greybus camera driver capabilities operation to the
ara_camera subdevice

Signed-off-by: Jacopo Mondi <jacopo.mondi@linaro.org>
Reviewed-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/camera.c

index 6042c681b8b6632b5f13bc4324146b921a242f00..e862659a5ccc05c54f3db857dd6b5e91b9d7e806 100644 (file)
@@ -421,6 +421,19 @@ static enum v4l2_mbus_pixelcode gb_camera_gb_to_mbus(u16 gb_fmt)
        return mbus_to_gbus_format[0].mbus_code;
 }
 
+static ssize_t gb_camera_op_capabilities(void *priv, char *data, size_t len)
+{
+       struct gb_camera *gcam = priv;
+       size_t capabilities_len = len;
+       int ret;
+
+       ret = gb_camera_capabilities(gcam, data, &capabilities_len);
+       if (ret)
+               return ret;
+
+       return capabilities_len;
+}
+
 static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams,
                unsigned int *flags, struct gb_camera_stream *streams)
 {
@@ -492,6 +505,7 @@ static int gb_camera_op_flush(void *priv, u32 *request_id)
 }
 
 struct gb_camera_ops gb_cam_ops = {
+       .capabilities = gb_camera_op_capabilities,
        .configure_streams = gb_camera_op_configure_streams,
        .capture = gb_camera_op_capture,
        .flush = gb_camera_op_flush,