Skip to contentSkip to conversation

Add Microchip MCP3422/3/4 high resolution ADC

PATCH Superseded Angelo Compagnucci 2 participants 2 messages Aug 19, 2013 IIO

v6 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 Add Microchip MCP3422/3/4 high resolution ADC

Patch now exposes the sample frequency via IIO_CHAN_INFO_SAMP_FREQ, removes the unneeded locking logic for pga values and other minor fixes.

To Peter: Datasheet for this chip indexes the channels starting from 1 instead of 0. I thought it was better to stick to the datasheet conventions.

Please review it.

Again, Thank you!

Angelo

---
 drivers/iio/adc/Kconfig   |   10 ++
 drivers/iio/adc/Makefile  |    1 +
 drivers/iio/adc/mcp3422.c |  401 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 412 insertions(+)
 create mode 100644 drivers/iio/adc/mcp3422.c
drivers/iio/adc/Kconfig +10 -0
index f725b45..e9879e6 100644
@@ -145,6 +145,16 @@ config MCP320X
 	  This driver can also be built as a module. If so, the module will be
 	  called mcp320x.
 
+config MCP3422
+	tristate "Microchip Technology MCP3422/3/4 driver"
+	depends on I2C
+	help
+	  Say yes here to build support for Microchip Technology's MCP3422,
+	  MCP3423 or MCP3424 analog to digital converters.
+
+	  This driver can also be built as a module. If so, the module will be
+	  called mcp3422.
+
 config NAU7802
 	tristate "Nuvoton NAU7802 ADC driver"
 	depends on I2C
drivers/iio/adc/Makefile +1 -0
index 2a4324e..9772e3b 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_EXYNOS_ADC) += exynos_adc.o
 obj-$(CONFIG_LP8788_ADC) += lp8788_adc.o
 obj-$(CONFIG_MAX1363) += max1363.o
 obj-$(CONFIG_MCP320X) += mcp320x.o
+obj-$(CONFIG_MCP3422) += mcp3422.o
 obj-$(CONFIG_NAU7802) += nau7802.o
 obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o
 obj-$(CONFIG_TI_AM335X_ADC) += ti_am335x_adc.o
drivers/iio/adc/mcp3422.c new file +401 -0

401 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 6 lines

Patch now exposes the sample frequency via IIO_CHAN_INFO_SAMP_FREQ, removes the unneeded locking logic for pga values and other minor fixes.

To Peter: Datasheet for this chip indexes the channels starting from 1 instead of 0. I thought it was better to stick to the datasheet conventions.

there would be datasheet_name in iio_chan_spec

p.

Signature · 2 lines
Peter Meerwald
+43-664-2444418 (mobile)