[PATCH linux dev-5.15] iio: si7020: Revert "Remove reset in probe"

Joel Stanley joel at jms.id.au
Fri May 27 17:22:36 AEST 2022


This reverts commit 9f2084b7eb3d8bc99e700b01208be586006a9e42.

Eddie reports this made things even worse.

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 drivers/iio/humidity/si7020.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
index f0e86bcb7970..ab6537f136ba 100644
--- a/drivers/iio/humidity/si7020.c
+++ b/drivers/iio/humidity/si7020.c
@@ -108,12 +108,20 @@ static int si7020_probe(struct i2c_client *client,
 {
 	struct iio_dev *indio_dev;
 	struct i2c_client **data;
+	int ret;
 
 	if (!i2c_check_functionality(client->adapter,
 				     I2C_FUNC_SMBUS_WRITE_BYTE |
 				     I2C_FUNC_SMBUS_READ_WORD_DATA))
 		return -EOPNOTSUPP;
 
+	/* Reset device, loads default settings. */
+	ret = i2c_smbus_write_byte(client, SI7020CMD_RESET);
+	if (ret < 0)
+		return ret;
+	/* Wait the maximum power-up time after software reset. */
+	msleep(15);
+
 	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
 	if (!indio_dev)
 		return -ENOMEM;
-- 
2.35.1



More information about the openbmc mailing list