summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/host/build.mk2
-rw-r--r--chip/host/i2c.c20
-rw-r--r--chip/host/spi_controller.c (renamed from chip/host/spi_master.c)2
3 files changed, 12 insertions, 12 deletions
diff --git a/chip/host/build.mk b/chip/host/build.mk
index 8d2d69f3c3..6f8ea250ca 100644
--- a/chip/host/build.mk
+++ b/chip/host/build.mk
@@ -9,7 +9,7 @@
CORE:=host
chip-y=system.o gpio.o uart.o persistence.o flash.o lpc.o reboot.o \
- clock.o spi_master.o trng.o
+ clock.o spi_controller.o trng.o
ifndef CONFIG_KEYBOARD_NOT_RAW
chip-$(HAS_TASK_KEYSCAN)+=keyboard_raw.o
diff --git a/chip/host/i2c.c b/chip/host/i2c.c
index 8e6f086b4f..ba4ab376d2 100644
--- a/chip/host/i2c.c
+++ b/chip/host/i2c.c
@@ -15,7 +15,7 @@
struct i2c_dev {
int port;
- uint16_t slave_addr_flags;
+ uint16_t addr_flags;
int valid;
};
@@ -29,7 +29,7 @@ static void detach_init(void)
}
DECLARE_HOOK(HOOK_INIT, detach_init, HOOK_PRIO_FIRST);
-int test_detach_i2c(const int port, const uint16_t slave_addr_flags)
+int test_detach_i2c(const int port, const uint16_t addr_flags)
{
int i;
@@ -41,20 +41,20 @@ int test_detach_i2c(const int port, const uint16_t slave_addr_flags)
return EC_ERROR_OVERFLOW;
detached_devs[i].port = port;
- detached_devs[i].slave_addr_flags = slave_addr_flags;
+ detached_devs[i].addr_flags = addr_flags;
detached_devs[i].valid = 1;
return EC_SUCCESS;
}
-int test_attach_i2c(const int port, const uint16_t slave_addr_flags)
+int test_attach_i2c(const int port, const uint16_t addr_flags)
{
int i;
for (i = 0; i < MAX_DETACHED_DEV_COUNT; ++i)
if (detached_devs[i].valid &&
detached_devs[i].port == port &&
- detached_devs[i].slave_addr_flags == slave_addr_flags)
+ detached_devs[i].addr_flags == addr_flags)
break;
if (i == MAX_DETACHED_DEV_COUNT)
@@ -65,29 +65,29 @@ int test_attach_i2c(const int port, const uint16_t slave_addr_flags)
}
static int test_check_detached(const int port,
- const uint16_t slave_addr_flags)
+ const uint16_t addr_flags)
{
int i;
for (i = 0; i < MAX_DETACHED_DEV_COUNT; ++i)
if (detached_devs[i].valid &&
detached_devs[i].port == port &&
- detached_devs[i].slave_addr_flags == slave_addr_flags)
+ detached_devs[i].addr_flags == addr_flags)
return 1;
return 0;
}
-int chip_i2c_xfer(const int port, const uint16_t slave_addr_flags,
+int chip_i2c_xfer(const int port, const uint16_t addr_flags,
const uint8_t *out, int out_size,
uint8_t *in, int in_size, int flags)
{
const struct test_i2c_xfer *p;
int rv;
- if (test_check_detached(port, slave_addr_flags))
+ if (test_check_detached(port, addr_flags))
return EC_ERROR_UNKNOWN;
for (p = __test_i2c_xfer; p < __test_i2c_xfer_end; ++p) {
- rv = p->routine(port, slave_addr_flags,
+ rv = p->routine(port, addr_flags,
out, out_size,
in, in_size, flags);
if (rv != EC_ERROR_INVAL)
diff --git a/chip/host/spi_master.c b/chip/host/spi_controller.c
index f36a9cf40b..c7afea5d39 100644
--- a/chip/host/spi_master.c
+++ b/chip/host/spi_controller.c
@@ -2,7 +2,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
- * Mock Master SPI driver for unit test.
+ * Mock SPI Controller driver for unit test.
*/
#include <stdint.h>