2 * Greybus Camera protocol driver.
4 * Copyright 2015 Google Inc.
6 * Released under the GPLv2 only.
11 #include <linux/v4l2-mediabus.h>
13 /* Input flags need to be set from the caller */
14 #define GB_CAMERA_IN_FLAG_TEST (1 << 0)
15 /* Output flags returned */
16 #define GB_CAMERA_OUT_FLAG_ADJUSTED (1 << 0)
18 struct gb_camera_stream {
21 enum v4l2_mbus_pixelcode pixel_code;
24 unsigned int max_size;
27 struct gb_camera_ops {
28 ssize_t (*capabilities)(void *priv, char *buf, size_t len);
29 int (*configure_streams)(void *priv, unsigned int *nstreams,
30 unsigned int *flags, struct gb_camera_stream *streams);
31 int (*capture)(void *priv, u32 request_id,
32 unsigned int streams, unsigned int num_frames,
33 size_t settings_size, const void *settings);
34 int (*flush)(void *priv, u32 *request_id);
37 #define gb_camera_call(f, p, op, args...) \
38 (((f)->op) ? (f)->op(p, ##args) : -ENOIOCTLCMD)
40 int gb_camera_register(struct gb_camera_ops *ops, void *priv);
42 #endif /* __GB_CAMERA_H */