Re: [PATCH 3/9] iio: imu: st_lsm6dsx: move wakeup event enable mask to event_src
From: Andy Shevchenko
Date: Thu Oct 30 2025 - 03:59:30 EST
On Thu, Oct 30, 2025 at 08:27:46AM +0100, Francesco Lavra wrote:
> The mask value being assigned to the irq1_func and irq2_func fields
> of the irq_config struct is specific to a single event source (i.e.
> the wakeup event), and as such it should be separate from the
> definition of the interrupt function registers, which cover
> multiple event sources.
> In preparation for adding support for more event types, change the
> irq1_func and irq2_func type from an {address, mask} pair to an
> address, and move the mask value to a new field of struct
> st_lsm6dsx_event_src. No functional changes.
...
> /* Enable wakeup interrupt */
> - data = ST_LSM6DSX_SHIFT_VAL(state, hw->irq_routing->mask);
> - return st_lsm6dsx_update_bits_locked(hw, hw->irq_routing->addr,
> - hw->irq_routing->mask, data);
> + enable_mask = hw->settings->event_settings.sources[ST_LSM6DSX_EVENT_WAKEUP].enable_mask;
> + data = ST_LSM6DSX_SHIFT_VAL(state, enable_mask);
> + return st_lsm6dsx_update_bits_locked(hw, hw->irq_routing,
> + enable_mask, data);
I would go with one line here (despite on having it 85 characters long).
--
With Best Regards,
Andy Shevchenko