diff options
-rw-r--r-- | common/lightbar.c | 2 | ||||
-rw-r--r-- | include/ec_commands.h | 23 | ||||
-rw-r--r-- | include/lightbar.h | 15 |
3 files changed, 23 insertions, 17 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index eb9c0014a8..cfb292249d 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -113,7 +113,7 @@ static inline uint8_t scale_abs(int val, int max) } /* It will often be simpler to provide an overall brightness control. */ -int brightness = 0x80; +static int brightness = 0x80; /* So that we can make brightness changes happen instantly, we need to track * the current values. The values in the controllers aren't very helpful. */ diff --git a/include/ec_commands.h b/include/ec_commands.h index 0fcb87ec47..4e3bd7082f 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -623,10 +623,12 @@ struct ec_params_pwm_set_fan_duty { struct ec_params_lightbar_cmd { union { union { - uint8_t cmd; + uint8_t cmd; /* Command (see enum lightbar_command) */ + struct { uint8_t cmd; } dump, off, on, init, get_seq; + struct num { uint8_t cmd; uint8_t num; @@ -636,11 +638,13 @@ struct ec_params_lightbar_cmd { uint8_t cmd; uint8_t ctrl, reg, value; } reg; + struct rgb { uint8_t cmd; uint8_t led, red, green, blue; } rgb; } in; + union { struct dump { struct { @@ -649,9 +653,11 @@ struct ec_params_lightbar_cmd { uint8_t ic1; } vals[23]; } dump; + struct get_seq { uint8_t num; } get_seq; + struct { /* no return params */ } off, on, init, brightness, seq, reg, rgb, demo; @@ -659,6 +665,21 @@ struct ec_params_lightbar_cmd { }; } __packed; +/* Lightbar commands */ +enum lightbar_command { + LIGHTBAR_CMD_DUMP = 0, + LIGHTBAR_CMD_OFF = 1, + LIGHTBAR_CMD_ON = 2, + LIGHTBAR_CMD_INIT = 3, + LIGHTBAR_CMD_BRIGHTNESS = 4, + LIGHTBAR_CMD_SEQ = 5, + LIGHTBAR_CMD_REG = 6, + LIGHTBAR_CMD_RGB = 7, + LIGHTBAR_CMD_GET_SEQ = 8, + LIGHTBAR_CMD_DEMO = 9, + LIGHTBAR_NUM_CMDS +}; + /*****************************************************************************/ /* Verified boot commands */ diff --git a/include/lightbar.h b/include/lightbar.h index ea48314904..4f284a43b6 100644 --- a/include/lightbar.h +++ b/include/lightbar.h @@ -25,21 +25,6 @@ void lightbar_sequence(enum lightbar_sequence s); /****************************************************************************/ /* External stuff */ -/* These are the commands available to the EC console or via LPC. */ -enum lightbar_command { - LIGHTBAR_CMD_DUMP, - LIGHTBAR_CMD_OFF, - LIGHTBAR_CMD_ON, - LIGHTBAR_CMD_INIT, - LIGHTBAR_CMD_BRIGHTNESS, - LIGHTBAR_CMD_SEQ, - LIGHTBAR_CMD_REG, - LIGHTBAR_CMD_RGB, - LIGHTBAR_CMD_GET_SEQ, - LIGHTBAR_CMD_DEMO, - LIGHTBAR_NUM_CMDS -}; - /* These are used for demo purposes */ extern void demo_battery_level(int inc); extern void demo_is_charging(int ischarge); |