History

platform/chrome: lightbar: Report number of segments

Add attribue `num_segments` to return the number of exposed LED segments in the lightbar. It can be smaller than the number of physical leds in the lightbar. Test: Check the attribute is present and returns a value when read.

Gwendal Grignou committed 9 months ago

Commit 2d8251d1 parent ec0dd362 files · +54 −0Browse files

Showing the changes to include/linux/platform_data (1 of 2 files). Show all

Unified · Split

include/linux/platform_data/cros_ec_commands.h+11−0
@@ -2005,6 +2005,14 @@ struct lightbar_params_v2_colors { · 2004 unmodified lines
20052005 struct rgb_s color[8]; /* 0-3 are Google colors */
20062006 } __ec_todo_packed;
20072007
2008+struct lightbar_params_v3 {
2009+ /*
2010+ * Number of LEDs reported by the EC.
2011+ * May be less than the actual number of LEDs in the lightbar.
2012+ */
2013+ uint8_t reported_led_num;
2014+} __ec_todo_packed;
2015+
20082016 /* Lightbar program. */
20092017 #define EC_LB_PROG_LEN 192
20102018 struct lightbar_program {
@@ -2086,6 +2094,8 @@ struct ec_response_lightbar { · 75 unmodified lines
20862094 struct lightbar_params_v2_thresholds get_params_v2_thlds;
20872095 struct lightbar_params_v2_colors get_params_v2_colors;
20882096
2097+ struct lightbar_params_v3 get_params_v3;
2098+
20892099 struct __ec_todo_unpacked {
20902100 uint32_t num;
20912101 uint32_t flags;
@@ -2143,6 +2153,7 @@ enum lightbar_command { · 51 unmodified lines
21432153 LIGHTBAR_CMD_SET_PARAMS_V2_THRESHOLDS = 31,
21442154 LIGHTBAR_CMD_GET_PARAMS_V2_COLORS = 32,
21452155 LIGHTBAR_CMD_SET_PARAMS_V2_COLORS = 33,
2156+ LIGHTBAR_CMD_GET_PARAMS_V3 = 34,
21462157 LIGHTBAR_NUM_CMDS
21472158 };
21482159