Skip to content

Commit 961db2d

Browse files
jaggu52jic23
authored andcommitted
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: Jagath Jog J <jagathjog1996@gmail.com> Link: https://lore.kernel.org/r/20220831063117.4141-3-jagathjog1996@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 835e699 commit 961db2d

File tree

2 files changed

+347
-10
lines changed

2 files changed

+347
-10
lines changed

drivers/iio/accel/bma400.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define BMA400_INT_STAT1_REG 0x0f
4141
#define BMA400_INT_STAT2_REG 0x10
4242
#define BMA400_INT12_MAP_REG 0x23
43+
#define BMA400_INT_ENG_OVRUN_MSK BIT(4)
4344

4445
/* Temperature register */
4546
#define BMA400_TEMP_DATA_REG 0x11
@@ -105,6 +106,19 @@
105106
#define BMA400_INT_GEN2_MSK BIT(3)
106107
#define BMA400_GEN_HYST_MSK GENMASK(1, 0)
107108

109+
/* TAP config registers */
110+
#define BMA400_TAP_CONFIG 0x57
111+
#define BMA400_TAP_CONFIG1 0x58
112+
#define BMA400_S_TAP_MSK BIT(2)
113+
#define BMA400_D_TAP_MSK BIT(3)
114+
#define BMA400_INT_S_TAP_MSK BIT(10)
115+
#define BMA400_INT_D_TAP_MSK BIT(11)
116+
#define BMA400_TAP_SEN_MSK GENMASK(2, 0)
117+
#define BMA400_TAP_TICSTH_MSK GENMASK(1, 0)
118+
#define BMA400_TAP_QUIET_MSK GENMASK(3, 2)
119+
#define BMA400_TAP_QUIETDT_MSK GENMASK(5, 4)
120+
#define BMA400_TAP_TIM_LIST_LEN 4
121+
108122
/*
109123
* BMA400_SCALE_MIN macro value represents m/s^2 for 1 LSB before
110124
* converting to micro values for +-2g range.

0 commit comments

Comments
 (0)