/* If disabling the interrupt also does a final read to ensure it is clear. This is only important in some cases where the scan enable elements are switched before the ring is reenabled.  */
static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state)
/* If disabling the interrupt also does a final read to ensure it is clear. This is only important in some cases where the scan enable elements are switched before the ring is reenabled.  */
static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state)
{
	struct lis3l02dq_state *st = trig->private_data;
	int ret = 0;
	u8 t;
	__lis3l02dq_write_data_ready_config(&st->indio_dev->dev,
					    &iio_event_data_rdy_trig,
					    state);
	if (state == false) {
		flush_scheduled_work();
		ret = lis3l02dq_read_all(st, NULL);
	}
	lis3l02dq_spi_read_reg_8(&st->indio_dev->dev,
				 LIS3L02DQ_REG_WAKE_UP_SRC_ADDR,
				 &t);
	return ret;
}