diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-12-15 03:18:05 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-14 18:12:30 -0800 |
commit | e61a2a7114bc9d87d4db2994bbe49a28f8331a3a (patch) | |
tree | e8fb0525a6468be19748a1c8f6a8167b9c9532c8 /drivers | |
parent | 8e3fba55d379bb67732c878988cf9859bfea2812 (diff) |
greybus: Add camera protocol definition
Define the camera data protocol ID and all the protocol operations data
structures.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/greybus/greybus_manifest.h | 3 | ||||
-rw-r--r-- | drivers/staging/greybus/greybus_protocols.h | 71 |
2 files changed, 73 insertions, 1 deletions
diff --git a/drivers/staging/greybus/greybus_manifest.h b/drivers/staging/greybus/greybus_manifest.h index 947b71c88134..32602b1951b8 100644 --- a/drivers/staging/greybus/greybus_manifest.h +++ b/drivers/staging/greybus/greybus_manifest.h @@ -35,7 +35,7 @@ enum greybus_protocol { /* 0x0a is unused */ GREYBUS_PROTOCOL_SPI = 0x0b, GREYBUS_PROTOCOL_DISPLAY = 0x0c, - GREYBUS_PROTOCOL_CAMERA = 0x0d, + GREYBUS_PROTOCOL_CAMERA_MGMT = 0x0d, GREYBUS_PROTOCOL_SENSOR = 0x0e, GREYBUS_PROTOCOL_LIGHTS = 0x0f, GREYBUS_PROTOCOL_VIBRATOR = 0x10, @@ -44,6 +44,7 @@ enum greybus_protocol { GREYBUS_PROTOCOL_AUDIO_DATA = 0x13, GREYBUS_PROTOCOL_SVC = 0x14, GREYBUS_PROTOCOL_FIRMWARE = 0x15, + GREYBUS_PROTOCOL_CAMERA_DATA = 0x16, /* ... */ GREYBUS_PROTOCOL_RAW = 0xfe, GREYBUS_PROTOCOL_VENDOR = 0xff, diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index d3f957f8afcf..f024acdc0c43 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -1100,6 +1100,77 @@ struct gb_sdio_event_request { #define GB_SDIO_WP 0x04 } __packed; +/* Camera */ + +#define GB_CAMERA_VERSION_MAJOR 0x00 +#define GB_CAMERA_VERSION_MINOR 0x01 + +/* Greybus Camera request types */ +#define GB_CAMERA_TYPE_CAPABILITIES 0x02 +#define GB_CAMERA_TYPE_CONFIGURE_STREAMS 0x03 +#define GB_CAMERA_TYPE_CAPTURE 0x04 +#define GB_CAMERA_TYPE_FLUSH 0x05 +#define GB_CAMERA_TYPE_METADATA 0x06 + +#define GB_CAMERA_MAX_STREAMS 4 +#define GB_CAMERA_MAX_SETTINGS_SIZE 8192 + +/* Greybus Camera Configure Streams request payload */ +struct gb_camera_stream_config_request { + __le16 width; + __le16 height; + __le16 format; + __le16 padding; +} __packed; + +struct gb_camera_configure_streams_request { + __le16 num_streams; + __le16 padding; + struct gb_camera_stream_config_request config[0]; +} __packed; + +/* Greybus Camera Configure Streams response payload */ +struct gb_camera_stream_config_response { + __le16 width; + __le16 height; + __le16 format; + __u8 virtual_channel; + __u8 data_type[2]; + __u8 padding[3]; + __le32 max_size; +} __packed; + +struct gb_camera_configure_streams_response { + __le16 num_streams; +#define GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED 0x01 + u8 flags; + u8 padding; + struct gb_camera_stream_config_response config[0]; +} __packed; + +/* Greybus Camera Capture request payload - response has no payload */ +struct gb_camera_capture_request { + __le32 request_id; + u8 streams; + u8 padding; + __le16 num_frames; + u8 settings[0]; +} __packed; + +/* Greybus Camera Flush response payload - request has no payload */ +struct gb_camera_flush_response { + __le32 request_id; +} __packed; + +/* Greybus Camera Metadata request payload - operation has no response */ +struct gb_camera_metadata_request { + __le32 request_id; + __le16 frame_number; + __u8 stream; + __u8 padding; + u8 metadata[0]; +} __packed; + /* Lights */ #define GB_LIGHTS_VERSION_MAJOR 0x00 |