iio: cros_ec_sensors: Flush when changing the FIFO timeout
authorGwendal Grignou <gwendal@chromium.org>
Wed, 23 Apr 2025 22:05:06 +0000 (15:05 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 21 May 2025 13:20:28 +0000 (14:20 +0100)
commite50cf7e2e6e0e1fe106384eab938faf712e6230f
treef872b441f0acd3050058871695d07cbeaa5a10b1
parent50ed17cdfd7f32f1b0f87da0aaabcd5e8dd23f19
iio: cros_ec_sensors: Flush when changing the FIFO timeout

|hwfifo_timeout| is used by the EC firmware only when new samples are
available.
When the timeout changes, espcially when the new timeout is shorter than
the current one, send the samples waiting in the FIFO to the host.
Inline the call to transmit |hwfifo_timeout| value to the firmware.

Now flush when a sensor is suspended (ODR set to 0) as well.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Link: https://patch.msgid.link/20250423220506.2061021-1-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c