yorp: enable interrupt for base accel sensor

Configure the accel sensor gpio to interrupt.
Enable CONFIG_ACCEL_INTERRUPTS and CONFIG_ACCEL_FIFO
to activate FIFO mode.

BUG=b:74932344
BRANCH=NONE
TEST=On Yorp board, "accelinfo on 1000" should output
BASE ACCEL values.

Change-Id: Icecbbe604b32b6bd691558d2898896f6d1443f19
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1073645
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
This commit is contained in:
Jagadish Krishnamoorthy
2018-05-25 11:39:11 -07:00
committed by chrome-bot
parent 3c4a912e67
commit 628c9a924c
3 changed files with 19 additions and 4 deletions

View File

@@ -294,6 +294,14 @@ struct motion_sensor_t motion_sensors[] = {
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
/* Initialize board. */
static void board_init(void)
{
/* Enable Base Accel interrupt */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
#ifndef TEST_BUILD
/* This callback disables keyboard when convertibles are fully open */
void lid_angle_peripheral_enable(int enable)

View File

@@ -30,8 +30,7 @@
#define CONFIG_ACCEL_KX022 /* Lid accel */
#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */
/* Sensors without hardware FIFO are in forced mode */
#define CONFIG_ACCEL_FORCE_MODE_MASK ((1 << LID_ACCEL) | \
(1 << BASE_ACCEL) | (1 << BASE_GYRO))
#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ACCEL)
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
@@ -45,7 +44,16 @@
#define CONFIG_TEMP_SENSOR
#define CONFIG_THERMISTOR_NCP15WB
#define CONFIG_ACCEL_INTERRUPTS
/* FIFO size is in power of 2. */
#define CONFIG_ACCEL_FIFO 1024
/* Depends on how fast the AP boots and typical ODRs */
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_HOST_EVENT
#define CONFIG_ACCEL_LSM6DSM_INT_EVENT TASK_EVENT_CUSTOM(4)
#ifndef __ASSEMBLER__
#include "gpio_signal.h"

View File

@@ -39,8 +39,7 @@ GPIO_INT(ALL_SYS_PGOOD, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt) /* PM
/* Other interrupts */
GPIO_INT(WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* EC_WP_ODL */
/* TODO(b/74932344): Make it as an interrupt after driver supports this */
GPIO(BASE_SIXAXIS_INT_L, PIN(5, 6), GPIO_INPUT | GPIO_SEL_1P8V)
GPIO_INT(BASE_SIXAXIS_INT_L, PIN(5, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, lsm6dsm_interrupt)
GPIO(LID_ACCEL_INT_L, PIN(5, 0), GPIO_INPUT | GPIO_SEL_1P8V)
/* Define PCH_SLP_S0_L after all interrupts if CONFIG_POWER_S0IX not defined. */