@@ -1067,5 +1067,181 @@ struct gb_sdio_event_request {
1067
1067
#define GB_SDIO_WP 0x04
1068
1068
};
1069
1069
1070
+ /* Lights */
1071
+
1072
+ #define GB_LIGHTS_VERSION_MAJOR 0x00
1073
+ #define GB_LIGHTS_VERSION_MINOR 0x01
1074
+
1075
+ /* Greybus Lights request types */
1076
+ #define GB_LIGHTS_TYPE_INVALID 0x00
1077
+ #define GB_LIGHTS_TYPE_PROTOCOL_VERSION 0x01
1078
+ #define GB_LIGHTS_TYPE_GET_LIGHTS 0x02
1079
+ #define GB_LIGHTS_TYPE_GET_LIGHT_CONFIG 0x03
1080
+ #define GB_LIGHTS_TYPE_GET_CHANNEL_CONFIG 0x04
1081
+ #define GB_LIGHTS_TYPE_GET_CHANNEL_FLASH_CONFIG 0x05
1082
+ #define GB_LIGHTS_TYPE_SET_BRIGHTNESS 0x06
1083
+ #define GB_LIGHTS_TYPE_SET_BLINK 0x07
1084
+ #define GB_LIGHTS_TYPE_SET_COLOR 0x08
1085
+ #define GB_LIGHTS_TYPE_SET_FADE 0x09
1086
+ #define GB_LIGHTS_TYPE_EVENT 0x0A
1087
+ #define GB_LIGHTS_TYPE_SET_FLASH_INTENSITY 0x0B
1088
+ #define GB_LIGHTS_TYPE_SET_FLASH_STROBE 0x0C
1089
+ #define GB_LIGHTS_TYPE_SET_FLASH_TIMEOUT 0x0D
1090
+ #define GB_LIGHTS_TYPE_GET_FLASH_FAULT 0x0E
1091
+
1092
+ /* Greybus Light modes */
1093
+
1094
+ /*
1095
+ * if you add any specific mode below, update also the
1096
+ * GB_CHANNEL_MODE_DEFINED_RANGE value accordingly
1097
+ */
1098
+ #define GB_CHANNEL_MODE_NONE 0x00000000
1099
+ #define GB_CHANNEL_MODE_BATTERY 0x00000001
1100
+ #define GB_CHANNEL_MODE_POWER 0x00000002
1101
+ #define GB_CHANNEL_MODE_WIRELESS 0x00000004
1102
+ #define GB_CHANNEL_MODE_BLUETOOTH 0x00000008
1103
+ #define GB_CHANNEL_MODE_KEYBOARD 0x00000010
1104
+ #define GB_CHANNEL_MODE_BUTTONS 0x00000020
1105
+ #define GB_CHANNEL_MODE_NOTIFICATION 0x00000040
1106
+ #define GB_CHANNEL_MODE_ATTENTION 0x00000080
1107
+ #define GB_CHANNEL_MODE_FLASH 0x00000100
1108
+ #define GB_CHANNEL_MODE_TORCH 0x00000200
1109
+ #define GB_CHANNEL_MODE_INDICATOR 0x00000400
1110
+
1111
+ /* Lights Mode valid bit values */
1112
+ #define GB_CHANNEL_MODE_DEFINED_RANGE 0x000004FF
1113
+ #define GB_CHANNEL_MODE_VENDOR_RANGE 0x00F00000
1114
+
1115
+ /* Greybus Light Channels Flags */
1116
+ #define GB_LIGHT_CHANNEL_MULTICOLOR 0x00000001
1117
+ #define GB_LIGHT_CHANNEL_FADER 0x00000002
1118
+ #define GB_LIGHT_CHANNEL_BLINK 0x00000004
1119
+
1120
+ /* get count of lights in module */
1121
+ struct gb_lights_get_lights_response {
1122
+ __u8 lights_count ;
1123
+ };
1124
+
1125
+ /* light config request payload */
1126
+ struct gb_lights_get_light_config_request {
1127
+ __u8 id ;
1128
+ };
1129
+
1130
+ /* light config response payload */
1131
+ struct gb_lights_get_light_config_response {
1132
+ __u8 channel_count ;
1133
+ __u8 name [32 ];
1134
+ };
1135
+
1136
+ /* channel config request payload */
1137
+ struct gb_lights_get_channel_config_request {
1138
+ __u8 light_id ;
1139
+ __u8 channel_id ;
1140
+ };
1141
+
1142
+ /* channel flash config request payload */
1143
+ struct gb_lights_get_channel_flash_config_request {
1144
+ __u8 light_id ;
1145
+ __u8 channel_id ;
1146
+ };
1147
+
1148
+ /* channel config response payload */
1149
+ struct gb_lights_get_channel_config_response {
1150
+ __u8 max_brightness ;
1151
+ __le32 flags ;
1152
+ __le32 color ;
1153
+ __u8 color_name [32 ];
1154
+ __le32 mode ;
1155
+ __u8 mode_name [32 ];
1156
+ } __packed ;
1157
+
1158
+ /* channel flash config response payload */
1159
+ struct gb_lights_get_channel_flash_config_response {
1160
+ __le32 intensity_min_uA ;
1161
+ __le32 intensity_max_uA ;
1162
+ __le32 intensity_step_uA ;
1163
+ __le32 timeout_min_us ;
1164
+ __le32 timeout_max_us ;
1165
+ __le32 timeout_step_us ;
1166
+ };
1167
+
1168
+ /* blink request payload: response have no payload */
1169
+ struct gb_lights_blink_request {
1170
+ __u8 light_id ;
1171
+ __u8 channel_id ;
1172
+ __le16 time_on_ms ;
1173
+ __le16 time_off_ms ;
1174
+ };
1175
+
1176
+ /* set brightness request payload: response have no payload */
1177
+ struct gb_lights_set_brightness_request {
1178
+ __u8 light_id ;
1179
+ __u8 channel_id ;
1180
+ __u8 brightness ;
1181
+ };
1182
+
1183
+ /* set color request payload: response have no payload */
1184
+ struct gb_lights_set_color_request {
1185
+ __u8 light_id ;
1186
+ __u8 channel_id ;
1187
+ __le32 color ;
1188
+ } __packed ;
1189
+
1190
+ /* set fade request payload: response have no payload */
1191
+ struct gb_lights_set_fade_request {
1192
+ __u8 light_id ;
1193
+ __u8 channel_id ;
1194
+ __u8 fade_in ;
1195
+ __u8 fade_out ;
1196
+ };
1197
+
1198
+ /* event request: generated by module */
1199
+ struct gb_lights_event_request {
1200
+ __u8 light_id ;
1201
+ __u8 event ;
1202
+ #define GB_LIGHTS_LIGHT_CONFIG 0x01
1203
+ };
1204
+
1205
+ /* set flash intensity request payload: response have no payload */
1206
+ struct gb_lights_set_flash_intensity_request {
1207
+ __u8 light_id ;
1208
+ __u8 channel_id ;
1209
+ __le32 intensity_uA ;
1210
+ } __packed ;
1211
+
1212
+ /* set flash strobe state request payload: response have no payload */
1213
+ struct gb_lights_set_flash_strobe_request {
1214
+ __u8 light_id ;
1215
+ __u8 channel_id ;
1216
+ __u8 state ;
1217
+ };
1218
+
1219
+ /* set flash timeout request payload: response have no payload */
1220
+ struct gb_lights_set_flash_timeout_request {
1221
+ __u8 light_id ;
1222
+ __u8 channel_id ;
1223
+ __le32 timeout_us ;
1224
+ } __packed ;
1225
+
1226
+ /* get flash fault request payload */
1227
+ struct gb_lights_get_flash_fault_request {
1228
+ __u8 light_id ;
1229
+ __u8 channel_id ;
1230
+ };
1231
+
1232
+ /* get flash fault response payload */
1233
+ struct gb_lights_get_flash_fault_response {
1234
+ __le32 fault ;
1235
+ #define GB_LIGHTS_FLASH_FAULT_OVER_VOLTAGE 0x00000000
1236
+ #define GB_LIGHTS_FLASH_FAULT_TIMEOUT 0x00000001
1237
+ #define GB_LIGHTS_FLASH_FAULT_OVER_TEMPERATURE 0x00000002
1238
+ #define GB_LIGHTS_FLASH_FAULT_SHORT_CIRCUIT 0x00000004
1239
+ #define GB_LIGHTS_FLASH_FAULT_OVER_CURRENT 0x00000008
1240
+ #define GB_LIGHTS_FLASH_FAULT_INDICATOR 0x00000010
1241
+ #define GB_LIGHTS_FLASH_FAULT_UNDER_VOLTAGE 0x00000020
1242
+ #define GB_LIGHTS_FLASH_FAULT_INPUT_VOLTAGE 0x00000040
1243
+ #define GB_LIGHTS_FLASH_FAULT_LED_OVER_TEMPERATURE 0x00000080
1244
+ };
1245
+
1070
1246
#endif /* __GREYBUS_PROTOCOLS_H */
1071
1247
0 commit comments