mbox series

[v3,0/4] Add WoM feature as an IIO event

Message ID 20240311160557.437337-1-inv.git-commit@tdk.com (mailing list archive)
Headers show
Series Add WoM feature as an IIO event | expand

Message

inv.git-commit@tdk.com March 11, 2024, 4:05 p.m. UTC
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>

Add WoM (Wake-on-Motion) feature for all chips supporting it (all except
MPU-6000/6050/9150). WoM compares the magnitude of the current accel sample
with the previous one against a threshold and returns an interrupt event if
the value is higher.

WoM is checking against all axes and maps best to ROC since it compares the
last 2 samples. Thus report WoM as an accel x|y|z roc_rising IIO event, add
system wakeup functionality if WoM is on and put the chip in low-power mode
when the system is suspended. Corresponding ROC value is in SI units since
the chip is using an absolute value in mg.

v2:
- Rework to use accel x|y|z roc for reporting WoM event
- Use only datasheet advertised bits for MPU-6500 family chips

v3
- Coding style fixes
- Convert mutex usage to guard/scoped_guard

Jean-Baptiste Maneyrol (4):
  iio: imu: inv_mpu6050: add WoM (Wake-on-Motion) sensor
  iio: imu: inv_mpu6050: add WoM event as accel event
  iio: imu: inv_mpu6050: add new interrupt handler for WoM events
  iio: imu: inv_mpu6050: add WoM suspend wakeup with low-power mode

 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    | 542 ++++++++++++++++--
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  36 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c    |  17 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |  83 ++-
 4 files changed, 595 insertions(+), 83 deletions(-)

Comments

Jonathan Cameron March 16, 2024, 1:54 p.m. UTC | #1
On Mon, 11 Mar 2024 16:05:53 +0000
inv.git-commit@tdk.com wrote:

> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
> 
> Add WoM (Wake-on-Motion) feature for all chips supporting it (all except
> MPU-6000/6050/9150). WoM compares the magnitude of the current accel sample
> with the previous one against a threshold and returns an interrupt event if
> the value is higher.
> 
> WoM is checking against all axes and maps best to ROC since it compares the
> last 2 samples. Thus report WoM as an accel x|y|z roc_rising IIO event, add
> system wakeup functionality if WoM is on and put the chip in low-power mode
> when the system is suspended. Corresponding ROC value is in SI units since
> the chip is using an absolute value in mg.
> 
> v2:
> - Rework to use accel x|y|z roc for reporting WoM event
> - Use only datasheet advertised bits for MPU-6500 family chips
> 
> v3
> - Coding style fixes
> - Convert mutex usage to guard/scoped_guard
> 
Applied to the togreg-normal branch of iio.git and pushed out for 0-day
to get started. I'll be rebasing that tree after rc1 so use at your
own risk ;)

btw thought I'd sent this on Thursday  - just found it still open on my screen :(

Jonathan

> Jean-Baptiste Maneyrol (4):
>   iio: imu: inv_mpu6050: add WoM (Wake-on-Motion) sensor
>   iio: imu: inv_mpu6050: add WoM event as accel event
>   iio: imu: inv_mpu6050: add new interrupt handler for WoM events
>   iio: imu: inv_mpu6050: add WoM suspend wakeup with low-power mode
> 
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    | 542 ++++++++++++++++--
>  drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  36 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c    |  17 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |  83 ++-
>  4 files changed, 595 insertions(+), 83 deletions(-)
>