summaryrefslogtreecommitdiff
path: root/board/daisy/board.c
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2012-03-29 14:16:43 -0700
committerDavid Hendricks <dhendrix@chromium.org>2012-04-17 13:44:03 -0700
commit7a33ee53a6dd0fe6f604b8ce63796c510829ece6 (patch)
treea30979fda96fd0017e616a1b13a27a0535ec0d26 /board/daisy/board.c
parent2559041f398c9c6f6c56cc36d94bfb955cf63788 (diff)
downloadchrome-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/board.c')
-rw-r--r--board/daisy/board.c7
1 files changed, 7 insertions, 0 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)