Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1278812 > unrolled thread
| Started by | Sascha Hauer <s.hauer@pengutronix.de> |
|---|---|
| First post | 2015-11-27 15:00 +0100 |
| Last post | 2015-11-29 15:20 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] iio: adc: Add mcp3421 support Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-27 15:00 +0100
[PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support Sascha Hauer <s.hauer@pengutronix.de> - 2015-11-27 15:00 +0100
Re: [PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support Jonathan Cameron <jic23@kernel.org> - 2015-11-29 15:20 +0100
| From | Sascha Hauer <s.hauer@pengutronix.de> |
|---|---|
| Date | 2015-11-27 15:00 +0100 |
| Subject | [PATCH] iio: adc: Add mcp3421 support |
| Message-ID | <qzrJ8-3Bb-15@gated-at.bofh.it> |
This adds support for the mcp3421 adc as part of the mcp342x driver.
Not much needs to be done, only add the compatible entry and add the
array with the correct number of channels.
----------------------------------------------------------------
Sascha Hauer (2):
iio: adc: mcp3422: Add mcp3421 support
dt-bindings: iio: adc: Update mcp342x binding for the mcp3421
Documentation/devicetree/bindings/iio/adc/mcp3422.txt | 3 ++-
drivers/iio/adc/mcp3422.c | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Sascha Hauer <s.hauer@pengutronix.de> |
|---|---|
| Date | 2015-11-27 15:00 +0100 |
| Subject | [PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support |
| Message-ID | <qzrJ9-3Bb-25@gated-at.bofh.it> |
| In reply to | #1278812 |
The mcp3421 is the single channel variant of the mcp342x family. Support
is straight forward, only the channels array has to be added for this
chip.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/iio/adc/mcp3422.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
index 3555122..6eca7ae 100644
--- a/drivers/iio/adc/mcp3422.c
+++ b/drivers/iio/adc/mcp3422.c
@@ -305,6 +305,10 @@ static const struct attribute_group mcp3422_attribute_group = {
.attrs = mcp3422_attributes,
};
+static const struct iio_chan_spec mcp3421_channels[] = {
+ MCP3422_CHAN(0),
+};
+
static const struct iio_chan_spec mcp3422_channels[] = {
MCP3422_CHAN(0),
MCP3422_CHAN(1),
@@ -352,6 +356,10 @@ static int mcp3422_probe(struct i2c_client *client,
indio_dev->info = &mcp3422_info;
switch (adc->id) {
+ case 1:
+ indio_dev->channels = mcp3421_channels;
+ indio_dev->num_channels = ARRAY_SIZE(mcp3421_channels);
+ break;
case 2:
case 3:
case 6:
@@ -383,6 +391,7 @@ static int mcp3422_probe(struct i2c_client *client,
}
static const struct i2c_device_id mcp3422_id[] = {
+ { "mcp3421", 1 },
{ "mcp3422", 2 },
{ "mcp3423", 3 },
{ "mcp3424", 4 },
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2015-11-29 15:20 +0100 |
| Subject | Re: [PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support |
| Message-ID | <qAaZA-7db-9@gated-at.bofh.it> |
| In reply to | #1278813 |
On 27/11/15 13:52, Sascha Hauer wrote:
> The mcp3421 is the single channel variant of the mcp342x family. Support
> is straight forward, only the channels array has to be added for this
> chip.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Thanks
Applied to the togreg branch of iio.git - initially pushed out as testing.
Note that the branch will get rebased once the previous pull has unwound
itself.
Jonathan
> ---
> drivers/iio/adc/mcp3422.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
> index 3555122..6eca7ae 100644
> --- a/drivers/iio/adc/mcp3422.c
> +++ b/drivers/iio/adc/mcp3422.c
> @@ -305,6 +305,10 @@ static const struct attribute_group mcp3422_attribute_group = {
> .attrs = mcp3422_attributes,
> };
>
> +static const struct iio_chan_spec mcp3421_channels[] = {
> + MCP3422_CHAN(0),
> +};
> +
> static const struct iio_chan_spec mcp3422_channels[] = {
> MCP3422_CHAN(0),
> MCP3422_CHAN(1),
> @@ -352,6 +356,10 @@ static int mcp3422_probe(struct i2c_client *client,
> indio_dev->info = &mcp3422_info;
>
> switch (adc->id) {
> + case 1:
> + indio_dev->channels = mcp3421_channels;
> + indio_dev->num_channels = ARRAY_SIZE(mcp3421_channels);
> + break;
> case 2:
> case 3:
> case 6:
> @@ -383,6 +391,7 @@ static int mcp3422_probe(struct i2c_client *client,
> }
>
> static const struct i2c_device_id mcp3422_id[] = {
> + { "mcp3421", 1 },
> { "mcp3422", 2 },
> { "mcp3423", 3 },
> { "mcp3424", 4 },
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web