Re: [PATCH v6 3/3] iio: imu: inv_icm42600: add wakeup functionality for Wake-on-Motion
From: Sean Nyekjaer
Date: Mon Jul 07 2025 - 11:08:25 EST
On Mon, Jun 30, 2025 at 09:47:31PM +0100, Jean-Baptiste Maneyrol via B4 Relay wrote:
> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@xxxxxxx>
>
> When Wake-on-Motion is on, enable system wakeup and keep the chip on
> for waking up the system with an interrupt.
>
> Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@xxxxxxx>
> ---
[...]
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> index c52d77cab040dcfb11bc1f9430a3b1dfd52660a9..7a28051330b79098bfa94b8c8c78c2bce20b7230 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
> @@ -1206,6 +1206,11 @@ struct iio_dev *inv_icm42600_accel_init(struct inv_icm42600_state *st)
> if (ret)
> return ERR_PTR(ret);
>
> + /* accel events are wakeup capable */
> + ret = devm_device_init_wakeup(&indio_dev->dev);
> + if (ret)
> + return ERR_PTR(ret);
I don't know if it will work here, but the fxls8962af is controlling this
from the devicetree with:
if (device_property_read_bool(dev, "wakeup-source")) {
ret = devm_device_init_wakeup(dev);
if (ret)
return dev_err_probe(dev, ret, "Failed to init wakeup\n");
}
Br,
/Sean