diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ec/google/chromeec/ec.c | 23 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec.h | 1 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec_commands.h | 5 |
3 files changed, 27 insertions, 2 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 4d47982aa6..03d4c3bc6d 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -263,6 +263,27 @@ int google_chromeec_check_feature(int feature) return r.flags[feature / 32] & EC_FEATURE_MASK_0(feature); } +int google_chromeec_set_sku_id(u32 skuid) +{ + struct chromeec_command cmd; + struct ec_sku_id_info set_skuid = { + .sku_id = skuid + }; + + cmd.cmd_code = EC_CMD_SET_SKU_ID; + cmd.cmd_version = 0; + cmd.cmd_size_in = sizeof(set_skuid); + cmd.cmd_data_in = &set_skuid; + cmd.cmd_data_out = NULL; + cmd.cmd_size_out = 0; + cmd.cmd_dev_index = 0; + + if (google_chromeec_command(&cmd) != 0) + return -1; + + return 0; +} + #if IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_RTC) int rtc_get(struct rtc_time *time) { @@ -389,7 +410,7 @@ u16 google_chromeec_get_board_version(void) u32 google_chromeec_get_sku_id(void) { struct chromeec_command cmd; - struct ec_response_sku_id sku_v; + struct ec_sku_id_info sku_v; cmd.cmd_code = EC_CMD_GET_SKU_ID; cmd.cmd_version = 0; diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 60d5a323b7..3a7cadd506 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -50,6 +50,7 @@ int google_chromeec_check_feature(int feature); uint8_t google_chromeec_calc_checksum(const uint8_t *data, int size); u16 google_chromeec_get_board_version(void); u32 google_chromeec_get_sku_id(void); +int google_chromeec_set_sku_id(u32 skuid); u32 google_chromeec_get_events_b(void); int google_chromeec_clear_events_b(u32 mask); int google_chromeec_kbbacklight(int percent); diff --git a/src/ec/google/chromeec/ec_commands.h b/src/ec/google/chromeec/ec_commands.h index 46ab905e8f..c5d27d2149 100644 --- a/src/ec/google/chromeec/ec_commands.h +++ b/src/ec/google/chromeec/ec_commands.h @@ -1124,7 +1124,10 @@ struct __ec_align4 ec_response_get_features { /* Get the board's SKU ID from EC */ #define EC_CMD_GET_SKU_ID 0x000E -struct __ec_align4 ec_response_sku_id { +/* Set SKU ID from AP */ +#define EC_CMD_SET_SKU_ID 0x000F + +struct __ec_align4 ec_sku_id_info { uint32_t sku_id; }; |