]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
greybus: camera: HACK: Export GB camera interface
authorGjorgji Rosikopulos <grosikopulos@mm-sol.com>
Wed, 13 Jan 2016 19:52:37 +0000 (21:52 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 13 Jan 2016 23:29:59 +0000 (15:29 -0800)
Gb camera need to communicate with HOST driver.
as temporary solution there will be shared header
between gb camera HOST camera.
Both need to be in sync since gb drivers are compiled
out of the kernel tree.

Gb camera register camera operation functions when is created.
Currently unregister is not supported.

Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Acked-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/gb-camera.h [new file with mode: 0644]

diff --git a/drivers/staging/greybus/gb-camera.h b/drivers/staging/greybus/gb-camera.h
new file mode 100644 (file)
index 0000000..a182474
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Greybus Camera protocol driver.
+ *
+ * Copyright 2015 Google Inc.
+ *
+ * Released under the GPLv2 only.
+ */
+#ifndef __GB_CAMERA_H
+#define __GB_CAMERA_H
+
+#include <linux/v4l2-mediabus.h>
+
+struct gb_camera_stream {
+       unsigned int width;
+       unsigned int height;
+       enum v4l2_mbus_pixelcode pixel_code;
+       unsigned int vc;
+       unsigned int dt[2];
+       unsigned int max_size;
+};
+
+struct gb_camera_ops {
+       ssize_t (*capabilities)(void *priv, char *buf, size_t len);
+       int (*configure_streams)(void *priv, unsigned int nstreams,
+                               struct gb_camera_stream *streams);
+       int (*capture)(void *priv, u32 request_id,
+                       unsigned int streams, unsigned int num_frames,
+                       size_t settings_size, const void *settings);
+       int (*flush)(void *priv, u32 *request_id);
+};
+
+#define gb_camera_call(f, p, op, args...)             \
+       (((f)->op) ? (f)->op(p, ##args) : -ENOIOCTLCMD)
+
+int gb_camera_register(struct gb_camera_ops *ops, void *priv);
+
+#endif /* __GB_CAMERA_H */