diff options
author | Edward Hill <ecgh@chromium.org> | 2018-01-12 09:37:50 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-14 18:38:27 -0800 |
commit | ad59381ca31fb4728a1da24e28c3b17cf8468dc6 (patch) | |
tree | 3c0b0e544082eb14d690a6907d774de6cef6fed7 | |
parent | dd404f34d54461e4fbd10e3371697799a3e0c4df (diff) | |
download | chrome-ec-ad59381ca31fb4728a1da24e28c3b17cf8468dc6.tar.gz |
grunt: Enable BMI160 gyro interrupts
Setup bmi160_interrupt and enable in board_init.
BUG=b:69379621
BRANCH=none
TEST=none
Change-Id: I80d08146367af0b91d8d9ac1495c85fe8edd0203
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/864827
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | board/grunt/board.c | 7 | ||||
-rw-r--r-- | board/grunt/gpio.inc | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c index 92b1a69eb5..a485c70ca0 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -196,6 +196,13 @@ const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = { GPIO_EN_USB_A1_5V, }; +static void board_init(void) +{ + /* Enable Gyro interrupts */ + gpio_enable_interrupt(GPIO_6AXIS_INT_L); +} +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); + /** * Power on (or off) a single TCPC. * minimum on/off delays are included. diff --git a/board/grunt/gpio.inc b/board/grunt/gpio.inc index 7627935dcf..4ad84713bb 100644 --- a/board/grunt/gpio.inc +++ b/board/grunt/gpio.inc @@ -21,6 +21,7 @@ GPIO_INT(WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) GPIO_INT(VOLUME_DOWN_L, PIN(7, 0), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(VOLUME_UP_L, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(USB_C0_CABLE_DET, PIN(3, 7), GPIO_INT_RISING, anx74xx_cable_det_interrupt) +GPIO_INT(6AXIS_INT_L, PIN(8, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt) GPIO(EN_PWR_A, PIN(E, 2), GPIO_OUT_HIGH) /* Enable Power */ GPIO(EN_PP1800_SENSOR, PIN(6, 7), GPIO_OUT_HIGH) /* Enable Power */ @@ -37,7 +38,6 @@ GPIO(EC_APU_RST, PIN(E, 4), GPIO_INPUT) /* Reset to SOC */ GPIO(CPU_PROCHOT, PIN(3, 4), GPIO_INPUT | GPIO_SEL_1P8V) /* PROCHOT to SOC */ GPIO(APU_ALERT_L, PIN(A, 2), GPIO_INPUT) /* Alert to SOC */ GPIO(3AXIS_INT_L, PIN(5, 0), GPIO_INPUT | GPIO_SEL_1P8V) /* 3 Axis Accel */ -GPIO(6AXIS_INT_L, PIN(8, 6), GPIO_INPUT | GPIO_SEL_1P8V) /* 6 Axis Accel */ GPIO(KB_BL_EN, PIN(F, 2), GPIO_OUT_LOW) /* Enable KB Backlight */ /* We don't have 5V rail control but the BQ24392 driver expects the GPIO */ |