]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
iio: adc: mcp3422: Add support for MCP3425
authorAkinobu Mita <akinobu.mita@gmail.com>
Sat, 26 Dec 2015 12:16:14 +0000 (21:16 +0900)
committerJonathan Cameron <jic23@kernel.org>
Sat, 2 Jan 2016 18:32:03 +0000 (18:32 +0000)
The MCP3425 is a single channel up to 16-bit A/D converter which has
features:

- On-Board Programmable Gain Amplifier (PGA):
 - Gains of 1, 2, 4 or 8
- Programmable Data Rate Options:
 - 15 SPS (16 bits), 60 SPS (14 bits), 240 SPS (12 bits)

The mcp3422 driver also supports the MCP3421 which is a single channel.
So we can support MCP3425 with a little changes to mcp3422 driver.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/devicetree/bindings/iio/adc/mcp3422.txt
drivers/iio/adc/Kconfig
drivers/iio/adc/mcp3422.c

index dcae4ccfcc5284b8f116e2c788fbc30c996603c9..82bcce07255d4792baee3038b0a2dfadbff7b3c4 100644 (file)
@@ -6,6 +6,7 @@ Required properties:
        "microchip,mcp3422" or
        "microchip,mcp3423" or
        "microchip,mcp3424" or
+       "microchip,mcp3425" or
        "microchip,mcp3426" or
        "microchip,mcp3427" or
        "microchip,mcp3428"
index 605ff42c46310201e7aba3fd2f7ab42a0a873e04..d0dc39a95555dd2a6e3cc752112a8bfef47b5f3e 100644 (file)
@@ -265,11 +265,11 @@ config MCP320X
          called mcp320x.
 
 config MCP3422
-       tristate "Microchip Technology MCP3422/3/4/6/7/8 driver"
+       tristate "Microchip Technology MCP3421/2/3/4/5/6/7/8 driver"
        depends on I2C
        help
-         Say yes here to build support for Microchip Technology's
-         MCP3422, MCP3423, MCP3424, MCP3426, MCP3427 or MCP3428
+         Say yes here to build support for Microchip Technology's MCP3421
+         MCP3422, MCP3423, MCP3424, MCP3425, MCP3426, MCP3427 or MCP3428
          analog to digital converters.
 
          This driver can also be built as a module. If so, the module will be
index 6eca7aea8a37493e55b25a4c4ac9907782a81792..ebad83e3fbf7a4d35978dfd2c75bcb628154f51b 100644 (file)
@@ -1,11 +1,12 @@
 /*
- * mcp3422.c - driver for the Microchip mcp3422/3/4/6/7/8 chip family
+ * mcp3422.c - driver for the Microchip mcp3421/2/3/4/5/6/7/8 chip family
  *
  * Copyright (C) 2013, Angelo Compagnucci
  * Author: Angelo Compagnucci <angelo.compagnucci@gmail.com>
  *
  * Datasheet: http://ww1.microchip.com/downloads/en/devicedoc/22088b.pdf
  *            http://ww1.microchip.com/downloads/en/DeviceDoc/22226a.pdf
+ *            http://ww1.microchip.com/downloads/en/DeviceDoc/22072b.pdf
  *
  * This driver exports the value of analog input voltage to sysfs, the
  * voltage unit is nV.
@@ -357,6 +358,7 @@ static int mcp3422_probe(struct i2c_client *client,
 
        switch (adc->id) {
        case 1:
+       case 5:
                indio_dev->channels = mcp3421_channels;
                indio_dev->num_channels = ARRAY_SIZE(mcp3421_channels);
                break;
@@ -395,6 +397,7 @@ static const struct i2c_device_id mcp3422_id[] = {
        { "mcp3422", 2 },
        { "mcp3423", 3 },
        { "mcp3424", 4 },
+       { "mcp3425", 5 },
        { "mcp3426", 6 },
        { "mcp3427", 7 },
        { "mcp3428", 8 },
@@ -421,5 +424,5 @@ static struct i2c_driver mcp3422_driver = {
 module_i2c_driver(mcp3422_driver);
 
 MODULE_AUTHOR("Angelo Compagnucci <angelo.compagnucci@gmail.com>");
-MODULE_DESCRIPTION("Microchip mcp3422/3/4/6/7/8 driver");
+MODULE_DESCRIPTION("Microchip mcp3421/2/3/4/5/6/7/8 driver");
 MODULE_LICENSE("GPL v2");