summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-06-29 15:08:36 +0300
committerJonathan Cameron <jic23@kernel.org>2016-06-30 22:40:04 +0300
commitb1037c1a498f9bb3b5a81c2f243c605c190da754 (patch)
treeccc36cf30cb674fec4a40d7261e89e6c9960c3eb /drivers/iio/magnetometer
parent9e6c16d98987f6d5df8e59f61b20140d2f1bdcb4 (diff)
downloadlinux-b1037c1a498f9bb3b5a81c2f243c605c190da754.tar.xz
iio: magn: ak8975: allow a delay after enabling regulators
The datasheet actually specifies that we need to wait atleast 500us after powering on the device before trying to set mode. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/magnetometer')
-rw-r--r--drivers/iio/magnetometer/ak8975.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 6915bd116e49..bf3ffc4ae5c7 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -399,6 +399,12 @@ static int ak8975_power_on(const struct ak8975_data *data)
"Failed to enable specified Vid supply\n");
return ret;
}
+ /*
+ * According to the datasheet the power supply rise time i 200us
+ * and the minimum wait time before mode setting is 100us, in
+ * total 300 us. Add some margin and say minimum 500us here.
+ */
+ usleep_range(500, 1000);
return 0;
}