]> git.baikalelectronics.ru Git - kernel.git/commit
iio: cros: Register FIFO callback after sensor is registered
authorGwendal Grignou <gwendal@chromium.org>
Mon, 11 Jul 2022 14:47:16 +0000 (07:47 -0700)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 18 Jul 2022 17:29:13 +0000 (18:29 +0100)
commitbe74579169befb0c7c6930d39d2460f2c2d24af3
tree64865906b0568150bf4c48b7a9d1806bc0195967
parent8e5e26e309b0ff5378f77be19300d7e372272848
iio: cros: Register FIFO callback after sensor is registered

Instead of registering callback to process sensor events right at
initialization time, wait for the sensor to be register in the iio
subsystem.

Events can come at probe time (in case the kernel rebooted abruptly
without switching the sensor off for  instance), and be sent to IIO core
before the sensor is fully registered.

Fixes: c17c81e4fdd4 ("iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO")
Reported-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20220711144716.642617-1-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/cros_ec_accel_legacy.c
drivers/iio/common/cros_ec_sensors/cros_ec_lid_angle.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
drivers/iio/light/cros_ec_light_prox.c
drivers/iio/pressure/cros_ec_baro.c
include/linux/iio/common/cros_ec_sensors_core.h