mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>, linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support
Date: Sun, 29 Nov 2015 14:18:32 +0000	[thread overview]
Message-ID: <565B0938.8010103@kernel.org> (raw)
In-Reply-To: <1448632372-5315-2-git-send-email-s.hauer@pengutronix.de>

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 },
> 


  reply	other threads:[~2015-11-29 14:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 13:52 [PATCH] iio: adc: " Sascha Hauer
2015-11-27 13:52 ` [PATCH 1/2] iio: adc: mcp3422: " Sascha Hauer
2015-11-29 14:18   ` Jonathan Cameron [this message]
2015-11-27 13:52 ` [PATCH 2/2] dt-bindings: iio: adc: Update mcp342x binding for the mcp3421 Sascha Hauer
2015-11-27 20:15   ` Rob Herring
2015-11-29 14:19     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565B0938.8010103@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome