iio: bmg160: reset chip when probing
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Tue, 21 Mar 2017 15:52:14 +0000 (16:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Apr 2017 10:41:11 +0000 (12:41 +0200)
commit71b44ef83d2a74e1be9053f80455f62086fae822
treeeb2d50d9efabed4b96755950dff9100e59db769e
parentac303c64cdb82a66817df89a7b56ebececd7396f
iio: bmg160: reset chip when probing

commit 4bdc9029685ac03be50b320b29691766d2326c2b upstream.

The gyroscope chip might need to be reset to be used.

Without the chip being reset, the driver stopped at the first
regmap_read (to get the CHIP_ID) and failed to probe.

The datasheet of the gyroscope says that a minimum wait of 30ms after
the reset has to be done.

This patch has been checked on a BMX055 and the datasheet of the BMG160
and the BMI055 give the same reset register and bits.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/gyro/bmg160_core.c