summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/charge_state.c58
-rw-r--r--common/flash_commands.c104
-rw-r--r--common/host_command.c50
-rw-r--r--common/host_event_commands.c62
-rw-r--r--common/keyboard.c4
-rw-r--r--common/lightbar.c18
-rw-r--r--common/pstore_commands.c44
-rw-r--r--common/pwm_commands.c36
-rw-r--r--common/system_common.c62
-rw-r--r--common/temp_sensor.c7
-rw-r--r--common/thermal.c6
-rw-r--r--common/thermal_commands.c32
-rw-r--r--common/usb_charge_commands.c10
13 files changed, 246 insertions, 247 deletions
diff --git a/common/charge_state.c b/common/charge_state.c
index d98a98dd87..b0ac2130c8 100644
--- a/common/charge_state.c
+++ b/common/charge_state.c
@@ -15,7 +15,7 @@
#include "console.h"
#include "gpio.h"
#include "lpc.h"
-#include "lpc_commands.h"
+#include "ec_commands.h"
#include "power_led.h"
#include "smart_battery.h"
#include "system.h"
@@ -46,37 +46,37 @@ static void update_battery_info(void)
/* Design Capacity of Full */
battery_design_capacity((int *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_DCAP));
+ EC_MEMMAP_BATT_DCAP));
/* Design Voltage */
battery_design_voltage((int *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_DVLT));
+ EC_MEMMAP_BATT_DVLT));
/* Last Full Charge Capacity */
battery_full_charge_capacity((int *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_LFCC));
+ EC_MEMMAP_BATT_LFCC));
/* Cycle Count */
battery_cycle_count((int *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_CCNT));
+ EC_MEMMAP_BATT_CCNT));
/* Battery Manufacturer string */
- batt_str = (char *)(lpc_get_memmap_range() + EC_LPC_MEMMAP_BATT_MFGR);
- memset(batt_str, 0, EC_LPC_MEMMAP_TEXT_MAX);
- battery_manufacturer_name(batt_str, EC_LPC_MEMMAP_TEXT_MAX);
+ batt_str = (char *)(lpc_get_memmap_range() + EC_MEMMAP_BATT_MFGR);
+ memset(batt_str, 0, EC_MEMMAP_TEXT_MAX);
+ battery_manufacturer_name(batt_str, EC_MEMMAP_TEXT_MAX);
/* Battery Model string */
- batt_str = (char *)(lpc_get_memmap_range() + EC_LPC_MEMMAP_BATT_MODEL);
- memset(batt_str, 0, EC_LPC_MEMMAP_TEXT_MAX);
- battery_device_name(batt_str, EC_LPC_MEMMAP_TEXT_MAX);
+ batt_str = (char *)(lpc_get_memmap_range() + EC_MEMMAP_BATT_MODEL);
+ memset(batt_str, 0, EC_MEMMAP_TEXT_MAX);
+ battery_device_name(batt_str, EC_MEMMAP_TEXT_MAX);
/* Battery Type string */
- batt_str = (char *)(lpc_get_memmap_range() + EC_LPC_MEMMAP_BATT_TYPE);
- battery_device_chemistry(batt_str, EC_LPC_MEMMAP_TEXT_MAX);
+ batt_str = (char *)(lpc_get_memmap_range() + EC_MEMMAP_BATT_TYPE);
+ battery_device_chemistry(batt_str, EC_MEMMAP_TEXT_MAX);
/* Smart battery serial number is 16 bits */
- batt_str = (char *)(lpc_get_memmap_range() + EC_LPC_MEMMAP_BATT_SERIAL);
- memset(batt_str, 0, EC_LPC_MEMMAP_TEXT_MAX);
+ batt_str = (char *)(lpc_get_memmap_range() + EC_MEMMAP_BATT_SERIAL);
+ memset(batt_str, 0, EC_MEMMAP_TEXT_MAX);
if (battery_serial_number(&batt_serial) == 0) {
*batt_str++ = hex2asc(0xf & (batt_serial >> 12));
*batt_str++ = hex2asc(0xf & (batt_serial >> 8));
@@ -134,12 +134,12 @@ static int state_common(struct power_state_context *ctx)
rv = charger_post_init();
if (rv)
curr->error |= F_CHARGER_INIT;
- lpc_set_host_events(EC_LPC_HOST_EVENT_MASK(
- EC_LPC_HOST_EVENT_AC_CONNECTED));
+ lpc_set_host_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_AC_CONNECTED));
} else {
/* AC off */
- lpc_set_host_events(EC_LPC_HOST_EVENT_MASK(
- EC_LPC_HOST_EVENT_AC_DISCONNECTED));
+ lpc_set_host_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_AC_DISCONNECTED));
}
}
@@ -219,16 +219,16 @@ static int state_common(struct power_state_context *ctx)
/* Battery charge level low */
if (batt->state_of_charge <= BATTERY_LEVEL_LOW &&
prev->batt.state_of_charge > BATTERY_LEVEL_LOW)
- lpc_set_host_events(EC_LPC_HOST_EVENT_MASK(
- EC_LPC_HOST_EVENT_BATTERY_LOW));
+ lpc_set_host_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_BATTERY_LOW));
/* Battery charge level critical */
if (batt->state_of_charge <= BATTERY_LEVEL_CRITICAL) {
*ctx->memmap_batt_flags |= EC_BATT_FLAG_LEVEL_CRITICAL;
/* Send battery critical host event */
if (prev->batt.state_of_charge > BATTERY_LEVEL_CRITICAL)
- lpc_set_host_events(EC_LPC_HOST_EVENT_MASK(
- EC_LPC_HOST_EVENT_BATTERY_CRITICAL));
+ lpc_set_host_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_BATTERY_CRITICAL));
} else
*ctx->memmap_batt_flags &= ~EC_BATT_FLAG_LEVEL_CRITICAL;
@@ -287,8 +287,8 @@ static enum power_state state_init(struct power_state_context *ctx)
update_battery_info();
/* Send battery event to host */
- lpc_set_host_events(EC_LPC_HOST_EVENT_MASK(
- EC_LPC_HOST_EVENT_BATTERY));
+ lpc_set_host_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_BATTERY));
return PWR_STATE_IDLE;
}
@@ -486,13 +486,13 @@ void charge_state_machine_task(void)
/* Setup LPC direct memmap */
ctx.memmap_batt_volt = (uint32_t *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_VOLT);
+ EC_MEMMAP_BATT_VOLT);
ctx.memmap_batt_rate = (uint32_t *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_RATE);
+ EC_MEMMAP_BATT_RATE);
ctx.memmap_batt_cap = (uint32_t *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_CAP);
+ EC_MEMMAP_BATT_CAP);
ctx.memmap_batt_flags = (uint8_t *)(lpc_get_memmap_range() +
- EC_LPC_MEMMAP_BATT_FLAG);
+ EC_MEMMAP_BATT_FLAG);
while (1) {
diff --git a/common/flash_commands.c b/common/flash_commands.c
index cd4497301c..239a57661f 100644
--- a/common/flash_commands.c
+++ b/common/flash_commands.c
@@ -201,131 +201,131 @@ DECLARE_CONSOLE_COMMAND(flashwp, command_flash_wp);
int flash_command_get_info(uint8_t *data, int *resp_size)
{
- struct lpc_response_flash_info *r =
- (struct lpc_response_flash_info *)data;
+ struct ec_response_flash_info *r =
+ (struct ec_response_flash_info *)data;
r->flash_size = flash_get_size();
r->write_block_size = flash_get_write_block_size();
r->erase_block_size = flash_get_erase_block_size();
r->protect_block_size = flash_get_protect_block_size();
- *resp_size = sizeof(struct lpc_response_flash_info);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_flash_info);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_INFO, flash_command_get_info);
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_INFO, flash_command_get_info);
#ifdef SUPPORT_CHECKSUM
int flash_command_checksum(uint8_t *data, int *resp_size)
{
- struct lpc_params_flash_checksum *p =
- (struct lpc_params_flash_checksum *)data;
- struct lpc_response_flash_checksum *r =
- (struct lpc_response_flash_checksum *)data;
+ struct ec_params_flash_checksum *p =
+ (struct ec_params_flash_checksum *)data;
+ struct ec_response_flash_checksum *r =
+ (struct ec_response_flash_checksum *)data;
uint8_t cs, byte;
int j;
for (cs = 0, j = 0; j < p->size; ++j) {
if (flash_read(p->offset + j, 1, &byte))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
BYTE_IN(cs, byte);
}
r->checksum = cs;
- *resp_size = sizeof(struct lpc_response_flash_checksum);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_flash_checksum);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_CHECKSUM, flash_command_checksum);
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_CHECKSUM, flash_command_checksum);
#endif
int flash_command_read(uint8_t *data, int *resp_size)
{
- struct lpc_params_flash_read *p =
- (struct lpc_params_flash_read *)data;
- struct lpc_response_flash_read *r =
- (struct lpc_response_flash_read *)data;
+ struct ec_params_flash_read *p =
+ (struct ec_params_flash_read *)data;
+ struct ec_response_flash_read *r =
+ (struct ec_response_flash_read *)data;
if (p->size > sizeof(r->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
if (flash_read(p->offset, p->size, r->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
- *resp_size = sizeof(struct lpc_response_flash_read);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_flash_read);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_READ, flash_command_read);
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_READ, flash_command_read);
int flash_command_write(uint8_t *data, int *resp_size)
{
- struct lpc_params_flash_write *p =
- (struct lpc_params_flash_write *)data;
+ struct ec_params_flash_write *p =
+ (struct ec_params_flash_write *)data;
if (p->size > sizeof(p->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
if (system_unsafe_to_overwrite(p->offset, p->size))
- return EC_LPC_RESULT_ACCESS_DENIED;
+ return EC_RES_ACCESS_DENIED;
if (flash_write(p->offset, p->size, p->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_WRITE, flash_command_write);
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_WRITE, flash_command_write);
int flash_command_erase(uint8_t *data, int *resp_size)
{
- struct lpc_params_flash_erase *p =
- (struct lpc_params_flash_erase *)data;
+ struct ec_params_flash_erase *p =
+ (struct ec_params_flash_erase *)data;
if (system_unsafe_to_overwrite(p->offset, p->size))
- return EC_LPC_RESULT_ACCESS_DENIED;
+ return EC_RES_ACCESS_DENIED;
if (flash_erase(p->offset, p->size))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_ERASE, flash_command_erase);
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_ERASE, flash_command_erase);
int flash_command_wp_enable(uint8_t *data, int *resp_size)
{
- struct lpc_params_flash_wp_enable *p =
- (struct lpc_params_flash_wp_enable *)data;
+ struct ec_params_flash_wp_enable *p =
+ (struct ec_params_flash_wp_enable *)data;
return flash_lock_protect(p->enable_wp ? 1 : 0);
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_WP_ENABLE,
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_WP_ENABLE,
flash_command_wp_enable);
int flash_command_wp_get_state(uint8_t *data, int *resp_size)
{
- struct lpc_response_flash_wp_enable *p =
- (struct lpc_response_flash_wp_enable *)data;
+ struct ec_response_flash_wp_enable *p =
+ (struct ec_response_flash_wp_enable *)data;
if (flash_get_protect_lock() & FLASH_PROTECT_LOCK_SET)
p->enable_wp = 1;
else
p->enable_wp = 0;
- *resp_size = sizeof(struct lpc_response_flash_wp_enable);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_flash_wp_enable);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_WP_GET_STATE,
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_WP_GET_STATE,
flash_command_wp_get_state);
int flash_command_wp_set_range(uint8_t *data, int *resp_size)
{
- struct lpc_params_flash_wp_range *p =
- (struct lpc_params_flash_wp_range *)data;
- enum lpc_status ret;
+ struct ec_params_flash_wp_range *p =
+ (struct ec_params_flash_wp_range *)data;
+ enum ec_status ret;
if (p->size)
ret = flash_set_protect(p->offset, p->size, 1);
@@ -334,14 +334,14 @@ int flash_command_wp_set_range(uint8_t *data, int *resp_size)
return ret;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_WP_SET_RANGE,
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_WP_SET_RANGE,
flash_command_wp_set_range);
int flash_command_wp_get_range(uint8_t *data, int *resp_size)
{
- struct lpc_response_flash_wp_range *p =
- (struct lpc_response_flash_wp_range *)data;
+ struct ec_response_flash_wp_range *p =
+ (struct ec_response_flash_wp_range *)data;
int pbsize = flash_get_protect_block_size();
int banks = flash_get_size() / pbsize;
const uint8_t *blocks;
@@ -375,8 +375,8 @@ int flash_command_wp_get_range(uint8_t *data, int *resp_size)
p->size = (max - min + 1) * pbsize;
}
- *resp_size = sizeof(struct lpc_response_flash_wp_range);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_flash_wp_range);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_FLASH_WP_GET_RANGE,
+DECLARE_HOST_COMMAND(EC_CMD_FLASH_WP_GET_RANGE,
flash_command_wp_get_range);
diff --git a/common/host_command.c b/common/host_command.c
index 5b202c8248..7e1a2f53d6 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -9,7 +9,7 @@
#include "host_command.h"
#include "link_defs.h"
#include "lpc.h"
-#include "lpc_commands.h"
+#include "ec_commands.h"
#include "system.h"
#include "task.h"
#include "timer.h"
@@ -31,10 +31,10 @@ void host_command_received(int slot, int command)
/* If this is the reboot command, reboot immediately. This gives
* the host processor a way to unwedge the EC even if it's busy with
* some other command. */
- if (command == EC_LPC_COMMAND_REBOOT) {
+ if (command == EC_CMD_REBOOT) {
system_reset(1);
/* Reset should never return; if it does, post an error */
- host_send_result(slot, EC_LPC_RESULT_ERROR);
+ host_send_result(slot, EC_RES_ERROR);
return;
}
@@ -47,21 +47,21 @@ void host_command_received(int slot, int command)
static int host_command_proto_version(uint8_t *data, int *resp_size)
{
- struct lpc_response_proto_version *r =
- (struct lpc_response_proto_version *)data;
+ struct ec_response_proto_version *r =
+ (struct ec_response_proto_version *)data;
- r->version = EC_LPC_PROTO_VERSION;
+ r->version = EC_PROTO_VERSION;
- *resp_size = sizeof(struct lpc_response_proto_version);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_proto_version);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PROTO_VERSION,
+DECLARE_HOST_COMMAND(EC_CMD_PROTO_VERSION,
host_command_proto_version);
static int host_command_hello(uint8_t *data, int *resp_size)
{
- struct lpc_params_hello *p = (struct lpc_params_hello *)data;
- struct lpc_response_hello *r = (struct lpc_response_hello *)data;
+ struct ec_params_hello *p = (struct ec_params_hello *)data;
+ struct ec_response_hello *r = (struct ec_response_hello *)data;
uint32_t d = p->in_data;
CPRINTF("[LPC Hello 0x%08x]\n", d);
@@ -78,36 +78,36 @@ static int host_command_hello(uint8_t *data, int *resp_size)
CPUTS("[LPC sending hello back]\n");
r->out_data = d + 0x01020304;
- *resp_size = sizeof(struct lpc_response_hello);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_hello);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HELLO, host_command_hello);
+DECLARE_HOST_COMMAND(EC_CMD_HELLO, host_command_hello);
static int host_command_read_test(uint8_t *data, int *resp_size)
{
- struct lpc_params_read_test *p = (struct lpc_params_read_test *)data;
- struct lpc_response_read_test *r =
- (struct lpc_response_read_test *)data;
+ struct ec_params_read_test *p = (struct ec_params_read_test *)data;
+ struct ec_response_read_test *r =
+ (struct ec_response_read_test *)data;
int offset = p->offset;
int size = p->size / sizeof(uint32_t);
int i;
if (size > ARRAY_SIZE(r->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
for (i = 0; i < size; i++)
r->data[i] = offset + i;
- *resp_size = sizeof(struct lpc_response_read_test);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_read_test);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_READ_TEST, host_command_read_test);
+DECLARE_HOST_COMMAND(EC_CMD_READ_TEST, host_command_read_test);
/* ACPI query event handler. Note that the returned value is NOT actually
- * an EC_LPC_RESULT enum; it's 0 if no event was pending, or the 1-based
+ * an EC_RES enum; it's 0 if no event was pending, or the 1-based
* index of the lowest bit which was set. */
static int host_command_acpi_query_event(uint8_t *data, int *resp_size)
{
@@ -124,7 +124,7 @@ static int host_command_acpi_query_event(uint8_t *data, int *resp_size)
/* No events pending */
return 0;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_ACPI_QUERY_EVENT,
+DECLARE_HOST_COMMAND(EC_CMD_ACPI_QUERY_EVENT,
host_command_acpi_query_event);
@@ -155,12 +155,12 @@ static void command_process(int slot)
if (cmd) {
int size = 0;
int res = cmd->handler(data, &size);
- if ((res == EC_LPC_RESULT_SUCCESS) && size)
+ if ((res == EC_RES_SUCCESS) && size)
host_send_response(slot, data, size);
else
host_send_result(slot, res);
} else {
- host_send_result(slot, EC_LPC_RESULT_INVALID_COMMAND);
+ host_send_result(slot, EC_RES_INVALID_COMMAND);
}
}
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index d009d5df65..c9cb0e0cc6 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -62,85 +62,85 @@ DECLARE_CONSOLE_COMMAND(hostevent, command_host_event);
static int host_event_get_smi_mask(uint8_t *data, int *resp_size)
{
- struct lpc_response_host_event_mask *r =
- (struct lpc_response_host_event_mask *)data;
+ struct ec_response_host_event_mask *r =
+ (struct ec_response_host_event_mask *)data;
r->mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SMI);
- *resp_size = sizeof(struct lpc_response_host_event_mask);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_host_event_mask);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_GET_SMI_MASK,
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_GET_SMI_MASK,
host_event_get_smi_mask);
static int host_event_get_sci_mask(uint8_t *data, int *resp_size)
{
- struct lpc_response_host_event_mask *r =
- (struct lpc_response_host_event_mask *)data;
+ struct ec_response_host_event_mask *r =
+ (struct ec_response_host_event_mask *)data;
r->mask = lpc_get_host_event_mask(LPC_HOST_EVENT_SCI);
- *resp_size = sizeof(struct lpc_response_host_event_mask);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_host_event_mask);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_GET_SCI_MASK,
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_GET_SCI_MASK,
host_event_get_sci_mask);
static int host_event_get_wake_mask(uint8_t *data, int *resp_size)
{
- struct lpc_response_host_event_mask *r =
- (struct lpc_response_host_event_mask *)data;
+ struct ec_response_host_event_mask *r =
+ (struct ec_response_host_event_mask *)data;
r->mask = lpc_get_host_event_mask(LPC_HOST_EVENT_WAKE);
- *resp_size = sizeof(struct lpc_response_host_event_mask);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_host_event_mask);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_GET_WAKE_MASK,
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_GET_WAKE_MASK,
host_event_get_wake_mask);
static int host_event_set_smi_mask(uint8_t *data, int *resp_size)
{
- const struct lpc_params_host_event_mask *p =
- (const struct lpc_params_host_event_mask *)data;
+ const struct ec_params_host_event_mask *p =
+ (const struct ec_params_host_event_mask *)data;
lpc_set_host_event_mask(LPC_HOST_EVENT_SMI, p->mask);
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_SET_SMI_MASK,
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_SET_SMI_MASK,
host_event_set_smi_mask);
static int host_event_set_sci_mask(uint8_t *data, int *resp_size)
{
- const struct lpc_params_host_event_mask *p =
- (const struct lpc_params_host_event_mask *)data;
+ const struct ec_params_host_event_mask *p =
+ (const struct ec_params_host_event_mask *)data;
lpc_set_host_event_mask(LPC_HOST_EVENT_SCI, p->mask);
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_SET_SCI_MASK,
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_SET_SCI_MASK,
host_event_set_sci_mask);
static int host_event_set_wake_mask(uint8_t *data, int *resp_size)
{
- const struct lpc_params_host_event_mask *p =
- (const struct lpc_params_host_event_mask *)data;
+ const struct ec_params_host_event_mask *p =
+ (const struct ec_params_host_event_mask *)data;
lpc_set_host_event_mask(LPC_HOST_EVENT_WAKE, p->mask);
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_SET_WAKE_MASK,
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_SET_WAKE_MASK,
host_event_set_wake_mask);
static int host_event_clear(uint8_t *data, int *resp_size)
{
- const struct lpc_params_host_event_mask *p =
- (const struct lpc_params_host_event_mask *)data;
+ const struct ec_params_host_event_mask *p =
+ (const struct ec_params_host_event_mask *)data;
lpc_clear_host_events(p->mask);
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_HOST_EVENT_CLEAR, host_event_clear);
+DECLARE_HOST_COMMAND(EC_CMD_HOST_EVENT_CLEAR, host_event_clear);
diff --git a/common/keyboard.c b/common/keyboard.c
index 198b6a9817..2163de3e00 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -13,7 +13,7 @@
#include "hooks.h"
#include "lightbar.h"
#include "lpc.h"
-#include "lpc_commands.h"
+#include "ec_commands.h"
#include "registers.h"
#include "system.h"
#include "task.h"
@@ -254,7 +254,7 @@ static void keyboard_wakeup(void)
{
#ifdef CONFIG_LPC
lpc_set_host_events(
- EC_LPC_HOST_EVENT_MASK(EC_LPC_HOST_EVENT_KEY_PRESSED));
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED));
#endif
}
diff --git a/common/lightbar.c b/common/lightbar.c
index d2b49c340b..7d762690af 100644
--- a/common/lightbar.c
+++ b/common/lightbar.c
@@ -685,7 +685,7 @@ static const uint8_t dump_reglist[] = {
0x18, 0x19, 0x1a
};
-static void do_cmd_dump(struct lpc_params_lightbar_cmd *ptr)
+static void do_cmd_dump(struct ec_params_lightbar_cmd *ptr)
{
int i;
uint8_t reg;
@@ -720,13 +720,13 @@ static void do_cmd_rgb(uint8_t led,
static int lpc_cmd_lightbar(uint8_t *data, int *resp_size)
{
- struct lpc_params_lightbar_cmd *ptr =
- (struct lpc_params_lightbar_cmd *)data;
+ struct ec_params_lightbar_cmd *ptr =
+ (struct ec_params_lightbar_cmd *)data;
switch (ptr->in.cmd) {
case LIGHTBAR_CMD_DUMP:
do_cmd_dump(ptr);
- *resp_size = sizeof(struct lpc_params_lightbar_cmd);
+ *resp_size = sizeof(struct ec_params_lightbar_cmd);
break;
case LIGHTBAR_CMD_OFF:
lightbar_off();
@@ -756,17 +756,17 @@ static int lpc_cmd_lightbar(uint8_t *data, int *resp_size)
break;
case LIGHTBAR_CMD_GET_SEQ:
ptr->out.get_seq.num = current_state;
- *resp_size = sizeof(struct lpc_params_lightbar_cmd);
+ *resp_size = sizeof(struct ec_params_lightbar_cmd);
break;
default:
CPRINTF("[invalid lightbar cmd 0x%x]\n", ptr->in.cmd);
- return EC_LPC_RESULT_INVALID_PARAM;
+ return EC_RES_INVALID_PARAM;
}
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_LIGHTBAR_CMD, lpc_cmd_lightbar);
+DECLARE_HOST_COMMAND(EC_CMD_LIGHTBAR_CMD, lpc_cmd_lightbar);
/****************************************************************************/
@@ -813,7 +813,7 @@ static int command_lightbar(int argc, char **argv)
{
int i;
uint8_t num;
- struct lpc_params_lightbar_cmd params;
+ struct ec_params_lightbar_cmd params;
if (1 == argc) { /* no args = dump 'em all */
do_cmd_dump(&params);
diff --git a/common/pstore_commands.c b/common/pstore_commands.c
index 036f5d6b3b..fdd0eaf26c 100644
--- a/common/pstore_commands.c
+++ b/common/pstore_commands.c
@@ -13,26 +13,26 @@
int pstore_command_get_info(uint8_t *data, int *resp_size)
{
- struct lpc_response_pstore_info *r =
- (struct lpc_response_pstore_info *)data;
+ struct ec_response_pstore_info *r =
+ (struct ec_response_pstore_info *)data;
ASSERT(EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE <=
eeprom_get_block_count());
r->pstore_size = EEPROM_BLOCK_COUNT_PSTORE * eeprom_get_block_size();
r->access_size = sizeof(uint32_t);
- *resp_size = sizeof(struct lpc_response_pstore_info);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_pstore_info);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_INFO, pstore_command_get_info);
+DECLARE_HOST_COMMAND(EC_CMD_PSTORE_INFO, pstore_command_get_info);
int pstore_command_read(uint8_t *data, int *resp_size)
{
- struct lpc_params_pstore_read *p =
- (struct lpc_params_pstore_read *)data;
- struct lpc_response_pstore_read *r =
- (struct lpc_response_pstore_read *)data;
+ struct ec_params_pstore_read *p =
+ (struct ec_params_pstore_read *)data;
+ struct ec_response_pstore_read *r =
+ (struct ec_response_pstore_read *)data;
char *dest = r->data;
int block_size = eeprom_get_block_size();
int block = p->offset / block_size + EEPROM_BLOCK_COUNT_PSTORE;
@@ -40,7 +40,7 @@ int pstore_command_read(uint8_t *data, int *resp_size)
int bytes_left = p->size;
if (p->size > sizeof(r->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
while (bytes_left) {
/* Read what we can from the current block */
@@ -48,10 +48,10 @@ int pstore_command_read(uint8_t *data, int *resp_size)
if (block >=
EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE)
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
if (eeprom_read(block, offset, bytes_this, dest))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
/* Continue to the next block if necessary */
offset = 0;
@@ -60,16 +60,16 @@ int pstore_command_read(uint8_t *data, int *resp_size)
dest += bytes_this;
}
- *resp_size = sizeof(struct lpc_response_pstore_read);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_pstore_read);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_READ, pstore_command_read);
+DECLARE_HOST_COMMAND(EC_CMD_PSTORE_READ, pstore_command_read);
int pstore_command_write(uint8_t *data, int *resp_size)
{
- struct lpc_params_pstore_write *p =
- (struct lpc_params_pstore_write *)data;
+ struct ec_params_pstore_write *p =
+ (struct ec_params_pstore_write *)data;
const char *src = p->data;
int block_size = eeprom_get_block_size();
@@ -78,7 +78,7 @@ int pstore_command_write(uint8_t *data, int *resp_size)
int bytes_left = p->size;
if (p->size > sizeof(p->data))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
while (bytes_left) {
/* Write what we can to the current block */
@@ -86,10 +86,10 @@ int pstore_command_write(uint8_t *data, int *resp_size)
if (block >=
EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE)
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
if (eeprom_write(block, offset, bytes_this, src))
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
/* Continue to the next block if necessary */
offset = 0;
@@ -98,6 +98,6 @@ int pstore_command_write(uint8_t *data, int *resp_size)
src += bytes_this;
}
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_WRITE, pstore_command_write);
+DECLARE_HOST_COMMAND(EC_CMD_PSTORE_WRITE, pstore_command_write);
diff --git a/common/pwm_commands.c b/common/pwm_commands.c
index 8009cf2ff9..3a35ff8637 100644
--- a/common/pwm_commands.c
+++ b/common/pwm_commands.c
@@ -12,51 +12,51 @@
int pwm_command_get_fan_rpm(uint8_t *data, int *resp_size)
{
- struct lpc_response_pwm_get_fan_rpm *r =
- (struct lpc_response_pwm_get_fan_rpm *)data;
+ struct ec_response_pwm_get_fan_rpm *r =
+ (struct ec_response_pwm_get_fan_rpm *)data;
r->rpm = pwm_get_fan_target_rpm();
- *resp_size = sizeof(struct lpc_response_pwm_get_fan_rpm);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_pwm_get_fan_rpm);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PWM_GET_FAN_RPM, pwm_command_get_fan_rpm);
+DECLARE_HOST_COMMAND(EC_CMD_PWM_GET_FAN_RPM, pwm_command_get_fan_rpm);
int pwm_command_set_fan_target_rpm(uint8_t *data, int *resp_size)
{
- struct lpc_params_pwm_set_fan_target_rpm *p =
- (struct lpc_params_pwm_set_fan_target_rpm *)data;
+ struct ec_params_pwm_set_fan_target_rpm *p =
+ (struct ec_params_pwm_set_fan_target_rpm *)data;
#ifdef CONFIG_TASK_THERMAL
thermal_toggle_auto_fan_ctrl(0);
#endif
pwm_set_fan_target_rpm(p->rpm);
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PWM_SET_FAN_TARGET_RPM,
+DECLARE_HOST_COMMAND(EC_CMD_PWM_SET_FAN_TARGET_RPM,
pwm_command_set_fan_target_rpm);
int pwm_command_get_keyboard_backlight(uint8_t *data, int *resp_size)
{
- struct lpc_response_pwm_get_keyboard_backlight *r =
- (struct lpc_response_pwm_get_keyboard_backlight *)data;
+ struct ec_response_pwm_get_keyboard_backlight *r =
+ (struct ec_response_pwm_get_keyboard_backlight *)data;
r->percent = pwm_get_keyboard_backlight();
- *resp_size = sizeof(struct lpc_response_pwm_get_keyboard_backlight);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_pwm_get_keyboard_backlight);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PWM_GET_KEYBOARD_BACKLIGHT,
+DECLARE_HOST_COMMAND(EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT,
pwm_command_get_keyboard_backlight);
int pwm_command_set_keyboard_backlight(uint8_t *data, int *resp_size)
{
- struct lpc_params_pwm_set_keyboard_backlight *p =
- (struct lpc_params_pwm_set_keyboard_backlight *)data;
+ struct ec_params_pwm_set_keyboard_backlight *p =
+ (struct ec_params_pwm_set_keyboard_backlight *)data;
pwm_set_keyboard_backlight(p->percent);
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PWM_SET_KEYBOARD_BACKLIGHT,
+DECLARE_HOST_COMMAND(EC_CMD_PWM_SET_KEYBOARD_BACKLIGHT,
pwm_command_set_keyboard_backlight);
diff --git a/common/system_common.c b/common/system_common.c
index 0eb82d065c..92bcacdd71 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -11,7 +11,7 @@
#include "hooks.h"
#include "host_command.h"
#include "lpc.h"
-#include "lpc_commands.h"
+#include "ec_commands.h"
#include "system.h"
#include "task.h"
#include "uart.h"
@@ -545,8 +545,8 @@ DECLARE_CONSOLE_COMMAND(reboot, command_reboot);
static int host_command_get_version(uint8_t *data, int *resp_size)
{
- struct lpc_response_get_version *r =
- (struct lpc_response_get_version *)data;
+ struct ec_response_get_version *r =
+ (struct ec_response_get_version *)data;
strzcpy(r->version_string_ro, system_get_version(SYSTEM_IMAGE_RO),
sizeof(r->version_string_ro));
@@ -557,59 +557,59 @@ static int host_command_get_version(uint8_t *data, int *resp_size)
switch (system_get_image_copy()) {
case SYSTEM_IMAGE_RO:
- r->current_image = EC_LPC_IMAGE_RO;
+ r->current_image = EC_IMAGE_RO;
break;
case SYSTEM_IMAGE_RW_A:
- r->current_image = EC_LPC_IMAGE_RW_A;
+ r->current_image = EC_IMAGE_RW_A;
break;
case SYSTEM_IMAGE_RW_B:
- r->current_image = EC_LPC_IMAGE_RW_B;
+ r->current_image = EC_IMAGE_RW_B;
break;
default:
- r->current_image = EC_LPC_IMAGE_UNKNOWN;
+ r->current_image = EC_IMAGE_UNKNOWN;
break;
}
- *resp_size = sizeof(struct lpc_response_get_version);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_get_version);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_GET_VERSION, host_command_get_version);
+DECLARE_HOST_COMMAND(EC_CMD_GET_VERSION, host_command_get_version);
static int host_command_build_info(uint8_t *data, int *resp_size)
{
- struct lpc_response_get_build_info *r =
- (struct lpc_response_get_build_info *)data;
+ struct ec_response_get_build_info *r =
+ (struct ec_response_get_build_info *)data;
strzcpy(r->build_string, system_get_build_info(),
sizeof(r->build_string));
- *resp_size = sizeof(struct lpc_response_get_build_info);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_get_build_info);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_GET_BUILD_INFO, host_command_build_info);
+DECLARE_HOST_COMMAND(EC_CMD_GET_BUILD_INFO, host_command_build_info);
static int host_command_get_chip_info(uint8_t *data, int *resp_size)
{
- struct lpc_response_get_chip_info *r =
- (struct lpc_response_get_chip_info *)data;
+ struct ec_response_get_chip_info *r =
+ (struct ec_response_get_chip_info *)data;
strzcpy(r->vendor, system_get_chip_vendor(), sizeof(r->vendor));
strzcpy(r->name, system_get_chip_name(), sizeof(r->name));
strzcpy(r->revision, system_get_chip_revision(), sizeof(r->revision));
- *resp_size = sizeof(struct lpc_response_get_chip_info);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_get_chip_info);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_GET_CHIP_INFO, host_command_get_chip_info);
+DECLARE_HOST_COMMAND(EC_CMD_GET_CHIP_INFO, host_command_get_chip_info);
#ifdef CONFIG_REBOOT_EC
static void clean_busy_bits(void) {
#ifdef CONFIG_LPC
- host_send_result(0, EC_LPC_RESULT_SUCCESS);
- host_send_result(1, EC_LPC_RESULT_SUCCESS);
+ host_send_result(0, EC_RES_SUCCESS);
+ host_send_result(1, EC_RES_SUCCESS);
#endif
}
@@ -617,27 +617,27 @@ int host_command_reboot(uint8_t *data, int *resp_size)
{
enum system_image_copy_t copy;
- struct lpc_params_reboot_ec *p =
- (struct lpc_params_reboot_ec *)data;
+ struct ec_params_reboot_ec *p =
+ (struct ec_params_reboot_ec *)data;
int recovery_request = p->reboot_flags &
- EC_LPC_COMMAND_REBOOT_BIT_RECOVERY;
+ EC_CMD_REBOOT_BIT_RECOVERY;
/* TODO: (crosbug.com/p/7468) For this command to be allowed, WP must
* be disabled. */
switch (p->target) {
- case EC_LPC_IMAGE_RO:
+ case EC_IMAGE_RO:
copy = SYSTEM_IMAGE_RO;
break;
- case EC_LPC_IMAGE_RW_A:
+ case EC_IMAGE_RW_A:
copy = SYSTEM_IMAGE_RW_A;
break;
- case EC_LPC_IMAGE_RW_B:
+ case EC_IMAGE_RW_B:
copy = SYSTEM_IMAGE_RW_B;
break;
default:
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
}
clean_busy_bits();
@@ -650,7 +650,7 @@ int host_command_reboot(uint8_t *data, int *resp_size)
*
* If we DO get down here, something went wrong in the reboot, so
* return error. */
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_REBOOT_EC, host_command_reboot);
+DECLARE_HOST_COMMAND(EC_CMD_REBOOT_EC, host_command_reboot);
#endif /* CONFIG_REBOOT_EC */
diff --git a/common/temp_sensor.c b/common/temp_sensor.c
index 013b4f0d87..9f615ae6d3 100644
--- a/common/temp_sensor.c
+++ b/common/temp_sensor.c
@@ -12,7 +12,7 @@
#include "gpio.h"
#include "i2c.h"
#include "lpc.h"
-#include "lpc_commands.h"
+#include "ec_commands.h"
#include "peci.h"
#include "task.h"
#include "temp_sensor.h"
@@ -71,7 +71,7 @@ void poll_all_sensors(void)
static void update_lpc_mapped_memory(void)
{
int i, t;
- uint8_t *mapped = lpc_get_memmap_range() + EC_LPC_MEMMAP_TEMP_SENSOR;
+ uint8_t *mapped = lpc_get_memmap_range() + EC_MEMMAP_TEMP_SENSOR;
memset(mapped, 0xff, 16);
@@ -82,7 +82,7 @@ static void update_lpc_mapped_memory(void)
}
t = temp_sensor_read(i);
if (t != -1)
- mapped[i] = t - EC_LPC_TEMP_SENSOR_OFFSET;
+ mapped[i] = t - EC_TEMP_SENSOR_OFFSET;
else
mapped[i] = 0xfe;
}
@@ -126,4 +126,3 @@ static int command_temps(int argc, char **argv)
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(temps, command_temps);
-
diff --git a/common/thermal.c b/common/thermal.c
index e9296b6433..9aa3e5d066 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -10,7 +10,7 @@
#include "console.h"
#include "gpio.h"
#include "lpc.h"
-#include "lpc_commands.h"
+#include "ec_commands.h"
#include "pwm.h"
#include "task.h"
#include "temp_sensor.h"
@@ -89,14 +89,14 @@ int thermal_toggle_auto_fan_ctrl(int auto_fan_on)
static void smi_overheated_warning(void)
{
lpc_set_host_events(
- EC_LPC_HOST_EVENT_MASK(EC_LPC_HOST_EVENT_THERMAL_OVERLOAD));
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL_OVERLOAD));
}
static void smi_sensor_failure_warning(void)
{
lpc_set_host_events(
- EC_LPC_HOST_EVENT_MASK(EC_LPC_HOST_EVENT_THERMAL));
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_THERMAL));
}
diff --git a/common/thermal_commands.c b/common/thermal_commands.c
index f3476f8348..aedbf63f80 100644
--- a/common/thermal_commands.c
+++ b/common/thermal_commands.c
@@ -11,40 +11,40 @@
int thermal_command_set_threshold(uint8_t *data, int *resp_size)
{
- struct lpc_params_thermal_set_threshold *p =
- (struct lpc_params_thermal_set_threshold *)data;
+ struct ec_params_thermal_set_threshold *p =
+ (struct ec_params_thermal_set_threshold *)data;
if (thermal_set_threshold(p->sensor_type, p->threshold_id, p->value))
- return EC_LPC_RESULT_ERROR;
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_ERROR;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_THERMAL_SET_THRESHOLD,
+DECLARE_HOST_COMMAND(EC_CMD_THERMAL_SET_THRESHOLD,
thermal_command_set_threshold);
int thermal_command_get_threshold(uint8_t *data, int *resp_size)
{
- struct lpc_params_thermal_get_threshold *p =
- (struct lpc_params_thermal_get_threshold *)data;
- struct lpc_response_thermal_get_threshold *r =
- (struct lpc_response_thermal_get_threshold *)data;
+ struct ec_params_thermal_get_threshold *p =
+ (struct ec_params_thermal_get_threshold *)data;
+ struct ec_response_thermal_get_threshold *r =
+ (struct ec_response_thermal_get_threshold *)data;
r->value = thermal_get_threshold(p->sensor_type, p->threshold_id);
if (r->value == -1)
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
- *resp_size = sizeof(struct lpc_response_thermal_get_threshold);
- return EC_LPC_RESULT_SUCCESS;
+ *resp_size = sizeof(struct ec_response_thermal_get_threshold);
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_THERMAL_GET_THRESHOLD,
+DECLARE_HOST_COMMAND(EC_CMD_THERMAL_GET_THRESHOLD,
thermal_command_get_threshold);
int thermal_command_auto_fan_ctrl(uint8_t *data, int *resp_size)
{
if (thermal_toggle_auto_fan_ctrl(1))
- return EC_LPC_RESULT_ERROR;
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_ERROR;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_THERMAL_AUTO_FAN_CTRL,
+DECLARE_HOST_COMMAND(EC_CMD_THERMAL_AUTO_FAN_CTRL,
thermal_command_auto_fan_ctrl);
diff --git a/common/usb_charge_commands.c b/common/usb_charge_commands.c
index ad0380186d..4e69208622 100644
--- a/common/usb_charge_commands.c
+++ b/common/usb_charge_commands.c
@@ -17,8 +17,8 @@
int usb_charge_command_set_mode(uint8_t *data, int *resp_size)
{
- struct lpc_params_usb_charge_set_mode *p =
- (struct lpc_params_usb_charge_set_mode *)data;
+ struct ec_params_usb_charge_set_mode *p =
+ (struct ec_params_usb_charge_set_mode *)data;
int rv;
CPRINTF("[Setting USB port %d to mode %d]\n",
@@ -26,9 +26,9 @@ int usb_charge_command_set_mode(uint8_t *data, int *resp_size)
rv = usb_charge_set_mode(p->usb_port_id, p->mode);
if (rv != EC_SUCCESS)
- return EC_LPC_RESULT_ERROR;
+ return EC_RES_ERROR;
- return EC_LPC_RESULT_SUCCESS;
+ return EC_RES_SUCCESS;
}
-DECLARE_HOST_COMMAND(EC_LPC_COMMAND_USB_CHARGE_SET_MODE,
+DECLARE_HOST_COMMAND(EC_CMD_USB_CHARGE_SET_MODE,
usb_charge_command_set_mode);