drivers/sensor: lis2dw12: fix for wrong gpio_callback handling

It seems that gpio_pin_disable_callback() has never been working
for that sensor as it was expected. We used there argument 'dev'
as its own (lis2dw12) device pointer. While this argument is a
gpio_port device pointer not lis2dw12 sensor device pointer. So
cfg->int_gpio_pin always tries to disable callback for some random
pin read from accidental data sector.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
This commit is contained in:
Michał Oleszczyk 2019-09-18 09:01:10 +02:00 committed by Maureen Helm
commit 2663f71c6a
2 changed files with 7 additions and 3 deletions

View file

@ -112,6 +112,7 @@ struct lis2dw12_data {
lis2dw12_ctx_t *ctx;
#ifdef CONFIG_LIS2DW12_TRIGGER
struct device *gpio;
u8_t gpio_pin;
struct gpio_callback gpio_cb;
sensor_trigger_handler_t drdy_handler;
#ifdef CONFIG_LIS2DW12_PULSE