aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorEric Caruso <ejcaruso@chromium.org>2017-05-16 11:46:48 -0400
committerBenson Leung <bleung@chromium.org>2017-06-23 19:12:17 -0400
commitbe3ebebf4377fe924f0419f78fc82cf01a31e692 (patch)
treef088715b93ea33ef429ff81cb66ed9bd0ce185de /include/linux/mfd
parenta6df7798d03b29095723c5fe9174ee2b53135ed0 (diff)
platform/chrome: cros_ec_lightbar - Add lightbar program feature to sysfs
Add a program feature so we can upload and run programs for lightbar sequences. We should be able to use this to shift sequences out of the EC and save space there. $ cat <suitable program bin> > /sys/devices/.../cros_ec/program $ echo program > /sys/devices/.../cros_ec/sequence Signed-off-by: Eric Caruso <ejcaruso@chromium.org> Signed-off-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Benson Leung <bleung@chromium.org>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/cros_ec_commands.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index 1b19e424e1cf..dbea5802e83b 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -1162,6 +1162,13 @@ struct lightbar_params_v1 {
1162 struct rgb_s color[8]; /* 0-3 are Google colors */ 1162 struct rgb_s color[8]; /* 0-3 are Google colors */
1163} __packed; 1163} __packed;
1164 1164
1165/* Lightbar program */
1166#define EC_LB_PROG_LEN 192
1167struct lightbar_program {
1168 uint8_t size;
1169 uint8_t data[EC_LB_PROG_LEN];
1170};
1171
1165struct ec_params_lightbar { 1172struct ec_params_lightbar {
1166 uint8_t cmd; /* Command (see enum lightbar_command) */ 1173 uint8_t cmd; /* Command (see enum lightbar_command) */
1167 union { 1174 union {
@@ -1188,6 +1195,7 @@ struct ec_params_lightbar {
1188 1195
1189 struct lightbar_params_v0 set_params_v0; 1196 struct lightbar_params_v0 set_params_v0;
1190 struct lightbar_params_v1 set_params_v1; 1197 struct lightbar_params_v1 set_params_v1;
1198 struct lightbar_program set_program;
1191 }; 1199 };
1192} __packed; 1200} __packed;
1193 1201
@@ -1220,7 +1228,8 @@ struct ec_response_lightbar {
1220 struct { 1228 struct {
1221 /* no return params */ 1229 /* no return params */
1222 } off, on, init, set_brightness, seq, reg, set_rgb, 1230 } off, on, init, set_brightness, seq, reg, set_rgb,
1223 demo, set_params_v0, set_params_v1; 1231 demo, set_params_v0, set_params_v1,
1232 set_program;
1224 }; 1233 };
1225} __packed; 1234} __packed;
1226 1235
@@ -1244,6 +1253,7 @@ enum lightbar_command {
1244 LIGHTBAR_CMD_GET_DEMO = 15, 1253 LIGHTBAR_CMD_GET_DEMO = 15,
1245 LIGHTBAR_CMD_GET_PARAMS_V1 = 16, 1254 LIGHTBAR_CMD_GET_PARAMS_V1 = 16,
1246 LIGHTBAR_CMD_SET_PARAMS_V1 = 17, 1255 LIGHTBAR_CMD_SET_PARAMS_V1 = 17,
1256 LIGHTBAR_CMD_SET_PROGRAM = 18,
1247 LIGHTBAR_NUM_CMDS 1257 LIGHTBAR_NUM_CMDS
1248}; 1258};
1249 1259