summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-24 11:18:47 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-25 01:32:15 +0000
commitdf541c6ffdc3ecf2802bad1c235e730cd29f8bfb (patch)
tree5de1078e831ec5e3f3f7437b6e5e8c96b4156a69 /chip
parent4a1ecb67f9ff1745422aecdd5cc70a9f630d7dc8 (diff)
downloadchrome-ec-df541c6ffdc3ecf2802bad1c235e730cd29f8bfb.tar.gz
cleanup: rename I2C_PORT_HOST to I2C_PORT_MASTER
Previously, it was really confusing whether I2C_PORT_HOST meant the port where the EC was the master, or the port used to talk to the AP. No functional changes, just a global find/replace and some tidying of unused comments. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; pass unit tests Change-Id: Ia591ba4577d3399729556e0234ba0db3a0e3c5ea Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174546 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/stm32/i2c-stm32f.c22
-rw-r--r--chip/stm32/i2c-stm32l.c2
2 files changed, 12 insertions, 12 deletions
diff --git a/chip/stm32/i2c-stm32f.c b/chip/stm32/i2c-stm32f.c
index baac384121..1809b7cd3f 100644
--- a/chip/stm32/i2c-stm32f.c
+++ b/chip/stm32/i2c-stm32f.c
@@ -65,10 +65,10 @@
((I2C_PORT_SLAVE) ? STM32_DMAC_I2C2_TX : STM32_DMAC_I2C1_TX)
#define DMAC_SLAVE_RX \
((I2C_PORT_SLAVE) ? STM32_DMAC_I2C2_RX : STM32_DMAC_I2C1_RX)
-#define DMAC_HOST_TX \
- ((I2C_PORT_HOST) ? STM32_DMAC_I2C2_TX : STM32_DMAC_I2C1_TX)
-#define DMAC_HOST_RX \
- ((I2C_PORT_HOST) ? STM32_DMAC_I2C2_RX : STM32_DMAC_I2C1_RX)
+#define DMAC_MASTER_TX \
+ ((I2C_PORT_MASTER) ? STM32_DMAC_I2C2_TX : STM32_DMAC_I2C1_TX)
+#define DMAC_MASTER_RX \
+ ((I2C_PORT_MASTER) ? STM32_DMAC_I2C2_RX : STM32_DMAC_I2C1_RX)
enum {
/*
@@ -728,10 +728,10 @@ static int i2c_master_transmit(int port, int slave_addr, const uint8_t *data,
/* Configure DMA channel for TX to host */
dma_prepare_tx(dma_tx_option + port, size, data);
- dma_enable_tc_interrupt(DMAC_HOST_TX);
+ dma_enable_tc_interrupt(DMAC_MASTER_TX);
/* Start the DMA */
- dma_go(dma_get_channel(DMAC_HOST_TX));
+ dma_go(dma_get_channel(DMAC_MASTER_TX));
/* Configuring i2c2 to use DMA */
STM32_I2C_CR2(port) |= CR2_DMAEN;
@@ -743,8 +743,8 @@ static int i2c_master_transmit(int port, int slave_addr, const uint8_t *data,
if (!rv_start)
rv = task_wait_event(DMA_TRANSFER_TIMEOUT_US);
- dma_disable(DMAC_HOST_TX);
- dma_disable_tc_interrupt(DMAC_HOST_TX);
+ dma_disable(DMAC_MASTER_TX);
+ dma_disable_tc_interrupt(DMAC_MASTER_TX);
STM32_I2C_CR2(port) &= ~CR2_DMAEN;
if (rv_start)
@@ -777,7 +777,7 @@ static int i2c_master_receive(int port, int slave_addr, uint8_t *data,
enable_ack(port);
dma_start_rx(dma_rx_option + port, size, data);
- dma_enable_tc_interrupt(DMAC_HOST_RX);
+ dma_enable_tc_interrupt(DMAC_MASTER_RX);
STM32_I2C_CR2(port) |= CR2_DMAEN;
STM32_I2C_CR2(port) |= CR2_LAST;
@@ -786,8 +786,8 @@ static int i2c_master_receive(int port, int slave_addr, uint8_t *data,
if (!rv_start)
rv = task_wait_event(DMA_TRANSFER_TIMEOUT_US);
- dma_disable(DMAC_HOST_RX);
- dma_disable_tc_interrupt(DMAC_HOST_RX);
+ dma_disable(DMAC_MASTER_RX);
+ dma_disable_tc_interrupt(DMAC_MASTER_RX);
STM32_I2C_CR2(port) &= ~CR2_DMAEN;
disable_ack(port);
diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c
index 8e02f693cd..5b4f05fed5 100644
--- a/chip/stm32/i2c-stm32l.c
+++ b/chip/stm32/i2c-stm32l.c
@@ -534,7 +534,7 @@ DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_DEFAULT);
static int command_i2cdump(int argc, char **argv)
{
- dump_i2c_reg(I2C_PORT_HOST, "dump");
+ dump_i2c_reg(I2C_PORT_MASTER, "dump");
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(i2cdump, command_i2cdump,