mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
iio: adc: max1027: Reset the device at probe time
[ Upstream commit db033831b4 ]
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: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a6d47415fc
commit
e57ff9fb69
@@ -458,6 +458,14 @@ static int max1027_probe(struct spi_device *spi)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
st->reg = MAX1027_AVG_REG;
|
||||
ret = spi_write(st->spi, &st->reg, 1);
|
||||
|
||||
Reference in New Issue
Block a user