iio: gyro: mpu3050: fix chip ID reading
authorSergey Larin <cerg2010cerg2010@mail.ru>
Sat, 2 Mar 2019 16:54:55 +0000 (19:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:36:34 +0000 (09:36 +0200)
commit8bd3fd46ec23375740e7f29bafce4a11f6cff1d2
treebf6e891d3f69cf303b9dcb3697ff0f4c80c324fb
parent6f3e66b155f02dd90a30c9307f4900256eafa3f1
iio: gyro: mpu3050: fix chip ID reading

commit 409a51e0a4a5f908763191fae2c29008632eb712 upstream.

According to the datasheet, the last bit of CHIP_ID register controls
I2C bus, and the first one is unused. Handle this correctly.

Note that there are chips out there that have a value such that
the id check currently fails.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/gyro/mpu3050-core.c