iio: adc: Move mxs-lradc out of staging

Move mxs-lradc driver from drivers/staging/iio/adc to drivers/iio/adc.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Ksenija Stanojevic 2016-02-06 23:23:23 +01:00 committed by Jonathan Cameron
parent efc945fb72
commit f836c45922
5 changed files with 24 additions and 19 deletions

View File

@ -295,6 +295,20 @@ config MEN_Z188_ADC
This driver can also be built as a module. If so, the module will be This driver can also be built as a module. If so, the module will be
called men_z188_adc. called men_z188_adc.
config MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
depends on INPUT
select STMP_DEVICE
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for i.MX23/i.MX28 LRADC convertor
built into these chips.
To compile this driver as a module, choose M here: the
module will be called mxs-lradc.
config NAU7802 config NAU7802
tristate "Nuvoton NAU7802 ADC driver" tristate "Nuvoton NAU7802 ADC driver"
depends on I2C depends on I2C

View File

@ -29,6 +29,7 @@ obj-$(CONFIG_MAX1363) += max1363.o
obj-$(CONFIG_MCP320X) += mcp320x.o obj-$(CONFIG_MCP320X) += mcp320x.o
obj-$(CONFIG_MCP3422) += mcp3422.o obj-$(CONFIG_MCP3422) += mcp3422.o
obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o
obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o
obj-$(CONFIG_NAU7802) += nau7802.o obj-$(CONFIG_NAU7802) += nau7802.o
obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o

View File

@ -443,7 +443,8 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch)
LRADC_CH_NUM_SAMPLES(lradc->over_sample_cnt - 1), LRADC_CH_NUM_SAMPLES(lradc->over_sample_cnt - 1),
LRADC_CH(ch)); LRADC_CH(ch));
/* from the datasheet: /*
* from the datasheet:
* "Software must clear this register in preparation for a * "Software must clear this register in preparation for a
* multi-cycle accumulation. * multi-cycle accumulation.
*/ */
@ -504,7 +505,8 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1,
mxs_lradc_reg_wrt(lradc, reg, LRADC_CH(ch1)); mxs_lradc_reg_wrt(lradc, reg, LRADC_CH(ch1));
mxs_lradc_reg_wrt(lradc, reg, LRADC_CH(ch2)); mxs_lradc_reg_wrt(lradc, reg, LRADC_CH(ch2));
/* from the datasheet: /*
* from the datasheet:
* "Software must clear this register in preparation for a * "Software must clear this register in preparation for a
* multi-cycle accumulation. * multi-cycle accumulation.
*/ */
@ -914,7 +916,8 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
if (chan->type == IIO_TEMP) { if (chan->type == IIO_TEMP) {
/* From the datasheet, we have to multiply by 1.012 and /*
* From the datasheet, we have to multiply by 1.012 and
* divide by 4 * divide by 4
*/ */
*val = 0; *val = 0;
@ -929,7 +932,8 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
case IIO_CHAN_INFO_OFFSET: case IIO_CHAN_INFO_OFFSET:
if (chan->type == IIO_TEMP) { if (chan->type == IIO_TEMP) {
/* The calculated value from the ADC is in Kelvin, we /*
* The calculated value from the ADC is in Kelvin, we
* want Celsius for hwmon so the offset is -273.15 * want Celsius for hwmon so the offset is -273.15
* The offset is applied before scaling so it is * The offset is applied before scaling so it is
* actually -213.15 * 4 / 1.012 = -1079.644268 * actually -213.15 * 4 / 1.012 = -1079.644268
@ -1750,6 +1754,7 @@ static int mxs_lradc_remove(struct platform_device *pdev)
iio_triggered_buffer_cleanup(iio); iio_triggered_buffer_cleanup(iio);
clk_disable_unprepare(lradc->clk); clk_disable_unprepare(lradc->clk);
return 0; return 0;
} }

View File

@ -91,20 +91,6 @@ config LPC32XX_ADC
activate only one via device tree selection. Provides direct access activate only one via device tree selection. Provides direct access
via sysfs. via sysfs.
config MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
depends on INPUT
select STMP_DEVICE
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
Say yes here to build support for i.MX23/i.MX28 LRADC convertor
built into these chips.
To compile this driver as a module, choose M here: the
module will be called mxs-lradc.
config SPEAR_ADC config SPEAR_ADC
tristate "ST SPEAr ADC" tristate "ST SPEAr ADC"
depends on PLAT_SPEAR || COMPILE_TEST depends on PLAT_SPEAR || COMPILE_TEST

View File

@ -12,5 +12,4 @@ obj-$(CONFIG_AD7816) += ad7816.o
obj-$(CONFIG_AD7192) += ad7192.o obj-$(CONFIG_AD7192) += ad7192.o
obj-$(CONFIG_AD7280) += ad7280a.o obj-$(CONFIG_AD7280) += ad7280a.o
obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o
obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o
obj-$(CONFIG_SPEAR_ADC) += spear_adc.o obj-$(CONFIG_SPEAR_ADC) += spear_adc.o