OSDN Git Service

iio: adc: max1027: Prepare the introduction of different resolutions
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 11 Oct 2019 14:43:43 +0000 (16:43 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 15 Oct 2019 20:11:03 +0000 (21:11 +0100)
commit7af5257d84275c9ef696e7757b54f210b7955d46
tree07485fd81040dcffa71e578f23b57a7d7491b2e0
parentdb033831b4f5589f9fcbadb837614a7c4eac0308
iio: adc: max1027: Prepare the introduction of different resolutions

Maxim's max1027/29/31 series returns the measured voltages with a
resolution of 10 bits. There is a very similar series, max1227/29/31
which works identically but uses a resolution of 12 bits. Prepare the
support for these chips by turning the 'depth' into a macro parameter
instead of hardcoding it everywhere. Also reorganize just a bit the
macros at the top to avoid repeating tens of lines when adding support
for a new chip.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/max1027.c