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.
Showing the changes to include/linux/platform_data (1 of 2 files). Show all
Unified · Split
| @@ -2005,6 +2005,14 @@ struct lightbar_params_v2_colors { · 2004 unmodified lines | ||
| 2005 | 2005 | struct rgb_s color[8]; /* 0-3 are Google colors */ |
| 2006 | 2006 | } __ec_todo_packed; |
| 2007 | 2007 | |
| 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 | + | |
| 2008 | 2016 | /* Lightbar program. */ |
| 2009 | 2017 | #define EC_LB_PROG_LEN 192 |
| 2010 | 2018 | struct lightbar_program { |
| @@ -2086,6 +2094,8 @@ struct ec_response_lightbar { · 75 unmodified lines | ||
| 2086 | 2094 | struct lightbar_params_v2_thresholds get_params_v2_thlds; |
| 2087 | 2095 | struct lightbar_params_v2_colors get_params_v2_colors; |
| 2088 | 2096 | |
| 2097 | + struct lightbar_params_v3 get_params_v3; | |
| 2098 | + | |
| 2089 | 2099 | struct __ec_todo_unpacked { |
| 2090 | 2100 | uint32_t num; |
| 2091 | 2101 | uint32_t flags; |
| @@ -2143,6 +2153,7 @@ enum lightbar_command { · 51 unmodified lines | ||
| 2143 | 2153 | LIGHTBAR_CMD_SET_PARAMS_V2_THRESHOLDS = 31, |
| 2144 | 2154 | LIGHTBAR_CMD_GET_PARAMS_V2_COLORS = 32, |
| 2145 | 2155 | LIGHTBAR_CMD_SET_PARAMS_V2_COLORS = 33, |
| 2156 | + LIGHTBAR_CMD_GET_PARAMS_V3 = 34, | |
| 2146 | 2157 | LIGHTBAR_NUM_CMDS |
| 2147 | 2158 | }; |
| 2148 | 2159 | |