0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef __GREYBUS_MANIFEST_H
0015 #define __GREYBUS_MANIFEST_H
0016
0017 #include <linux/bits.h>
0018 #include <linux/types.h>
0019
0020 enum greybus_descriptor_type {
0021 GREYBUS_TYPE_INVALID = 0x00,
0022 GREYBUS_TYPE_INTERFACE = 0x01,
0023 GREYBUS_TYPE_STRING = 0x02,
0024 GREYBUS_TYPE_BUNDLE = 0x03,
0025 GREYBUS_TYPE_CPORT = 0x04,
0026 };
0027
0028 enum greybus_protocol {
0029 GREYBUS_PROTOCOL_CONTROL = 0x00,
0030
0031 GREYBUS_PROTOCOL_GPIO = 0x02,
0032 GREYBUS_PROTOCOL_I2C = 0x03,
0033 GREYBUS_PROTOCOL_UART = 0x04,
0034 GREYBUS_PROTOCOL_HID = 0x05,
0035 GREYBUS_PROTOCOL_USB = 0x06,
0036 GREYBUS_PROTOCOL_SDIO = 0x07,
0037 GREYBUS_PROTOCOL_POWER_SUPPLY = 0x08,
0038 GREYBUS_PROTOCOL_PWM = 0x09,
0039
0040 GREYBUS_PROTOCOL_SPI = 0x0b,
0041 GREYBUS_PROTOCOL_DISPLAY = 0x0c,
0042 GREYBUS_PROTOCOL_CAMERA_MGMT = 0x0d,
0043 GREYBUS_PROTOCOL_SENSOR = 0x0e,
0044 GREYBUS_PROTOCOL_LIGHTS = 0x0f,
0045 GREYBUS_PROTOCOL_VIBRATOR = 0x10,
0046 GREYBUS_PROTOCOL_LOOPBACK = 0x11,
0047 GREYBUS_PROTOCOL_AUDIO_MGMT = 0x12,
0048 GREYBUS_PROTOCOL_AUDIO_DATA = 0x13,
0049 GREYBUS_PROTOCOL_SVC = 0x14,
0050 GREYBUS_PROTOCOL_BOOTROM = 0x15,
0051 GREYBUS_PROTOCOL_CAMERA_DATA = 0x16,
0052 GREYBUS_PROTOCOL_FW_DOWNLOAD = 0x17,
0053 GREYBUS_PROTOCOL_FW_MANAGEMENT = 0x18,
0054 GREYBUS_PROTOCOL_AUTHENTICATION = 0x19,
0055 GREYBUS_PROTOCOL_LOG = 0x1a,
0056
0057 GREYBUS_PROTOCOL_RAW = 0xfe,
0058 GREYBUS_PROTOCOL_VENDOR = 0xff,
0059 };
0060
0061 enum greybus_class_type {
0062 GREYBUS_CLASS_CONTROL = 0x00,
0063
0064
0065
0066
0067 GREYBUS_CLASS_HID = 0x05,
0068
0069
0070 GREYBUS_CLASS_POWER_SUPPLY = 0x08,
0071
0072 GREYBUS_CLASS_BRIDGED_PHY = 0x0a,
0073
0074 GREYBUS_CLASS_DISPLAY = 0x0c,
0075 GREYBUS_CLASS_CAMERA = 0x0d,
0076 GREYBUS_CLASS_SENSOR = 0x0e,
0077 GREYBUS_CLASS_LIGHTS = 0x0f,
0078 GREYBUS_CLASS_VIBRATOR = 0x10,
0079 GREYBUS_CLASS_LOOPBACK = 0x11,
0080 GREYBUS_CLASS_AUDIO = 0x12,
0081
0082
0083 GREYBUS_CLASS_BOOTROM = 0x15,
0084 GREYBUS_CLASS_FW_MANAGEMENT = 0x16,
0085 GREYBUS_CLASS_LOG = 0x17,
0086
0087 GREYBUS_CLASS_RAW = 0xfe,
0088 GREYBUS_CLASS_VENDOR = 0xff,
0089 };
0090
0091 enum {
0092 GREYBUS_INTERFACE_FEATURE_TIMESYNC = BIT(0),
0093 };
0094
0095
0096
0097
0098
0099
0100 struct greybus_descriptor_string {
0101 __u8 length;
0102 __u8 id;
0103 __u8 string[];
0104 } __packed;
0105
0106
0107
0108
0109
0110 struct greybus_descriptor_interface {
0111 __u8 vendor_stringid;
0112 __u8 product_stringid;
0113 __u8 features;
0114 __u8 pad;
0115 } __packed;
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136 struct greybus_descriptor_bundle {
0137 __u8 id;
0138 __u8 class;
0139 __u8 pad[2];
0140 } __packed;
0141
0142
0143
0144
0145
0146
0147
0148 struct greybus_descriptor_cport {
0149 __le16 id;
0150 __u8 bundle;
0151 __u8 protocol_id;
0152 } __packed;
0153
0154 struct greybus_descriptor_header {
0155 __le16 size;
0156 __u8 type;
0157 __u8 pad;
0158 } __packed;
0159
0160 struct greybus_descriptor {
0161 struct greybus_descriptor_header header;
0162 union {
0163 struct greybus_descriptor_string string;
0164 struct greybus_descriptor_interface interface;
0165 struct greybus_descriptor_bundle bundle;
0166 struct greybus_descriptor_cport cport;
0167 };
0168 } __packed;
0169
0170 struct greybus_manifest_header {
0171 __le16 size;
0172 __u8 version_major;
0173 __u8 version_minor;
0174 } __packed;
0175
0176 struct greybus_manifest {
0177 struct greybus_manifest_header header;
0178 struct greybus_descriptor descriptors[];
0179 } __packed;
0180
0181 #endif