提交 413fe522 编写于 作者: M Miquel Raynal 提交者: Yang Yingliang

iio: adc: max1027: Reset the device at probe time

[ Upstream commit db033831b4f5589f9fcbadb837614a7c4eac0308 ]

All the registers are configured by the driver, let's reset the chip
at probe time, avoiding any conflict with a possible earlier
configuration.
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 03c99a48
...@@ -460,6 +460,14 @@ static int max1027_probe(struct spi_device *spi) ...@@ -460,6 +460,14 @@ static int max1027_probe(struct spi_device *spi)
goto fail_dev_register; goto fail_dev_register;
} }
/* Internal reset */
st->reg = MAX1027_RST_REG;
ret = spi_write(st->spi, &st->reg, 1);
if (ret < 0) {
dev_err(&indio_dev->dev, "Failed to reset the ADC\n");
return ret;
}
/* Disable averaging */ /* Disable averaging */
st->reg = MAX1027_AVG_REG; st->reg = MAX1027_AVG_REG;
ret = spi_write(st->spi, &st->reg, 1); ret = spi_write(st->spi, &st->reg, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册