IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4
Subsystems (4)
[email protected]
maintainerPATCH 1/1 IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4
From: Michael Hennerich <[email protected]>
This patch adds support for the:
AD7606/AD7606-6/AD7606-4 8/6/4-Channel Data Acquisition system (DAS) with 16-Bit, Bipolar, Simultaneous Sampling ADC.
Changes since V1:
IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4: Apply review feedback
Rename sysfs node oversampling to oversampling_ratio.Kconfig: Add GPIOLIB dependency.
Use range in mV to better match HWMON.
Rename ad7606_check_oversampling.
Fix various comments and style.
Reorder is_visible cases.
Use new gpio_request_one/array and friends. Drop check for SPI max_speed_hz.
Changes since V2:
IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4: Apply review feedback
Documentation: specify unit
Avoid raise condition in ad7606_scan_direct()
Check return value of bus ops read_block()
Changes since V3:
IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4: Add missing include file
Add linux/sched.h
--- drivers/staging/iio/Documentation/sysfs-bus-iio | 25 + drivers/staging/iio/adc/Kconfig | 28 ++ drivers/staging/iio/adc/Makefile | 6 + drivers/staging/iio/adc/ad7606.h | 117 +++++ drivers/staging/iio/adc/ad7606_core.c | 556 +++++++++++++++++++++++ drivers/staging/iio/adc/ad7606_par.c | 188 ++++++++ drivers/staging/iio/adc/ad7606_ring.c | 266 +++++++++++ drivers/staging/iio/adc/ad7606_spi.c | 126 +++++ 8 files changed, 1312 insertions(+), 0 deletions(-) create mode 100644 drivers/staging/iio/adc/ad7606.h create mode 100644 drivers/staging/iio/adc/ad7606_core.c create mode 100644 drivers/staging/iio/adc/ad7606_par.c create mode 100644 drivers/staging/iio/adc/ad7606_ring.c create mode 100644 drivers/staging/iio/adc/ad7606_spi.c
drivers/staging/iio/Documentation/sysfs-bus-iio +25 -0
@@ -53,6 +53,31 @@ Description: When the internal sampling clock can only take a small discrete set of values, this file lists those available. +What: /sys/bus/iio/devices/deviceX/range +KernelVersion: 2.6.38 +Contact: [email protected] +Description: + Hardware dependent ADC Full Scale Range in mVolt. + +What: /sys/bus/iio/devices/deviceX/range_available +KernelVersion: 2.6.38 +Contact: [email protected] +Description: + Hardware dependent supported vales for ADC Full Scale Range. + +What: /sys/bus/iio/devices/deviceX/oversampling_ratio +KernelVersion: 2.6.38 +Contact: [email protected] +Description: + Hardware dependent ADC oversampling. Controls the sampling ratio + of the digital filter if available. + +What: /sys/bus/iio/devices/deviceX/oversampling_ratio_available +KernelVersion: 2.6.38 +Contact: [email protected] +Description: + Hardware dependent values supported by the oversampling filter. + What: /sys/bus/iio/devices/deviceX/inY_raw What: /sys/bus/iio/devices/deviceX/inY_supply_raw KernelVersion: 2.6.35
drivers/staging/iio/adc/Kconfig +28 -0
@@ -62,6 +62,34 @@ config AD7314 Say yes here to build support for Analog Devices AD7314 temperature sensors. +config AD7606 + tristate "Analog Devices AD7606 ADC driver" + depends on GPIOLIB + select IIO_RING_BUFFER + select IIO_TRIGGER + select IIO_SW_RING + help + Say yes here to build support for Analog Devices: + ad7606, ad7606-6, ad7606-4 analog to digital convertors (ADC). + + To compile this driver as a module, choose M here: the + module will be called ad7606. + +config AD7606_IFACE_PARALLEL + bool "parallel interface support" + depends on AD7606 + help + Say yes here to include parallel interface support on the AD7606 + ADC driver. + +config AD7606_IFACE_SPI + bool "spi interface support" + depends on AD7606 + depends on SPI + help + Say yes here to include parallel interface support on the AD7606 + ADC driver. + config AD799X tristate "Analog Devices AD799x ADC driver" depends on I2C
drivers/staging/iio/adc/Makefile +6 -0
@@ -7,6 +7,12 @@ max1363-y += max1363_ring.o obj-$(CONFIG_MAX1363) += max1363.o +ad7606-y := ad7606_core.o +ad7606-$(CONFIG_IIO_RING_BUFFER) += ad7606_ring.o +ad7606-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o +ad7606-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o +obj-$(CONFIG_AD7606) += ad7606.o + ad799x-y := ad799x_core.o ad799x-$(CONFIG_AD799X_RING_BUFFER) += ad799x_ring.o obj-$(CONFIG_AD799X) += ad799x.o
drivers/staging/iio/adc/ad7606.h new file +117 -0
117 lines not on this page · raw message
drivers/staging/iio/adc/ad7606_core.c new file +556 -0
556 lines not on this page · raw message
drivers/staging/iio/adc/ad7606_par.c new file +188 -0
188 lines not on this page · raw message
drivers/staging/iio/adc/ad7606_ring.c new file +266 -0
266 lines not on this page · raw message
drivers/staging/iio/adc/ad7606_spi.c new file +126 -0
126 lines not on this page · raw message
--
1.6.0.2
Re: [PATCH] Staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4
Quoted 21 lines · On Thu, Feb 10, 2011 at 09:28:04AM +0100, [email protected] wrote:
From: Michael Hennerich <[email protected]>
This patch adds support for the:
AD7606/AD7606-6/AD7606-4 8/6/4-Channel Data Acquisition system (DAS) with 16-Bit, Bipolar, Simultaneous Sampling ADC.Changes since V1:
IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4: Apply review feedbackRename sysfs node oversampling to
oversampling_ratio.Kconfig: Add GPIOLIB dependency.
Use range in mV to better match HWMON.
Renamead7606_check_oversampling.
Fix various comments and style.
Reorderis_visiblecases.
Use new gpio_request_one/array and friends. Drop check for SPImax_speed_hz.Changes since V2:
IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4: Apply review feedback
Quoted 8 lines
Documentation: specify unit
Avoid raise condition inad7606_scan_direct()Check return value of bus opsread_block()Changes since V3:
IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4: Add missing include fileAdd
linux/sched.h
It still fails to build here :(
drivers/staging/iio/adc/ad7606_spi.o: In function `init_module':
ad7606_spi.c:(.init.text+0x0): multiple definition of init_module' drivers/staging/iio/adc/ad7606_par.o:ad7606_par.c:(.init.text+0x0): first defined here drivers/staging/iio/adc/ad7606_spi.o: In function cleanup_module':
ad7606_spi.c:(.exit.text+0x0): multiple definition of `cleanup_module' drivers/staging/iio/adc/ad7606_par.o:ad7606_par.c:(.exit.text+0x0): first defined here
You need to try your build options better...
thanks,
greg k-h