linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: Add mcp3421 support
@ 2015-11-27 13:52 Sascha Hauer
  2015-11-27 13:52 ` [PATCH 1/2] iio: adc: mcp3422: " Sascha Hauer
  2015-11-27 13:52 ` [PATCH 2/2] dt-bindings: iio: adc: Update mcp342x binding for the mcp3421 Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Sascha Hauer @ 2015-11-27 13:52 UTC (permalink / raw)
  To: linux-iio
  Cc: linux-kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald

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(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support
  2015-11-27 13:52 [PATCH] iio: adc: Add mcp3421 support Sascha Hauer
@ 2015-11-27 13:52 ` Sascha Hauer
  2015-11-29 14:18   ` Jonathan Cameron
  2015-11-27 13:52 ` [PATCH 2/2] dt-bindings: iio: adc: Update mcp342x binding for the mcp3421 Sascha Hauer
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2015-11-27 13:52 UTC (permalink / raw)
  To: linux-iio
  Cc: linux-kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, Sascha Hauer

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] dt-bindings: iio: adc: Update mcp342x binding for the mcp3421
  2015-11-27 13:52 [PATCH] iio: adc: Add mcp3421 support Sascha Hauer
  2015-11-27 13:52 ` [PATCH 1/2] iio: adc: mcp3422: " Sascha Hauer
@ 2015-11-27 13:52 ` Sascha Hauer
  2015-11-27 20:15   ` Rob Herring
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2015-11-27 13:52 UTC (permalink / raw)
  To: linux-iio
  Cc: linux-kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, Sascha Hauer, devicetree

The mcp3421 is the single channel variant of the mcp342x family and
can be supported by the mcp342x driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: devicetree@vger.kernel.org
---
 Documentation/devicetree/bindings/iio/adc/mcp3422.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/mcp3422.txt b/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
index 333139c..dcae4cc 100644
--- a/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
+++ b/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
@@ -1,7 +1,8 @@
-* Microchip mcp3422/3/4/6/7/8 chip family (ADC)
+* Microchip mcp3421/2/3/4/6/7/8 chip family (ADC)
 
 Required properties:
  - compatible: Should be
+	"microchip,mcp3421" or
 	"microchip,mcp3422" or
 	"microchip,mcp3423" or
 	"microchip,mcp3424" or
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] dt-bindings: iio: adc: Update mcp342x binding for the mcp3421
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2015-11-27 20:15 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: linux-iio, linux-kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, devicetree

On Fri, Nov 27, 2015 at 02:52:52PM +0100, Sascha Hauer wrote:
> The mcp3421 is the single channel variant of the mcp342x family and
> can be supported by the mcp342x driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: devicetree@vger.kernel.org

Acked-by: Rob Herring <robh@kernel.org>

> ---
>  Documentation/devicetree/bindings/iio/adc/mcp3422.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/mcp3422.txt b/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
> index 333139c..dcae4cc 100644
> --- a/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
> @@ -1,7 +1,8 @@
> -* Microchip mcp3422/3/4/6/7/8 chip family (ADC)
> +* Microchip mcp3421/2/3/4/6/7/8 chip family (ADC)
>  
>  Required properties:
>   - compatible: Should be
> +	"microchip,mcp3421" or
>  	"microchip,mcp3422" or
>  	"microchip,mcp3423" or
>  	"microchip,mcp3424" or
> -- 
> 2.6.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] iio: adc: mcp3422: Add mcp3421 support
  2015-11-27 13:52 ` [PATCH 1/2] iio: adc: mcp3422: " Sascha Hauer
@ 2015-11-29 14:18   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2015-11-29 14:18 UTC (permalink / raw)
  To: Sascha Hauer, linux-iio
  Cc: linux-kernel, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] dt-bindings: iio: adc: Update mcp342x binding for the mcp3421
  2015-11-27 20:15   ` Rob Herring
@ 2015-11-29 14:19     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2015-11-29 14:19 UTC (permalink / raw)
  To: Rob Herring, Sascha Hauer
  Cc: linux-iio, linux-kernel, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, devicetree

On 27/11/15 20:15, Rob Herring wrote:
> On Fri, Nov 27, 2015 at 02:52:52PM +0100, Sascha Hauer wrote:
>> The mcp3421 is the single channel variant of the mcp342x family and
>> can be supported by the mcp342x driver.
>>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> Cc: devicetree@vger.kernel.org
> 
> Acked-by: Rob Herring <robh@kernel.org>
Applied.

Thanks,

Jonathan
> 
>> ---
>>  Documentation/devicetree/bindings/iio/adc/mcp3422.txt | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/iio/adc/mcp3422.txt b/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
>> index 333139c..dcae4cc 100644
>> --- a/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
>> +++ b/Documentation/devicetree/bindings/iio/adc/mcp3422.txt
>> @@ -1,7 +1,8 @@
>> -* Microchip mcp3422/3/4/6/7/8 chip family (ADC)
>> +* Microchip mcp3421/2/3/4/6/7/8 chip family (ADC)
>>  
>>  Required properties:
>>   - compatible: Should be
>> +	"microchip,mcp3421" or
>>  	"microchip,mcp3422" or
>>  	"microchip,mcp3423" or
>>  	"microchip,mcp3424" or
>> -- 
>> 2.6.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-29 14:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-27 13:52 [PATCH] iio: adc: Add mcp3421 support Sascha Hauer
2015-11-27 13:52 ` [PATCH 1/2] iio: adc: mcp3422: " Sascha Hauer
2015-11-29 14:18   ` Jonathan Cameron
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).