Commit 961db2da authored by Jagath Jog J's avatar Jagath Jog J Committed by Jonathan Cameron

iio: accel: bma400: Add support for single and double tap events

Add support for single and double tap events based on the tap threshold
value, minimum quiet time before and after the tap and minimum time
between the taps in the double tap. The INT1 pin is used to interrupt
and the event is pushed to userspace.
Signed-off-by: default avatarJagath Jog J <jagathjog1996@gmail.com>
Link: https://lore.kernel.org/r/20220831063117.4141-3-jagathjog1996@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 835e699e
......@@ -40,6 +40,7 @@
#define BMA400_INT_STAT1_REG 0x0f
#define BMA400_INT_STAT2_REG 0x10
#define BMA400_INT12_MAP_REG 0x23
#define BMA400_INT_ENG_OVRUN_MSK BIT(4)
/* Temperature register */
#define BMA400_TEMP_DATA_REG 0x11
......@@ -105,6 +106,19 @@
#define BMA400_INT_GEN2_MSK BIT(3)
#define BMA400_GEN_HYST_MSK GENMASK(1, 0)
/* TAP config registers */
#define BMA400_TAP_CONFIG 0x57
#define BMA400_TAP_CONFIG1 0x58
#define BMA400_S_TAP_MSK BIT(2)
#define BMA400_D_TAP_MSK BIT(3)
#define BMA400_INT_S_TAP_MSK BIT(10)
#define BMA400_INT_D_TAP_MSK BIT(11)
#define BMA400_TAP_SEN_MSK GENMASK(2, 0)
#define BMA400_TAP_TICSTH_MSK GENMASK(1, 0)
#define BMA400_TAP_QUIET_MSK GENMASK(3, 2)
#define BMA400_TAP_QUIETDT_MSK GENMASK(5, 4)
#define BMA400_TAP_TIM_LIST_LEN 4
/*
* BMA400_SCALE_MIN macro value represents m/s^2 for 1 LSB before
* converting to micro values for +-2g range.
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment