diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 20a7073f1dd681a9387e378fa4e00c13636b0872..11b048a59fdef60aacdb2131edce83e1f149124c 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -20,6 +20,16 @@ config AD7266 Say yes here to build support for Analog Devices AD7265 and AD7266 ADCs. +config AD7291 + tristate "Analog Devices AD7291 ADC driver" + depends on I2C + help + Say yes here to build support for Analog Devices AD7291 + 8 Channel ADC with temperature sensor. + + To compile this driver as a module, choose M here: the + module will be called ad7291. + config AD7298 tristate "Analog Devices AD7298 ADC driver" depends on SPI diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index 38cf5c3f5631dc6b907a1844465dcf34f14efd52..ad81b512aa3dee82bc85a50c933a83d3fc49b5ed 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -5,6 +5,7 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o obj-$(CONFIG_AD7266) += ad7266.o +obj-$(CONFIG_AD7291) += ad7291.o obj-$(CONFIG_AD7298) += ad7298.o obj-$(CONFIG_AD7923) += ad7923.o obj-$(CONFIG_AD7476) += ad7476.o diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/iio/adc/ad7291.c similarity index 99% rename from drivers/staging/iio/adc/ad7291.c rename to drivers/iio/adc/ad7291.c index 9139958da787adb4f9a9fa4d657de7ec3c6aa4d5..4ed78b94afd831a38d064a7a05860fa1421a2660 100644 --- a/drivers/staging/iio/adc/ad7291.c +++ b/drivers/iio/adc/ad7291.c @@ -6,22 +6,22 @@ * Licensed under the GPL-2 or later. */ -#include #include -#include -#include -#include +#include #include +#include +#include #include #include #include -#include +#include +#include #include #include #include -#include "ad7291.h" +#include /* * Simplified handling @@ -379,6 +379,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev, case IIO_VOLTAGE: if (chip->reg) { int vref; + vref = regulator_get_voltage(chip->reg); if (vref < 0) return vref; diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig index b87e382ad76898c5bdc6e01d34b8a41d7759196e..75d2d1bf93d12b9b4e93b8cc4433d488a02f47ac 100644 --- a/drivers/staging/iio/adc/Kconfig +++ b/drivers/staging/iio/adc/Kconfig @@ -3,13 +3,6 @@ # menu "Analog to digital converters" -config AD7291 - tristate "Analog Devices AD7291 ADC driver" - depends on I2C - help - Say yes here to build support for Analog Devices AD7291 - 8 Channel ADC with temperature sensor. - config AD7606 tristate "Analog Devices AD7606 ADC driver" depends on GPIOLIB diff --git a/drivers/staging/iio/adc/Makefile b/drivers/staging/iio/adc/Makefile index afdcd1ff08ff1a775c9254d5d2aacaf4c162e263..1c4277dbd31859292b2e07c1dda496c6fe79be72 100644 --- a/drivers/staging/iio/adc/Makefile +++ b/drivers/staging/iio/adc/Makefile @@ -8,7 +8,6 @@ ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o obj-$(CONFIG_AD7606) += ad7606.o -obj-$(CONFIG_AD7291) += ad7291.o obj-$(CONFIG_AD7780) += ad7780.o obj-$(CONFIG_AD7816) += ad7816.o obj-$(CONFIG_AD7192) += ad7192.o diff --git a/drivers/staging/iio/adc/ad7291.h b/include/linux/platform_data/ad7291.h similarity index 100% rename from drivers/staging/iio/adc/ad7291.h rename to include/linux/platform_data/ad7291.h