summaryrefslogtreecommitdiff
path: root/chip/ish/i2c.c
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-01-24 11:48:54 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-01-28 14:16:59 -0800
commit3925684380e91ef197f91641c72cf569eed9feb5 (patch)
tree2082c5c16c8fa9504216a6f5ce7043b4eb36e14b /chip/ish/i2c.c
parent8176b650153182fad3c828bdd19ebbcee78bad20 (diff)
downloadchrome-ec-3925684380e91ef197f91641c72cf569eed9feb5.tar.gz
ish: use correct I2C event
There is a section of event bits that are reserved for all tasks. We need to use one of the upper bits instead of a bit 7 which may conflict with other tasks eventually. BRANCH=none BUG=none TEST=i2c transaction still works Change-Id: Ie8b98f7a159159714f12dc87ce26b009ceee3f92 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1435479 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'chip/ish/i2c.c')
-rw-r--r--chip/ish/i2c.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/chip/ish/i2c.c b/chip/ish/i2c.c
index e467616783..525bee3732 100644
--- a/chip/ish/i2c.c
+++ b/chip/ish/i2c.c
@@ -22,8 +22,6 @@
#define CPRINTS(format, args...) cprints(CC_I2C, format, ## args)
#define CPRINTF(format, args...) cprintf(CC_I2C, format, ## args)
-#define EVENT_FLAG_I2C_TIMEOUT TASK_EVENT_CUSTOM(1 << 7)
-
/*25MHz, 50MHz, 100MHz, 120MHz, 40MHz, 20MHz, 37MHz*/
static uint16_t default_hcnt_scl_100[] = {
4000, 4420, 4920, 4400, 4000, 4000, 4300
@@ -378,7 +376,7 @@ int chip_i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_size,
/* need timeout in case no ACK from slave */
- task_wait_event_mask(EVENT_FLAG_I2C_TIMEOUT, 2*MSEC);
+ task_wait_event_mask(TASK_EVENT_I2C_IDLE, 2*MSEC);
if (ctx->interrupts & M_TX_ABRT) {
ctx->error_flag = 1;
@@ -428,7 +426,7 @@ static void i2c_interrupt_handler(struct i2c_context *ctx)
#endif
/* disable interrupts */
i2c_intr_switch(ctx->base, DISABLE_INT);
- task_set_event(ctx->wait_task_id, EVENT_FLAG_I2C_TIMEOUT, 0);
+ task_set_event(ctx->wait_task_id, TASK_EVENT_I2C_IDLE, 0);
}
static void i2c_isr_bus0(void)