Skip to contentSkip to conversation

IIO: ADC: New driver for the AD7880 / AD7781 24-bit Sigma-Delta ADC

PATCH In review [email protected] 2 participants 2 messages Mar 24, 2011

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 IIO: ADC: New driver for the AD7880 / AD7781 24-bit Sigma-Delta ADC

From: Michael Hennerich <[email protected]>

Changes since v1:

IIO: ADC: AD7780: Apply review feedback

Abort probe() with error in case platform_data is not present. Add comment explaining power down reset (PDRST) GPIO handling and dual function DOUT/RDY interrupt usage.

---
 drivers/staging/iio/adc/Kconfig  |   11 ++
 drivers/staging/iio/adc/Makefile |    1 +
 drivers/staging/iio/adc/ad7780.c |  329 ++++++++++++++++++++++++++++++++++++++
 drivers/staging/iio/adc/ad7780.h |   30 ++++
 4 files changed, 371 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/iio/adc/ad7780.c
 create mode 100644 drivers/staging/iio/adc/ad7780.h
drivers/staging/iio/adc/Kconfig +11 -0
index 6692a3d..4159389 100644
@@ -142,6 +142,17 @@ config AD7887
 	  To compile this driver as a module, choose M here: the
 	  module will be called ad7887.
 
+config AD7780
+	tristate "Analog Devices AD7780 AD7781 ADC driver"
+	depends on SPI
+	help
+	  Say yes here to build support for Analog Devices
+	  AD7780 and AD7781 SPI analog to digital convertors (ADC).
+	  If unsure, say N (but it's safe to say "Y").
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ad7780.
+
 config AD7745
 	tristate "Analog Devices AD7745, AD7746 AD7747 capacitive sensor driver"
 	depends on I2C
drivers/staging/iio/adc/Makefile +1 -0
index 31067de..1d9b3f5 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_AD7152) += ad7152.o
 obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7314) += ad7314.o
 obj-$(CONFIG_AD7745) += ad7745.o
+obj-$(CONFIG_AD7780) += ad7780.o
 obj-$(CONFIG_AD7816) += ad7816.o
 obj-$(CONFIG_ADT75) += adt75.o
 obj-$(CONFIG_ADT7310) += adt7310.o
drivers/staging/iio/adc/ad7780.c new file +329 -0

329 lines not on this page · raw message

drivers/staging/iio/adc/ad7780.h new file +30 -0
new file mode 100644
index 0000000..67e511c
@@ -0,0 +1,30 @@
+/*
+ * AD7780/AD7781 SPI ADC driver
+ *
+ * Copyright 2011 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2.
+ */
+#ifndef IIO_ADC_AD7780_H_
+#define IIO_ADC_AD7780_H_
+
+/*
+ * TODO: struct ad7780_platform_data needs to go into include/linux/iio
+ */
+
+/* NOTE:
+ * The AD7780 doesn't feature a dedicated SPI chip select, in addition it
+ * features a dual use data out ready DOUT/RDY output.
+ * In order to avoid contentions on the SPI bus, it's therefore necessary
+ * to use spi bus locking combined with a dedicated GPIO to control the
+ * power down reset signal of the AD7780.
+ *
+ * The DOUT/RDY output must also be wired to an interrupt capable GPIO.
+ */
+
+struct ad7780_platform_data {
+	u16				vref_mv;
+	int				gpio_pdrst;
+};
+
+#endif /* IIO_ADC_AD7780_H_ */
Signature · 1 line
1.6.0.2
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · On 03/24/11 15:52, [email protected] wrote:

From: Michael Hennerich <[email protected]>

Changes since v1:

IIO: ADC: AD7780: Apply review feedback

Abort probe() with error in case platform_data is not present. Add comment explaining power down reset (PDRST) GPIO handling and dual function DOUT/RDY interrupt usage.

...