mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 01:21:49 +00:00
ryu: sensor hub: Add FIFO and interrupt support
Enable code to use BMI150 FIFO and interrupt support on Smaug BUG=chrome-os-partner:39900 BRANCH=smaug TEST=Check fifo is working, interrupts are enabled. Change-Id: Ifc07da793d3ece4806895db4aff5d880c0f3d9b0 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/274228 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
a7c4132d25
commit
e7b2d5bcea
@@ -217,6 +217,9 @@ static void board_init(void)
|
||||
|
||||
/* Enable interrupts on VBUS transitions. */
|
||||
gpio_enable_interrupt(GPIO_CHGR_ACOK);
|
||||
|
||||
/* Enable interrupts from BMI160 sensor. */
|
||||
gpio_enable_interrupt(GPIO_ACC_IRQ1);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
|
||||
|
||||
|
||||
@@ -144,9 +144,20 @@
|
||||
/* Sensor support */
|
||||
#define CONFIG_ACCELGYRO_BMI160
|
||||
#define CONFIG_MAG_BMI160_BMM150
|
||||
#define CONFIG_ACCEL_INTERRUPTS
|
||||
#define CONFIG_CMD_ACCELS
|
||||
#define CONFIG_CMD_ACCEL_INFO
|
||||
|
||||
/* Size of FIFO queue is determined by Android Hifi sensor requirements:
|
||||
* Wake up sensors: Accel @50Hz + Barometer @5Hz + uncal mag @ 10Hz
|
||||
* 60s minimum, 3min recommened.
|
||||
* FIFO size is in power of 2.
|
||||
*/
|
||||
#define CONFIG_ACCEL_FIFO 2048
|
||||
|
||||
/* Depends on how fast the AP boots and typical ODRs */
|
||||
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
|
||||
|
||||
/* Maximum number of deferrable functions */
|
||||
#undef DEFERRABLE_MAX_COUNT
|
||||
#define DEFERRABLE_MAX_COUNT 16
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
SMALLER_TASK_STACK_SIZE) \
|
||||
TASK_NOTEST(LIGHTBAR, lightbar_task, NULL, LARGER_TASK_STACK_SIZE) \
|
||||
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
|
||||
TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, TASK_STACK_SIZE) \
|
||||
TASK_NOTEST(MOTIONSENSE, motion_sense_task, NULL, LARGER_TASK_STACK_SIZE) \
|
||||
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
|
||||
TASK_NOTEST(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \
|
||||
TASK_ALWAYS(CONSOLE, console_task, NULL, LARGER_TASK_STACK_SIZE) \
|
||||
|
||||
@@ -13,6 +13,7 @@ GPIO_INT(LID_OPEN, PIN(E, 1), GPIO_INT_BOTH | GPIO_PULL_UP, lid_
|
||||
GPIO_INT(CHARGE_DONE, PIN(E, 6), GPIO_INT_BOTH, inductive_charging_interrupt)
|
||||
GPIO_INT(AP_IN_SUSPEND, PIN(F, 9), GPIO_INT_BOTH, power_signal_interrupt)
|
||||
GPIO_INT(AP_HOLD, PIN(E, 3), GPIO_INT_BOTH, power_signal_interrupt)
|
||||
GPIO_INT(ACC_IRQ1, PIN(D, 12), GPIO_INT_FALLING, bmi160_interrupt)
|
||||
|
||||
/* Interrupt lines not used yet */
|
||||
GPIO(BC_TEMP_ALERT_L, PIN(C, 5), GPIO_INT_FALLING)
|
||||
@@ -21,7 +22,6 @@ GPIO(LIGHTBAR_EN_L, PIN(E, 8), GPIO_INT_FALLING | GPIO_PULL_UP)
|
||||
GPIO(BASE_PRES_L, PIN(E, 10), GPIO_INT_BOTH | GPIO_PULL_UP)
|
||||
GPIO(CHGR_INT_L, PIN(B, 2), GPIO_INT_FALLING)
|
||||
GPIO(CAM_SYNC_INT_L, PIN(C, 7), GPIO_INT_FALLING)
|
||||
GPIO(ACC_IRQ, PIN(D, 12), GPIO_INPUT)
|
||||
GPIO(COMPASS_DRDY, PIN(A, 8), GPIO_INPUT)
|
||||
|
||||
/* Buttons */
|
||||
|
||||
Reference in New Issue
Block a user