iio: adis: Introduce timeouts structure
authorNuno Sá <nuno.sa@analog.com>
Tue, 7 Jan 2020 11:17:04 +0000 (13:17 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 12 Jan 2020 11:34:12 +0000 (11:34 +0000)
commit380b107bbf9449ddea0637cefe65a6cbf7b6ca84
treed1b5b4ae244e546eac2abf5955cde0f81f334e06
parent687d39d4512aa5f644450d0662f40aeeac1e84a7
iio: adis: Introduce timeouts structure

The adis library only allows to define a `startup_delay` which for some
devices is enough. However, other devices define different timeouts with
significantly different timings which could lead to devices to not wait
enough time or to wait a lot more than necessary (which is not
efficient). This patch introduces a new timeout struct that must be
passed into `adis_init()`. There are mainly, for now, three timeouts
used. This is also an introductory patch with the goal of refactoring
`adis_initial_startup()`. New driver's (eg: adis16480, adis16460) are
replicating code for the device initial setup. With some changes (being
this the first one) we can pass this to `adis_initial_startup()`.

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/accel/adis16201.c
drivers/iio/accel/adis16209.c
drivers/iio/gyro/adis16136.c
drivers/iio/gyro/adis16260.c
drivers/iio/imu/adis.c
drivers/iio/imu/adis16400.c
drivers/iio/imu/adis16460.c
drivers/iio/imu/adis16480.c
drivers/staging/iio/accel/adis16203.c
drivers/staging/iio/accel/adis16240.c
include/linux/iio/imu/adis.h