aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/iio/common/cros_ec_sensors_core.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2022-07-11 07:47:16 -0700
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-07-18 18:29:13 +0100
commit0b4ae3f6d1210c11f9baf159009c7227eacf90f2 (patch)
tree64865906b0568150bf4c48b7a9d1806bc0195967 /include/linux/iio/common/cros_ec_sensors_core.h
parentiio: test: rework Kconfig to support modules (diff)
downloadwireguard-linux-0b4ae3f6d1210c11f9baf159009c7227eacf90f2.tar.xz
wireguard-linux-0b4ae3f6d1210c11f9baf159009c7227eacf90f2.zip
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: aa984f1ba4a4 ("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>
Diffstat (limited to 'include/linux/iio/common/cros_ec_sensors_core.h')
-rw-r--r--include/linux/iio/common/cros_ec_sensors_core.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/iio/common/cros_ec_sensors_core.h b/include/linux/iio/common/cros_ec_sensors_core.h
index a8259c8822f5..e72167b96d27 100644
--- a/include/linux/iio/common/cros_ec_sensors_core.h
+++ b/include/linux/iio/common/cros_ec_sensors_core.h
@@ -93,8 +93,11 @@ int cros_ec_sensors_read_cmd(struct iio_dev *indio_dev, unsigned long scan_mask,
struct platform_device;
int cros_ec_sensors_core_init(struct platform_device *pdev,
struct iio_dev *indio_dev, bool physical_device,
- cros_ec_sensors_capture_t trigger_capture,
- cros_ec_sensorhub_push_data_cb_t push_data);
+ cros_ec_sensors_capture_t trigger_capture);
+
+int cros_ec_sensors_core_register(struct device *dev,
+ struct iio_dev *indio_dev,
+ cros_ec_sensorhub_push_data_cb_t push_data);
irqreturn_t cros_ec_sensors_capture(int irq, void *p);
int cros_ec_sensors_push_data(struct iio_dev *indio_dev,