iio: imu: inv_mpu6050: test whoami first and against all known values
authorJean-Baptiste Maneyrol <JManeyrol@invensense.com>
Tue, 6 Jun 2017 10:29:52 +0000 (10:29 +0000)
committerJonathan Cameron <jic23@kernel.org>
Tue, 13 Jun 2017 20:18:17 +0000 (21:18 +0100)
commit881b556f6cf22d37be9340f293f2db10ce7ae8bf
treed30612bea0a08e2c77fb9e2bf6fa09d43de438f0
parent0483fff4d0ae0c7cd4cddb121983352bd2b3aad9
iio: imu: inv_mpu6050: test whoami first and against all known values

SPI bus is never generating error during transfer, so to check if
a chip is correctly connected on a SPI bus we enforce whoami check
to be correct. In this way we can assure SPI probe is failing if
there is no chip connected.

Note that this is really papering over boards that claim the device
is there when it isn't.  Not a bad thing to cope with, but not
necessarily stable material.

Fixes: cec0154556f8 ("iio: inv_mpu6050: Check WHO_AM_I register on probe")
Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c