diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2013-12-03 17:35:23 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-12-06 05:21:41 +0000 |
commit | f9e00364ef84180e89e9c4bfb79e0123ee54923d (patch) | |
tree | 4ae5a4c4db864c4541c49c6010b79579b03bc6af /board | |
parent | 1762de9d19d2671cc56e5a479055379a346030d3 (diff) | |
download | chrome-ec-f9e00364ef84180e89e9c4bfb79e0123ee54923d.tar.gz |
mec1322: I2C driver
This adds the driver for MEC1322 I2C controller.
BUG=chrome-os-partner:24107
TEST=Hook up TSU6721 to eval board. Do the following tests:
- 'i2cscan' and see TSU6721.
- Read device ID register and get correct value.
- Add 3 tasks randomly doing I2C read and writes. Check there is
no error.
BRANCH=None
Change-Id: I465f73fe8177a8df6b56c57e594cd733caea37d4
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/178591
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/mec1322_evb/board.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/board/mec1322_evb/board.c b/board/mec1322_evb/board.c index 73a2a19bb4..ced2c5ab27 100644 --- a/board/mec1322_evb/board.c +++ b/board/mec1322_evb/board.c @@ -6,6 +6,7 @@ #include "fan.h" #include "gpio.h" +#include "i2c.h" #include "registers.h" #include "util.h" @@ -23,9 +24,10 @@ BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT); /* Pins with alternate functions */ const struct gpio_alt_func gpio_alt_funcs[] = { - {GPIO_PORT(16), 0x24, 1, MODULE_UART}, /* UART0 */ - {GPIO_PORT(3), (1 << 4), 3, MODULE_PWM_FAN}, + {GPIO_PORT(16), 0x24, 1, MODULE_UART}, /* UART0 */ + {GPIO_PORT(3), (1 << 4), 3, MODULE_PWM_FAN}, {GPIO_PORT(14), (1 << 0), 3, MODULE_PWM_FAN}, + {GPIO_PORT(1), 0x60, 2, MODULE_I2C}, /* I2C0 */ }; const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); @@ -40,3 +42,9 @@ const struct fan_t fans[] = { }, }; BUILD_ASSERT(ARRAY_SIZE(fans) == CONFIG_FANS); + +/* I2C ports */ +const struct i2c_port_t i2c_ports[] = { + {"port0", 0, 100}, +}; +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); |