]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
iio: imu: adis: Refactor adis_initial_startup
authorNuno Sá <nuno.sa@analog.com>
Mon, 10 Feb 2020 13:26:03 +0000 (15:26 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Mar 2020 17:28:30 +0000 (17:28 +0000)
commitecb010d441088c447785a1249e69003437f96c9c
tree07e6220f1d868601cb3ac5dad4db8e6de8ee22b5
parentfdcf6bbb4ed388844e74810e117ac87db1347f3a
iio: imu: adis: Refactor adis_initial_startup

All the ADIS devices perform, at the beginning, a self test to make sure
the device is in a sane state. Previously, the logic was that the self-test
was performed in adis_initial_startup() and if that failed a reset was done
and then a self-test was attempted again.

This change unifies the reset mechanism under the adis_initial_startup()
call. A HW reset will be done if  GPIO is configured, or a SW reset
otherwise. This should make sure that the chip is in a sane state for
self-test. Once the reset is done, the self-test operation will be
performed. If anything goes wrong with self-test, the driver should just
bail/error-out (i.e. no second attempt). The chip would likely not be a in
a sane state state if the self-test fails after a reset.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/adis.c