summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Chen <haibo.chen@nxp.com>2022-06-15 19:31:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-29 08:59:52 +0200
commitc1ec7d52a218d1efe7d6a7c3dbafb3d3022392c9 (patch)
treeb553074738ab8daa21c54407831caf9ee60c5d78
parent42caf44906d6de02c4649e98e4a8bd03c4c53fa1 (diff)
downloadlinux-c1ec7d52a218d1efe7d6a7c3dbafb3d3022392c9.tar.gz
linux-c1ec7d52a218d1efe7d6a7c3dbafb3d3022392c9.tar.bz2
linux-c1ec7d52a218d1efe7d6a7c3dbafb3d3022392c9.zip
iio: accel: mma8452: ignore the return value of reset operation
commit bf745142cc0a3e1723f9207fb0c073c88464b7b4 upstream. On fxls8471, after set the reset bit, the device will reset immediately, will not give ACK. So ignore the return value of this reset operation, let the following code logic to check whether the reset operation works. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Fixes: ecabae713196 ("iio: mma8452: Initialise before activating") Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/1655292718-14287-1-git-send-email-haibo.chen@nxp.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iio/accel/mma8452.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 67463be797de..b12e80464706 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1496,10 +1496,14 @@ static int mma8452_reset(struct i2c_client *client)
int i;
int ret;
- ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
+ /*
+ * Find on fxls8471, after config reset bit, it reset immediately,
+ * and will not give ACK, so here do not check the return value.
+ * The following code will read the reset register, and check whether
+ * this reset works.
+ */
+ i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
MMA8452_CTRL_REG2_RST);
- if (ret < 0)
- return ret;
for (i = 0; i < 10; i++) {
usleep_range(100, 200);