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

Eddie James eajames at linux.ibm.com
Fri May 27 23:52:40 AEST 2022


On 5/27/22 02:22, Joel Stanley wrote:
> This reverts commit 9f2084b7eb3d8bc99e700b01208be586006a9e42.
>
> Eddie reports this made things even worse.


Thanks!

Reviewed-by: Eddie James <eajames at linux.ibm.com>


>
> 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;


More information about the openbmc mailing list