iio: imu: bmi160: added regulator support
authorJonathan Albrieux <jonathan.albrieux@gmail.com>
Mon, 25 May 2020 16:46:03 +0000 (18:46 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 10:49:45 +0000 (11:49 +0100)
commit5dea3fb066f015facfc97b0b5cdfd7bb26523785
treed8fb7fb72f53767f1b30bc6020d8faa689fd6204
parentfb7749661a7f0b3a172f92860d34ef9a739ff63b
iio: imu: bmi160: added regulator support

Add vdd-supply and vddio-supply support.

While working on an msm8916 device and having explicit declarations for
regulators, without setting these regulators to regulators-always-on it
happened those lines weren't ready because they could have been controlled
by other components, causing failure in module's probe.

This patch aim is to solve this situation by adding regulators control
during bmi160_chip_init() and bmi160_chip_uninit(), assuring power to
this component.

Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/bmi160/bmi160.h
drivers/iio/imu/bmi160/bmi160_core.c