Skip to contentSkip to conversation

Add Microchip MCP3422/3/4 high resolution ADC.

PATCH Superseded Angelo Compagnucci 1 participant 1 message Aug 16, 2013 IIO

v4 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add Microchip MCP3422/3/4 high resolution ADC.

This is the fourth iteration of the patch.
It solves the most outstanding problems arised by Peter and Jonathan. The most important one is that the chip setup is differentiated by the devide id.

To Jonathan: The PGA is the internal programmable gain amplifier circuitry, and it's not releated to the sample rate in any significative manner. It amplifies the signal at the source and could be configured indipendently by the user as stated in the datasheet.
So if I cannot use a new sysfs attribute because it's not in the ABI, I should set it up to a default value and use the chip with suboptimal features. Please give me a hint on how to solve this.

Thank you again for your support.

---
 drivers/iio/adc/Kconfig   |   10 ++
 drivers/iio/adc/Makefile  |    1 +
 drivers/iio/adc/mcp3422.c |  435 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 446 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 +435 -0

435 lines not on this page · raw message

Signature · 1 line
1.7.9.5