blob: 2b0bdde1aa26034d43ef2bbb5e5a27437e675203 [file] [log] [blame]
Caveh Jalali839ada12022-10-31 23:16:48 -07001/* SPDX-License-Identifier: BSD-3-Clause */
2
3
4
5
6#ifndef __CROS_EC_EC_CMD_API_H
7#define __CROS_EC_EC_CMD_API_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*
14 * This file consists of 3 sections corresponding to the different
15 * methods used to determine the host command API function signature:
16 *
17 * 1. This section consists of functions that do not follow a simple
18 * pattern and need to be specified explicitly.
19 *
20 * 2. This section consists of functions that can be generated with the
21 * help of template macros.
22 *
23 * Note:
24 *
25 * A CROS_EC_COMMAND_INFO macro must be defined before including this
26 * file. This is the data type holding the context info identifying the
27 * EC performing the command.
28 *
29 * A CROS_EC_COMMAND macro must be defined before including this file
30 * with the following signature:
31 *
32 * int CROS_EC_COMMAND(CROS_EC_COMMAND_INFO *h,
33 * int command, int version,
34 * const void *outdata, int outsize,
35 * void *indata, int insize)
36 *
37 * This is the function implementing host command messaging with the EC.
38 */
39
40/*
41 * Section 1: Functions that need to be implemented explicitly because
42 * they do not adhere to simple naming that would permit
43 * auto-generation.
44 *
45 * Please keep this list sorted by function name.
46 */
47
Simon Glassd3870a22023-11-09 08:43:30 -070048static inline int ec_cmd_battery_config(CROS_EC_COMMAND_INFO *h, uint8_t *r)
49{
50 return CROS_EC_COMMAND(h, EC_CMD_BATTERY_CONFIG, 0, NULL, 0, r,
51 BATT_CONF_MAX_SIZE);
52}
53
Caveh Jalali839ada12022-10-31 23:16:48 -070054static inline int ec_cmd_get_sku_id(CROS_EC_COMMAND_INFO *h,
55 struct ec_sku_id_info *r)
56{
57 return CROS_EC_COMMAND(h, EC_CMD_GET_SKU_ID, 0, NULL, 0, r, sizeof(*r));
58}
59
60static inline int
61ec_cmd_mkbp_info_get_next_data(CROS_EC_COMMAND_INFO *h,
62 const struct ec_params_mkbp_info *p,
63 union ec_response_get_next_data *r)
64{
65 return CROS_EC_COMMAND(h, EC_CMD_MKBP_INFO, 0, p, sizeof(*p), r,
66 sizeof(*r));
67}
68
69static inline int ec_cmd_set_sku_id(CROS_EC_COMMAND_INFO *h,
70 const struct ec_sku_id_info *p)
71{
72 return CROS_EC_COMMAND(h, EC_CMD_SET_SKU_ID, 0, p, sizeof(*p), NULL, 0);
73}
74
75static inline int ec_cmd_thermal_get_threshold_v1(
76 CROS_EC_COMMAND_INFO *h,
77 const struct ec_params_thermal_get_threshold_v1 *p,
78 struct ec_thermal_config *r)
79{
80 return CROS_EC_COMMAND(h, EC_CMD_THERMAL_GET_THRESHOLD, 1, p,
81 sizeof(*p), r, sizeof(*r));
82}
83
84static inline int
85ec_cmd_usb_pd_dev_info(CROS_EC_COMMAND_INFO *h,
86 const struct ec_params_usb_pd_info_request *p,
87 struct ec_params_usb_pd_rw_hash_entry *r)
88{
89 return CROS_EC_COMMAND(h, EC_CMD_USB_PD_DEV_INFO, 0, p, sizeof(*p), r,
90 sizeof(*r));
91}
92
93static inline int
94ec_cmd_usb_pd_discovery(CROS_EC_COMMAND_INFO *h,
95 const struct ec_params_usb_pd_info_request *p,
96 struct ec_params_usb_pd_discovery_entry *r)
97{
98 return CROS_EC_COMMAND(h, EC_CMD_USB_PD_DISCOVERY, 0, p, sizeof(*p), r,
99 sizeof(*r));
100}
101
102static inline int
103ec_cmd_usb_pd_set_amode(CROS_EC_COMMAND_INFO *h,
104 const struct ec_params_usb_pd_set_mode_request *p)
105{
106 return CROS_EC_COMMAND(h, EC_CMD_USB_PD_SET_AMODE, 0, p, sizeof(*p),
107 NULL, 0);
108}
109
110/*
111 * Section 2: EC interface functions that can be generated with the help
112 * of template macros.
113 *
114 * _cmd host command name
115 * _v host command version number
116 * _fn host command function name (will be prefixed with ec_cmd_)
117 * _in host command input (param) data type (will be prefixed with
118 * ec_params_)
119 * _out host command output (response) data type (will be prefixed with
120 * ec_response_)
121 *
122 * Template macros follow a naming scheme based on the arguments they
123 * require:
124 *
125 * C0 host command version 0, does not need to be specified (most
126 * common/default case)
127 * CV host command with specified version
128 * one of C0, CV is required
129 * F function name generated (the lower case version of the _cmd arg)
130 * (required)
131 * PF parameter type derived from function name (_fn arg)
132 * P parameter type specified explicitly (i.e. can not be derived from
133 * _fn arg)
134 * PF, P are mutually exclusive and optional
135 * RF response type derived from function name (_fn arg)
136 * R response type specified explicitly (i.e. can not be derived from
137 * _fn arg)
138 * RF, R are mutually exclusive and optional
139 */
140
141/*
142 * Template for EC interface functions that take a param and returns a
143 * response.
144 */
145#define _CROS_EC_CV_F_P_R(_cmd, _v, _fn, _in, _out) \
146 static inline int ec_cmd_##_fn(CROS_EC_COMMAND_INFO *h, \
147 const struct ec_params_##_in *p, \
148 struct ec_response_##_out *r) \
149 { \
150 return CROS_EC_COMMAND(h, (_cmd), (_v), p, sizeof(*p), r, \
151 sizeof(*r)); \
152 }
153
154/*
155 * Template for EC interface functions that take a param but do not
156 * return a response.
157 */
158#define _CROS_EC_CV_F_P(_cmd, _v, _fn, _in) \
159 static inline int ec_cmd_##_fn(CROS_EC_COMMAND_INFO *h, \
160 const struct ec_params_##_in *p) \
161 { \
162 return CROS_EC_COMMAND(h, (_cmd), (_v), p, sizeof(*p), NULL, \
163 0); \
164 }
165
166/*
167 * Template for EC interface functions that do not take a param but do
168 * return a response.
169 */
170#define _CROS_EC_CV_F_R(_cmd, _v, _fn, _out) \
171 static inline int ec_cmd_##_fn(CROS_EC_COMMAND_INFO *h, \
172 struct ec_response_##_out *r) \
173 { \
174 return CROS_EC_COMMAND(h, (_cmd), (_v), NULL, 0, r, \
175 sizeof(*r)); \
176 }
177
178/*
179 * Template for EC interface functions that do not take a param and do
180 * not return a response.
181 */
182#define _CROS_EC_CV_F(_cmd, _v, _fn) \
183 static inline int ec_cmd_##_fn(CROS_EC_COMMAND_INFO *h) \
184 { \
185 return CROS_EC_COMMAND(h, (_cmd), (_v), NULL, 0, NULL, 0); \
186 }
187
188/*
189 * Shorthand for host command version 0 where param and response name is
190 * derived from the function name.
191 */
192#define _CROS_EC_C0_F_PF_RF(_cmd, _fn) _CROS_EC_CV_F_P_R(_cmd, 0, _fn, _fn, _fn)
193
194/*
195 * Shorthand for host command version 1 where param and response name is
196 * derived from the function name.
197 */
198#define _CROS_EC_C1_F_PF_RF(_cmd, _fn) \
199 _CROS_EC_CV_F_P_R(_cmd, 1, _fn##_v1, _fn##_v1, _fn##_v1)
200
201/*
202 * Shorthand for host command version 0 where param name is
203 * derived from the function name and there is no response.
204 */
205#define _CROS_EC_C0_F_PF(_cmd, _fn) _CROS_EC_CV_F_P(_cmd, 0, _fn, _fn)
206
207/*
208 * Shorthand for host command version 1 where param name is
209 * derived from the function name and there is no response.
210 */
211#define _CROS_EC_C1_F_PF(_cmd, _fn) _CROS_EC_CV_F_P(_cmd, 1, _fn##_v1, _fn##_v1)
212
213/*
214 * Shorthand for host command version 0 where response name is derived
215 * from the function name and there is no param.
216 */
217#define _CROS_EC_C0_F_RF(_cmd, _fn) _CROS_EC_CV_F_R(_cmd, 0, _fn, _fn)
218
219/*
220 * Shorthand for host command version 1 where response name is derived
221 * from the function name and there is no param.
222 */
223#define _CROS_EC_C1_F_RF(_cmd, _fn) _CROS_EC_CV_F_R(_cmd, 1, _fn##_v1, _fn##_v1)
224
225/*
226 * Shorthand for host command version 0 where response and there are no
227 * params or response.
228 */
229#define _CROS_EC_C0_F(_cmd, _fn) _CROS_EC_CV_F(_cmd, 0, _fn)
230
231/*
232 * Please keep this list sorted by host command. Sort with:
233 *
234 * clang-format '--style={BasedOnStyle: InheritParentConfig,
235 * ColumnLimit: 888 }' include/ec_cmd_api.h | grep '^_CROS' |
236 * LC_COLLATE=C sort -t '(' -k 2,2 | clang-format
237 */
238
239_CROS_EC_C0_F_PF_RF(EC_CMD_ADC_READ, adc_read);
240_CROS_EC_CV_F_P(EC_CMD_ADD_ENTROPY, 0, add_entropy, rollback_add_entropy);
Simon Glassd3870a22023-11-09 08:43:30 -0700241_CROS_EC_C0_F_PF(EC_CMD_AP_FW_STATE, ap_fw_state);
Caveh Jalali839ada12022-10-31 23:16:48 -0700242_CROS_EC_C0_F(EC_CMD_AP_RESET, ap_reset);
243_CROS_EC_CV_F_P(EC_CMD_BATTERY_CUT_OFF, 1, battery_cut_off_v1, battery_cutoff);
244_CROS_EC_C0_F(EC_CMD_BATTERY_CUT_OFF, battery_cut_off);
245_CROS_EC_CV_F_P_R(EC_CMD_BATTERY_GET_DYNAMIC, 0, battery_get_dynamic,
246 battery_dynamic_info, battery_dynamic_info);
247_CROS_EC_CV_F_P_R(EC_CMD_BATTERY_GET_STATIC, 0, battery_get_static,
248 battery_static_info, battery_static_info);
249_CROS_EC_CV_F_P_R(EC_CMD_BATTERY_GET_STATIC, 1, battery_get_static_v1,
250 battery_static_info, battery_static_info_v1);
251_CROS_EC_CV_F_P_R(EC_CMD_BATTERY_GET_STATIC, 2, battery_get_static_v2,
252 battery_static_info, battery_static_info_v2);
253_CROS_EC_C0_F_PF_RF(EC_CMD_BATTERY_VENDOR_PARAM, battery_vendor_param);
254_CROS_EC_C0_F_PF(EC_CMD_BUTTON, button);
255_CROS_EC_C0_F_PF_RF(EC_CMD_CEC_GET, cec_get);
256_CROS_EC_C0_F_PF(EC_CMD_CEC_SET, cec_set);
Simon Glassd3870a22023-11-09 08:43:30 -0700257_CROS_EC_C1_F_PF(EC_CMD_CEC_WRITE_MSG, cec_write);
258_CROS_EC_C0_F_PF_RF(EC_CMD_CEC_READ_MSG, cec_read);
259_CROS_EC_C0_F_RF(EC_CMD_CEC_PORT_COUNT, cec_port_count);
Caveh Jalali839ada12022-10-31 23:16:48 -0700260_CROS_EC_C0_F_PF_RF(EC_CMD_CHARGESPLASH, chargesplash);
261_CROS_EC_CV_F_P_R(EC_CMD_CHARGE_CONTROL, 2, charge_control_v2, charge_control,
262 charge_control);
263_CROS_EC_CV_F_P(EC_CMD_CHARGE_CURRENT_LIMIT, 0, charge_current_limit,
264 current_limit);
265_CROS_EC_C0_F_RF(EC_CMD_CHARGE_PORT_COUNT, charge_port_count);
266_CROS_EC_C0_F_PF_RF(EC_CMD_CHARGE_STATE, charge_state);
267_CROS_EC_C0_F_PF(EC_CMD_CONFIG_POWER_BUTTON, config_power_button);
268_CROS_EC_C0_F(EC_CMD_CONSOLE_SNAPSHOT, console_snapshot);
269_CROS_EC_C0_F_PF_RF(EC_CMD_DEVICE_EVENT, device_event);
270_CROS_EC_C0_F_RF(EC_CMD_DISPLAY_SOC, display_soc);
271_CROS_EC_C0_F_PF(EC_CMD_EFS_VERIFY, efs_verify);
272_CROS_EC_C1_F_PF(EC_CMD_EXTERNAL_POWER_LIMIT, external_power_limit);
273_CROS_EC_C0_F_PF(EC_CMD_FLASH_ERASE, flash_erase);
274_CROS_EC_CV_F_R(EC_CMD_FLASH_INFO, 1, flash_info_v1, flash_info_1);
275_CROS_EC_C0_F_RF(EC_CMD_FLASH_INFO, flash_info);
276_CROS_EC_CV_F_P_R(EC_CMD_FLASH_PROTECT, 1, flash_protect_v1, flash_protect,
277 flash_protect);
278_CROS_EC_C0_F_PF_RF(EC_CMD_FLASH_PROTECT, flash_protect);
279_CROS_EC_CV_F_P_R(EC_CMD_FLASH_REGION_INFO, 1, flash_region_info_v1,
280 flash_region_info, flash_region_info);
281_CROS_EC_C0_F_RF(EC_CMD_FLASH_SPI_INFO, flash_spi_info);
282_CROS_EC_C0_F_PF(EC_CMD_FORCE_LID_OPEN, force_lid_open);
283_CROS_EC_C0_F_PF_RF(EC_CMD_FP_MODE, fp_mode);
284_CROS_EC_C0_F_PF(EC_CMD_FP_SEED, fp_seed);
285_CROS_EC_C0_F_RF(EC_CMD_FP_STATS, fp_stats);
286_CROS_EC_CV_F_R(EC_CMD_GET_BOARD_VERSION, 0, get_board_version, board_version);
287_CROS_EC_C0_F_RF(EC_CMD_GET_BOOT_TIME, get_boot_time);
288_CROS_EC_C0_F_RF(EC_CMD_GET_CHIP_INFO, get_chip_info);
289_CROS_EC_CV_F_P_R(EC_CMD_GET_CMD_VERSIONS, 1, get_cmd_versions_v1,
290 get_cmd_versions_v1, get_cmd_versions);
291_CROS_EC_C0_F_PF_RF(EC_CMD_GET_CMD_VERSIONS, get_cmd_versions);
292_CROS_EC_C0_F_RF(EC_CMD_GET_COMMS_STATUS, get_comms_status);
293_CROS_EC_C0_F_RF(EC_CMD_GET_FEATURES, get_features);
294_CROS_EC_CV_F_R(EC_CMD_GET_KEYBD_CONFIG, 0, get_keybd_config, keybd_config);
295_CROS_EC_CV_F_R(EC_CMD_GET_NEXT_EVENT, 2, get_next_event_v2, get_next_event);
296_CROS_EC_C0_F_RF(EC_CMD_GET_NEXT_EVENT, get_next_event);
297_CROS_EC_C0_F_PF_RF(EC_CMD_GET_PD_PORT_CAPS, get_pd_port_caps);
298_CROS_EC_C0_F_RF(EC_CMD_GET_PROTOCOL_INFO, get_protocol_info);
299_CROS_EC_CV_F_R(EC_CMD_GET_UPTIME_INFO, 0, get_uptime_info, uptime_info);
300_CROS_EC_C0_F_RF(EC_CMD_GET_VERSION, get_version);
301_CROS_EC_C1_F_RF(EC_CMD_GET_VERSION, get_version);
302_CROS_EC_C0_F_PF_RF(EC_CMD_GPIO_GET, gpio_get);
303_CROS_EC_C1_F_PF_RF(EC_CMD_GPIO_GET, gpio_get);
304_CROS_EC_C0_F_PF(EC_CMD_GPIO_SET, gpio_set);
305_CROS_EC_CV_F_P_R(EC_CMD_GSV_PAUSE_IN_S5, 0, gsv_pause_in_s5, get_set_value,
306 get_set_value);
307_CROS_EC_C0_F_PF(EC_CMD_HANG_DETECT, hang_detect);
308_CROS_EC_C0_F_PF_RF(EC_CMD_HELLO, hello);
309_CROS_EC_C0_F_PF_RF(EC_CMD_HIBERNATION_DELAY, hibernation_delay);
310_CROS_EC_C0_F_PF_RF(EC_CMD_HOST_EVENT, host_event);
311_CROS_EC_CV_F_P(EC_CMD_HOST_EVENT_CLEAR, 0, host_event_clear, host_event_mask);
312_CROS_EC_CV_F_P(EC_CMD_HOST_EVENT_CLEAR_B, 0, host_event_clear_b,
313 host_event_mask);
314_CROS_EC_CV_F_R(EC_CMD_HOST_EVENT_GET_B, 0, host_event_get_b, host_event_mask);
315_CROS_EC_CV_F_R(EC_CMD_HOST_EVENT_GET_SCI_MASK, 0, host_event_get_sci_mask,
316 host_event_mask);
317_CROS_EC_CV_F_R(EC_CMD_HOST_EVENT_GET_SMI_MASK, 0, host_event_get_smi_mask,
318 host_event_mask);
319_CROS_EC_CV_F_R(EC_CMD_HOST_EVENT_GET_WAKE_MASK, 0, host_event_get_wake_mask,
320 host_event_mask);
321_CROS_EC_CV_F_P(EC_CMD_HOST_EVENT_SET_SCI_MASK, 0, host_event_set_sci_mask,
322 host_event_mask);
323_CROS_EC_CV_F_P(EC_CMD_HOST_EVENT_SET_SMI_MASK, 0, host_event_set_smi_mask,
324 host_event_mask);
325_CROS_EC_CV_F_P(EC_CMD_HOST_EVENT_SET_WAKE_MASK, 0, host_event_set_wake_mask,
326 host_event_mask);
327_CROS_EC_C0_F_PF(EC_CMD_HOST_SLEEP_EVENT, host_sleep_event);
328_CROS_EC_C1_F_PF_RF(EC_CMD_HOST_SLEEP_EVENT, host_sleep_event);
329_CROS_EC_C0_F_PF_RF(EC_CMD_I2C_CONTROL, i2c_control);
330_CROS_EC_C0_F_PF_RF(EC_CMD_I2C_PASSTHRU_PROTECT, i2c_passthru_protect);
331_CROS_EC_C0_F_RF(EC_CMD_KEYBOARD_FACTORY_TEST, keyboard_factory_test);
332_CROS_EC_CV_F_P_R(EC_CMD_LED_CONTROL, 1, led_control_v1, led_control,
333 led_control);
334_CROS_EC_C0_F_PF_RF(EC_CMD_LOCATE_CHIP, locate_chip);
335_CROS_EC_C0_F_RF(EC_CMD_MKBP_GET_CONFIG, mkbp_get_config);
336_CROS_EC_C0_F_PF_RF(EC_CMD_MKBP_INFO, mkbp_info);
337_CROS_EC_C0_F_PF(EC_CMD_MKBP_SET_CONFIG, mkbp_set_config);
338_CROS_EC_C0_F_PF(EC_CMD_MKBP_SIMULATE_KEY, mkbp_simulate_key);
339_CROS_EC_CV_F_P_R(EC_CMD_MKBP_WAKE_MASK, 0, mkbp_wake_mask,
340 mkbp_event_wake_mask, mkbp_event_wake_mask);
341_CROS_EC_CV_F_P_R(EC_CMD_MOTION_SENSE_CMD, 1, motion_sense_cmd_v1, motion_sense,
342 motion_sense);
343_CROS_EC_CV_F_P_R(EC_CMD_MOTION_SENSE_CMD, 2, motion_sense_cmd_v2, motion_sense,
344 motion_sense);
345_CROS_EC_CV_F_P_R(EC_CMD_MOTION_SENSE_CMD, 4, motion_sense_cmd_v4, motion_sense,
346 motion_sense);
347_CROS_EC_CV_F_P(EC_CMD_OVERRIDE_DEDICATED_CHARGER_LIMIT, 0,
348 override_dedicated_charger_limit, dedicated_charger_limit);
349_CROS_EC_C0_F_RF(EC_CMD_PCHG_COUNT, pchg_count);
350_CROS_EC_CV_F_P(EC_CMD_PD_CHARGE_PORT_OVERRIDE, 0, pd_charge_port_override,
351 charge_port_override);
352_CROS_EC_CV_F_P_R(EC_CMD_PD_CHIP_INFO, 1, pd_chip_info_v1, pd_chip_info,
353 pd_chip_info_v1);
354_CROS_EC_C0_F_PF_RF(EC_CMD_PD_CHIP_INFO, pd_chip_info);
355_CROS_EC_C0_F_PF(EC_CMD_PD_CONTROL, pd_control);
356_CROS_EC_CV_F_R(EC_CMD_PD_HOST_EVENT_STATUS, 0, pd_host_event_status,
357 host_event_status);
358_CROS_EC_C0_F_PF(EC_CMD_PD_WRITE_LOG_ENTRY, pd_write_log_entry);
359_CROS_EC_C0_F_RF(EC_CMD_PORT80_LAST_BOOT, port80_last_boot);
360_CROS_EC_C1_F_RF(EC_CMD_POWER_INFO, power_info);
361_CROS_EC_CV_F_P_R(EC_CMD_PSE, 0, pse, pse, pse_status);
362_CROS_EC_C0_F_RF(EC_CMD_PSTORE_INFO, pstore_info);
363_CROS_EC_C0_F_PF(EC_CMD_PSTORE_WRITE, pstore_write);
364_CROS_EC_C0_F_PF_RF(EC_CMD_PWM_GET_DUTY, pwm_get_duty);
365_CROS_EC_C0_F_RF(EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT, pwm_get_keyboard_backlight);
366_CROS_EC_C0_F_PF(EC_CMD_PWM_SET_DUTY, pwm_set_duty);
367_CROS_EC_C0_F_PF(EC_CMD_PWM_SET_FAN_DUTY, pwm_set_fan_duty_v0);
368_CROS_EC_C0_F_PF(EC_CMD_PWM_SET_KEYBOARD_BACKLIGHT, pwm_set_keyboard_backlight);
369_CROS_EC_C0_F_PF_RF(EC_CMD_RAND_NUM, rand_num);
370_CROS_EC_C0_F(EC_CMD_REBOOT, reboot);
371_CROS_EC_C0_F(EC_CMD_REBOOT_AP_ON_G3, reboot_ap_on_g3);
372_CROS_EC_C1_F_PF(EC_CMD_REBOOT_AP_ON_G3, reboot_ap_on_g3);
373_CROS_EC_C0_F_PF(EC_CMD_REBOOT_EC, reboot_ec);
374_CROS_EC_C0_F_PF(EC_CMD_REGULATOR_ENABLE, regulator_enable);
375_CROS_EC_C0_F_PF_RF(EC_CMD_REGULATOR_GET_VOLTAGE, regulator_get_voltage);
376_CROS_EC_C0_F_PF_RF(EC_CMD_REGULATOR_IS_ENABLED, regulator_is_enabled);
377_CROS_EC_C0_F_PF(EC_CMD_REGULATOR_SET_VOLTAGE, regulator_set_voltage);
378_CROS_EC_C0_F_PF_RF(EC_CMD_RGBKBD, rgbkbd);
379_CROS_EC_C0_F_RF(EC_CMD_ROLLBACK_INFO, rollback_info);
380_CROS_EC_CV_F_R(EC_CMD_RTC_GET_ALARM, 0, rtc_get_alarm, rtc);
381_CROS_EC_CV_F_R(EC_CMD_RTC_GET_VALUE, 0, rtc_get_value, rtc);
382_CROS_EC_CV_F_P(EC_CMD_RTC_SET_ALARM, 0, rtc_set_alarm, rtc);
383_CROS_EC_CV_F_P(EC_CMD_RTC_SET_VALUE, 0, rtc_set_value, rtc);
384_CROS_EC_C0_F_PF(EC_CMD_RWSIG_ACTION, rwsig_action);
385_CROS_EC_C0_F_RF(EC_CMD_RWSIG_CHECK_STATUS, rwsig_check_status);
386_CROS_EC_C0_F_RF(EC_CMD_RWSIG_INFO, rwsig_info);
387_CROS_EC_C0_F_PF(EC_CMD_SET_BASE_STATE, set_base_state);
388_CROS_EC_C0_F_PF(EC_CMD_SET_TABLET_MODE, set_tablet_mode);
389_CROS_EC_C0_F_PF_RF(EC_CMD_SMART_DISCHARGE, smart_discharge);
390_CROS_EC_CV_F_P(EC_CMD_SWITCH_ENABLE_BKLIGHT, 0, switch_enable_bklight,
391 switch_enable_backlight);
392_CROS_EC_CV_F_P(EC_CMD_SWITCH_ENABLE_WIRELESS, 0, switch_enable_wireless,
393 switch_enable_wireless_v0);
394_CROS_EC_C1_F_PF_RF(EC_CMD_SWITCH_ENABLE_WIRELESS, switch_enable_wireless);
395_CROS_EC_C0_F_RF(EC_CMD_SYSINFO, sysinfo);
396_CROS_EC_C0_F_PF_RF(EC_CMD_TEMP_SENSOR_GET_INFO, temp_sensor_get_info);
397_CROS_EC_C0_F_PF_RF(EC_CMD_TEST_PROTOCOL, test_protocol);
398_CROS_EC_C0_F(EC_CMD_THERMAL_AUTO_FAN_CTRL, thermal_auto_fan_ctrl);
399_CROS_EC_C0_F_PF_RF(EC_CMD_THERMAL_GET_THRESHOLD, thermal_get_threshold);
400_CROS_EC_C0_F_PF(EC_CMD_THERMAL_SET_THRESHOLD, thermal_set_threshold);
401_CROS_EC_C1_F_PF(EC_CMD_THERMAL_SET_THRESHOLD, thermal_set_threshold);
402_CROS_EC_C0_F_PF_RF(EC_CMD_TMP006_GET_RAW, tmp006_get_raw);
403_CROS_EC_C0_F_PF(EC_CMD_TYPEC_CONTROL, typec_control);
404_CROS_EC_C0_F_PF_RF(EC_CMD_TYPEC_STATUS, typec_status);
405_CROS_EC_C0_F_PF_RF(EC_CMD_TYPEC_VDM_RESPONSE, typec_vdm_response);
406_CROS_EC_C0_F_PF(EC_CMD_USB_CHARGE_SET_MODE, usb_charge_set_mode);
407_CROS_EC_C0_F_PF(EC_CMD_USB_MUX, usb_mux);
408_CROS_EC_CV_F_P_R(EC_CMD_USB_PD_CONTROL, 2, usb_pd_control_v2, usb_pd_control,
409 usb_pd_control_v2);
410_CROS_EC_C0_F_PF_RF(EC_CMD_USB_PD_CONTROL, usb_pd_control);
411_CROS_EC_C0_F_PF(EC_CMD_USB_PD_DPS_CONTROL, usb_pd_dps_control);
412_CROS_EC_C0_F_PF(EC_CMD_USB_PD_MUX_ACK, usb_pd_mux_ack);
413_CROS_EC_C0_F_PF_RF(EC_CMD_USB_PD_MUX_INFO, usb_pd_mux_info);
414_CROS_EC_C0_F_RF(EC_CMD_USB_PD_PORTS, usb_pd_ports);
415_CROS_EC_C0_F_PF_RF(EC_CMD_USB_PD_POWER_INFO, usb_pd_power_info);
416_CROS_EC_C0_F_PF(EC_CMD_USB_PD_RW_HASH_ENTRY, usb_pd_rw_hash_entry);
417_CROS_EC_C0_F_PF_RF(EC_CMD_VBOOT_HASH, vboot_hash);
418_CROS_EC_C0_F_PF_RF(EC_CMD_VSTORE_READ, vstore_read);
419_CROS_EC_C0_F_PF(EC_CMD_VSTORE_WRITE, vstore_write);
420
421#ifdef __cplusplus
422}
423#endif
424
425#endif /* __CROS_EC_EC_CMD_API_H */