Commit b600bd7e authored by Nuno Sá's avatar Nuno Sá Committed by Jonathan Cameron

iio: adis: do not disabe IRQs in 'adis_init()'

With commit ecb010d4 ("iio: imu: adis: Refactor adis_initial_startup")
we are doing a HW or SW reset to the device which means that we'll get
the default state of the data ready pin (which is enabled). Hence there's
no point in disabling the IRQ in the init function. Moreover, this
function is intended to initialize internal data structures and not
really do anything on the device.

As a result of this, some devices were left with the data ready pin enabled
after probe which was not the desired behavior. Thus, we move the call to
'adis_enable_irq()' to the initial startup function where it makes more
sense for it to be.

Note that for devices that cannot mask/unmask the pin, it makes no sense
to call the function at this point since the IRQ should not have been
yet requested. This will be improved in a follow up change.

Fixes: ecb010d4 ("iio: imu: adis: Refactor adis_initial_startup")
Signed-off-by: default avatarNuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210903141423.517028-2-nuno.sa@analog.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent fb6349ef
......@@ -430,6 +430,8 @@ int __adis_initial_startup(struct adis *adis)
if (ret)
return ret;
adis_enable_irq(adis, false);
if (!adis->data->prod_id_reg)
return 0;
......@@ -526,7 +528,7 @@ int adis_init(struct adis *adis, struct iio_dev *indio_dev,
adis->current_page = 0;
}
return adis_enable_irq(adis, false);
return 0;
}
EXPORT_SYMBOL_GPL(adis_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment