From f836c45922446df872250a12dd08e48978aceb2f Mon Sep 17 00:00:00 2001 From: Ksenija Stanojevic Date: Sat, 6 Feb 2016 23:23:23 +0100 Subject: [PATCH] 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 Acked-by: Greg Kroah-Hartman Signed-off-by: Jonathan Cameron --- drivers/iio/adc/Kconfig | 14 ++++++++++++++ drivers/iio/adc/Makefile | 1 + drivers/{staging => }/iio/adc/mxs-lradc.c | 13 +++++++++---- drivers/staging/iio/adc/Kconfig | 14 -------------- drivers/staging/iio/adc/Makefile | 1 - 5 files changed, 24 insertions(+), 19 deletions(-) rename drivers/{staging => }/iio/adc/mxs-lradc.c (99%) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index fd8b53e..ce15226 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -295,6 +295,20 @@ config MEN_Z188_ADC This driver can also be built as a module. If so, the module will be 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 tristate "Nuvoton NAU7802 ADC driver" depends on I2C diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index a3820fa..76c0081 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_MAX1363) += max1363.o obj-$(CONFIG_MCP320X) += mcp320x.o obj-$(CONFIG_MCP3422) += mcp3422.o obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o +obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o obj-$(CONFIG_NAU7802) += nau7802.o obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c similarity index 99% rename from drivers/staging/iio/adc/mxs-lradc.c rename to drivers/iio/adc/mxs-lradc.c index bb1f152..33051b8 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/iio/adc/mxs-lradc.c @@ -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(ch)); - /* from the datasheet: + /* + * from the datasheet: * "Software must clear this register in preparation for a * 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(ch2)); - /* from the datasheet: + /* + * from the datasheet: * "Software must clear this register in preparation for a * multi-cycle accumulation. */ @@ -914,7 +916,8 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev, case IIO_CHAN_INFO_SCALE: 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 */ *val = 0; @@ -929,7 +932,8 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev, case IIO_CHAN_INFO_OFFSET: 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 * The offset is applied before scaling so it is * 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); clk_disable_unprepare(lradc->clk); + return 0; } diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig index a700f19..41ed3fe 100644 --- a/drivers/staging/iio/adc/Kconfig +++ b/drivers/staging/iio/adc/Kconfig @@ -91,20 +91,6 @@ config LPC32XX_ADC activate only one via device tree selection. Provides direct access 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 tristate "ST SPEAr ADC" depends on PLAT_SPEAR || COMPILE_TEST diff --git a/drivers/staging/iio/adc/Makefile b/drivers/staging/iio/adc/Makefile index 0c87ce3..3cdd83c 100644 --- a/drivers/staging/iio/adc/Makefile +++ b/drivers/staging/iio/adc/Makefile @@ -12,5 +12,4 @@ obj-$(CONFIG_AD7816) += ad7816.o obj-$(CONFIG_AD7192) += ad7192.o obj-$(CONFIG_AD7280) += ad7280a.o obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o -obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o obj-$(CONFIG_SPEAR_ADC) += spear_adc.o -- 2.7.4