1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef __GREYBUS_MANIFEST_H
15 #define __GREYBUS_MANIFEST_H
16
17 #include <linux/bits.h>
18 #include <linux/types.h>
19
20 enum greybus_descriptor_type {
21 GREYBUS_TYPE_INVALID = 0x00,
22 GREYBUS_TYPE_INTERFACE = 0x01,
23 GREYBUS_TYPE_STRING = 0x02,
24 GREYBUS_TYPE_BUNDLE = 0x03,
25 GREYBUS_TYPE_CPORT = 0x04,
26 };
27
28 enum greybus_protocol {
29 GREYBUS_PROTOCOL_CONTROL = 0x00,
30
31 GREYBUS_PROTOCOL_GPIO = 0x02,
32 GREYBUS_PROTOCOL_I2C = 0x03,
33 GREYBUS_PROTOCOL_UART = 0x04,
34 GREYBUS_PROTOCOL_HID = 0x05,
35 GREYBUS_PROTOCOL_USB = 0x06,
36 GREYBUS_PROTOCOL_SDIO = 0x07,
37 GREYBUS_PROTOCOL_POWER_SUPPLY = 0x08,
38 GREYBUS_PROTOCOL_PWM = 0x09,
39
40 GREYBUS_PROTOCOL_SPI = 0x0b,
41 GREYBUS_PROTOCOL_DISPLAY = 0x0c,
42 GREYBUS_PROTOCOL_CAMERA_MGMT = 0x0d,
43 GREYBUS_PROTOCOL_SENSOR = 0x0e,
44 GREYBUS_PROTOCOL_LIGHTS = 0x0f,
45 GREYBUS_PROTOCOL_VIBRATOR = 0x10,
46 GREYBUS_PROTOCOL_LOOPBACK = 0x11,
47 GREYBUS_PROTOCOL_AUDIO_MGMT = 0x12,
48 GREYBUS_PROTOCOL_AUDIO_DATA = 0x13,
49 GREYBUS_PROTOCOL_SVC = 0x14,
50 GREYBUS_PROTOCOL_BOOTROM = 0x15,
51 GREYBUS_PROTOCOL_CAMERA_DATA = 0x16,
52 GREYBUS_PROTOCOL_FW_DOWNLOAD = 0x17,
53 GREYBUS_PROTOCOL_FW_MANAGEMENT = 0x18,
54 GREYBUS_PROTOCOL_AUTHENTICATION = 0x19,
55 GREYBUS_PROTOCOL_LOG = 0x1a,
56
57 GREYBUS_PROTOCOL_RAW = 0xfe,
58 GREYBUS_PROTOCOL_VENDOR = 0xff,
59 };
60
61 enum greybus_class_type {
62 GREYBUS_CLASS_CONTROL = 0x00,
63
64
65
66
67 GREYBUS_CLASS_HID = 0x05,
68
69
70 GREYBUS_CLASS_POWER_SUPPLY = 0x08,
71
72 GREYBUS_CLASS_BRIDGED_PHY = 0x0a,
73
74 GREYBUS_CLASS_DISPLAY = 0x0c,
75 GREYBUS_CLASS_CAMERA = 0x0d,
76 GREYBUS_CLASS_SENSOR = 0x0e,
77 GREYBUS_CLASS_LIGHTS = 0x0f,
78 GREYBUS_CLASS_VIBRATOR = 0x10,
79 GREYBUS_CLASS_LOOPBACK = 0x11,
80 GREYBUS_CLASS_AUDIO = 0x12,
81
82
83 GREYBUS_CLASS_BOOTROM = 0x15,
84 GREYBUS_CLASS_FW_MANAGEMENT = 0x16,
85 GREYBUS_CLASS_LOG = 0x17,
86
87 GREYBUS_CLASS_RAW = 0xfe,
88 GREYBUS_CLASS_VENDOR = 0xff,
89 };
90
91 enum {
92 GREYBUS_INTERFACE_FEATURE_TIMESYNC = BIT(0),
93 };
94
95
96
97
98
99
100 struct greybus_descriptor_string {
101 __u8 length;
102 __u8 id;
103 __u8 string[0];
104 } __packed;
105
106
107
108
109
110 struct greybus_descriptor_interface {
111 __u8 vendor_stringid;
112 __u8 product_stringid;
113 __u8 features;
114 __u8 pad;
115 } __packed;
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136 struct greybus_descriptor_bundle {
137 __u8 id;
138 __u8 class;
139 __u8 pad[2];
140 } __packed;
141
142
143
144
145
146
147
148 struct greybus_descriptor_cport {
149 __le16 id;
150 __u8 bundle;
151 __u8 protocol_id;
152 } __packed;
153
154 struct greybus_descriptor_header {
155 __le16 size;
156 __u8 type;
157 __u8 pad;
158 } __packed;
159
160 struct greybus_descriptor {
161 struct greybus_descriptor_header header;
162 union {
163 struct greybus_descriptor_string string;
164 struct greybus_descriptor_interface interface;
165 struct greybus_descriptor_bundle bundle;
166 struct greybus_descriptor_cport cport;
167 };
168 } __packed;
169
170 struct greybus_manifest_header {
171 __le16 size;
172 __u8 version_major;
173 __u8 version_minor;
174 } __packed;
175
176 struct greybus_manifest {
177 struct greybus_manifest_header header;
178 struct greybus_descriptor descriptors[0];
179 } __packed;
180
181 #endif