Skip to content

Commit

Permalink
IIO: ADC: New driver for the AD7298 8-channel SPI ADC
Browse files Browse the repository at this point in the history
This patch adds support for the
AD7298:  8-Channel, 1MSPS, 12-Bit SAR ADC with Temperature Sensor
via SPI bus.

This patch replaces the existing ad7298.c driver completely.
It was necessary since, the old driver did not comply with the
IIO ABI for such devices.

Changes since V1:
IIO: ADC: New driver for the AD7298 8-channel SPI ADC

Add documentation for new sysfs file tempX_input.
Simplify bit defines.
Remove outdated comments.
Fix indention style.
ad7298_show_temp():
	Add locking.
	Simplify temperature calculation.
	Change temperature result from degrees into milli degrees Celsius.
	Rename file according to new sysfs ABI documentation

Add timestamp attributes.
Revise timestamp handling accordingly.
Preset timestamp generation.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Reviewed-by: Shubhrajyoti <Shubhrajyoti@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Feb 28, 2011
1 parent 5bfcf90 commit 7c31b98
Show file tree
Hide file tree
Showing 7 changed files with 640 additions and 504 deletions.
6 changes: 6 additions & 0 deletions drivers/staging/iio/Documentation/sysfs-bus-iio
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ Description:
sensor is associated with one part of a compound device (e.g.
a gyroscope axis).

What: /sys/bus/iio/devices/deviceX/tempX_input
KernelVersion: 2.6.38
Contact: linux-iio@vger.kernel.org
Description:
Scaled temperature measurement in milli degrees Celsius.

What: /sys/bus/iio/devices/deviceX/accel_x_raw
What: /sys/bus/iio/devices/deviceX/accel_y_raw
What: /sys/bus/iio/devices/deviceX/accel_z_raw
Expand Down
7 changes: 5 additions & 2 deletions drivers/staging/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ config AD7291
temperature sensors.

config AD7298
tristate "Analog Devices AD7298 temperature sensor and ADC driver"
tristate "Analog Devices AD7298 ADC driver"
depends on SPI
help
Say yes here to build support for Analog Devices AD7298
temperature sensors and ADC.
8 Channel ADC with temperature sensor.

To compile this driver as a module, choose M here: the
module will be called ad7298.

config AD7314
tristate "Analog Devices AD7314 temperature sensor driver"
Expand Down
5 changes: 4 additions & 1 deletion drivers/staging/iio/adc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ ad7887-y := ad7887_core.o
ad7887-$(CONFIG_IIO_RING_BUFFER) += ad7887_ring.o
obj-$(CONFIG_AD7887) += ad7887.o

ad7298-y := ad7298_core.o
ad7298-$(CONFIG_IIO_RING_BUFFER) += ad7298_ring.o
obj-$(CONFIG_AD7298) += ad7298.o

obj-$(CONFIG_AD7150) += ad7150.o
obj-$(CONFIG_AD7152) += ad7152.o
obj-$(CONFIG_AD7291) += ad7291.o
obj-$(CONFIG_AD7298) += ad7298.o
obj-$(CONFIG_AD7314) += ad7314.o
obj-$(CONFIG_AD7745) += ad7745.o
obj-$(CONFIG_AD7816) += ad7816.o
Expand Down
Loading

0 comments on commit 7c31b98

Please sign in to comment.