diff options
author | David Hendricks <dhendrix@chromium.org> | 2012-03-29 14:16:43 -0700 |
---|---|---|
committer | David Hendricks <dhendrix@chromium.org> | 2012-04-17 13:44:03 -0700 |
commit | 7a33ee53a6dd0fe6f604b8ce63796c510829ece6 (patch) | |
tree | a30979fda96fd0017e616a1b13a27a0535ec0d26 /board/daisy | |
parent | 2559041f398c9c6f6c56cc36d94bfb955cf63788 (diff) | |
download | chrome-ec-7a33ee53a6dd0fe6f604b8ce63796c510829ece6.tar.gz |
daisy: Plumb in I2C driver
This adds I2C2 support for Daisy:
- Initializes I2C2 GPIO lines
- Adds CONFIG_I2C so main() will call init function
- Adds work task for I2C2
BUG=chromium-os:28925
TEST=build on daisy and discovery; run on daisy
Change-Id: I147e3781b8bcac87ff248fb45c9978b614a24b89
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'board/daisy')
-rw-r--r-- | board/daisy/board.c | 7 | ||||
-rw-r--r-- | board/daisy/board.h | 3 | ||||
-rw-r--r-- | board/daisy/ec.tasklist | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c index 73046d1278..face2b8f62 100644 --- a/board/daisy/board.c +++ b/board/daisy/board.c @@ -73,6 +73,10 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"KB_OUT10", GPIO_C, (1<<5), GPIO_KB_OUTPUT, NULL}, {"KB_OUT11", GPIO_C, (1<<6), GPIO_KB_OUTPUT, NULL}, {"KB_OUT12", GPIO_C, (1<<7), GPIO_KB_OUTPUT, NULL}, + + /* bi-directional, initialized as hi-Z until alt. function is set */ + {"I2C_SCL", GPIO_B, (1<<10), GPIO_HI_Z, NULL}, + {"I2C_SDA", GPIO_B, (1<<11), GPIO_HI_Z, NULL}, }; void configure_board(void) @@ -116,6 +120,9 @@ void configure_board(void) STM32L_GPIO_MODER_OFF(GPIO_B) |= 0x1 << (2*9); /* put GPIO in Hi-Z state */ gpio_set_level(GPIO_EC_INT, 1); + + /* I2C2 SCL/SDA on pins PB10/PB11 - no internal pullup/down */ + gpio_set_alternate_function(GPIO_B, (1<<10) | (1<<11), GPIO_ALT_I2C); } void board_keyboard_scan_ready(void) diff --git a/board/daisy/board.h b/board/daisy/board.h index 0c8bbc09f3..53b3cbca64 100644 --- a/board/daisy/board.h +++ b/board/daisy/board.h @@ -15,6 +15,7 @@ #define CONFIG_CONSOLE_UART 1 #define CONFIG_SPI +#define CONFIG_I2C #define USB_CHARGE_PORT_COUNT 0 @@ -59,6 +60,8 @@ enum gpio_signal { GPIO_KB_OUT10, GPIO_KB_OUT11, GPIO_KB_OUT12, + GPIO_I2C_SCL, + GPIO_I2C_SDA, /* Number of GPIOs; not an actual GPIO */ GPIO_COUNT }; diff --git a/board/daisy/ec.tasklist b/board/daisy/ec.tasklist index afcc1e4e49..9a14c9098a 100644 --- a/board/daisy/ec.tasklist +++ b/board/daisy/ec.tasklist @@ -18,4 +18,5 @@ TASK(KEYSCAN, keyboard_scan_task, NULL) \ TASK(GAIAPOWER, gaia_power_task, NULL) \ TASK(CONSOLE, console_task, NULL) \ - TASK(SPI_WORK, spi_work_task, NULL) + TASK(SPI_WORK, spi_work_task, NULL) \ + TASK(I2C2_WORK, i2c2_work_task, NULL) |