All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921
@ 2022-06-24  9:56 Kory Maincent
  2022-06-24  9:56 ` [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support Kory Maincent
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kory Maincent @ 2022-06-24  9:56 UTC (permalink / raw)
  To: linux-iio, linux-kernel
  Cc: thomas.petazzoni, Jonathan Cameron, Lars-Peter Clausen,
	Cai Huoqing, Alexandre Belloni, Geert Uytterhoeven,
	Miquel Raynal, Uwe Kleine-König

Add support to mcp4921 which has only one output channel.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 drivers/iio/dac/mcp4922.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/dac/mcp4922.c b/drivers/iio/dac/mcp4922.c
index cb9e60e71b91..0d41c0f25515 100644
--- a/drivers/iio/dac/mcp4922.c
+++ b/drivers/iio/dac/mcp4922.c
@@ -17,10 +17,12 @@
 #include <linux/bitops.h>
 
 #define MCP4922_NUM_CHANNELS	2
+#define MCP4921_NUM_CHANNELS	1
 
 enum mcp4922_supported_device_ids {
 	ID_MCP4902,
 	ID_MCP4912,
+	ID_MCP4921,
 	ID_MCP4922,
 };
 
@@ -105,9 +107,10 @@ static int mcp4922_write_raw(struct iio_dev *indio_dev,
 	}
 }
 
-static const struct iio_chan_spec mcp4922_channels[3][MCP4922_NUM_CHANNELS] = {
+static const struct iio_chan_spec mcp4922_channels[4][MCP4922_NUM_CHANNELS] = {
 	[ID_MCP4902] = { MCP4922_CHAN(0, 8),	MCP4922_CHAN(1, 8) },
 	[ID_MCP4912] = { MCP4922_CHAN(0, 10),	MCP4922_CHAN(1, 10) },
+	[ID_MCP4921] = { MCP4922_CHAN(0, 12),	{} },
 	[ID_MCP4922] = { MCP4922_CHAN(0, 12),	MCP4922_CHAN(1, 12) },
 };
 
@@ -154,7 +157,10 @@ static int mcp4922_probe(struct spi_device *spi)
 	indio_dev->info = &mcp4922_info;
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->channels = mcp4922_channels[id->driver_data];
-	indio_dev->num_channels = MCP4922_NUM_CHANNELS;
+	if (id->driver_data == ID_MCP4921)
+		indio_dev->num_channels = MCP4921_NUM_CHANNELS;
+	else
+		indio_dev->num_channels = MCP4922_NUM_CHANNELS;
 	indio_dev->name = id->name;
 
 	ret = iio_device_register(indio_dev);
@@ -185,6 +191,7 @@ static void mcp4922_remove(struct spi_device *spi)
 static const struct spi_device_id mcp4922_id[] = {
 	{"mcp4902", ID_MCP4902},
 	{"mcp4912", ID_MCP4912},
+	{"mcp4921", ID_MCP4921},
 	{"mcp4922", ID_MCP4922},
 	{}
 };
-- 
2.25.1


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

* [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support
  2022-06-24  9:56 [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Kory Maincent
@ 2022-06-24  9:56 ` Kory Maincent
  2022-06-24 11:40   ` Krzysztof Kozlowski
  2022-06-24 17:59 ` [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Miquel Raynal
  2022-06-25 11:15 ` Jonathan Cameron
  2 siblings, 1 reply; 5+ messages in thread
From: Kory Maincent @ 2022-06-24  9:56 UTC (permalink / raw)
  To: Jonathan Cameron, Michael Welling, linux-iio, devicetree, linux-kernel
  Cc: thomas.petazzoni, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Nuno Sá

Add device tree bindings for the MCP4921 DAC.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml b/Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml
index 12a14b3f36cb..4c430abcdbf9 100644
--- a/Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml
@@ -15,6 +15,7 @@ properties:
     enum:
       - microchip,mcp4902
       - microchip,mcp4912
+      - microchip,mcp4921
       - microchip,mcp4922
 
   reg:
-- 
2.25.1


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

* Re: [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support
  2022-06-24  9:56 ` [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support Kory Maincent
@ 2022-06-24 11:40   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-24 11:40 UTC (permalink / raw)
  To: Kory Maincent, Jonathan Cameron, Michael Welling, linux-iio,
	devicetree, linux-kernel
  Cc: thomas.petazzoni, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Nuno Sá

On 24/06/2022 11:56, Kory Maincent wrote:
> Add device tree bindings for the MCP4921 DAC.
> 
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> ---
>  Documentation/devicetree/bindings/iio/dac/microchip,mcp4922.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

* Re: [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921
  2022-06-24  9:56 [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Kory Maincent
  2022-06-24  9:56 ` [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support Kory Maincent
@ 2022-06-24 17:59 ` Miquel Raynal
  2022-06-25 11:15 ` Jonathan Cameron
  2 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2022-06-24 17:59 UTC (permalink / raw)
  To: Kory Maincent
  Cc: linux-iio, linux-kernel, thomas.petazzoni, Jonathan Cameron,
	Lars-Peter Clausen, Cai Huoqing, Alexandre Belloni,
	Geert Uytterhoeven, Uwe Kleine-König

Hi Kory,

kory.maincent@bootlin.com wrote on Fri, 24 Jun 2022 11:56:17 +0200:

> Add support to mcp4921 which has only one output channel.
> 
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

> ---
>  drivers/iio/dac/mcp4922.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/mcp4922.c b/drivers/iio/dac/mcp4922.c
> index cb9e60e71b91..0d41c0f25515 100644
> --- a/drivers/iio/dac/mcp4922.c
> +++ b/drivers/iio/dac/mcp4922.c
> @@ -17,10 +17,12 @@
>  #include <linux/bitops.h>
>  
>  #define MCP4922_NUM_CHANNELS	2
> +#define MCP4921_NUM_CHANNELS	1
>  
>  enum mcp4922_supported_device_ids {
>  	ID_MCP4902,
>  	ID_MCP4912,
> +	ID_MCP4921,
>  	ID_MCP4922,
>  };
>  
> @@ -105,9 +107,10 @@ static int mcp4922_write_raw(struct iio_dev *indio_dev,
>  	}
>  }
>  
> -static const struct iio_chan_spec mcp4922_channels[3][MCP4922_NUM_CHANNELS] = {
> +static const struct iio_chan_spec mcp4922_channels[4][MCP4922_NUM_CHANNELS] = {
>  	[ID_MCP4902] = { MCP4922_CHAN(0, 8),	MCP4922_CHAN(1, 8) },
>  	[ID_MCP4912] = { MCP4922_CHAN(0, 10),	MCP4922_CHAN(1, 10) },
> +	[ID_MCP4921] = { MCP4922_CHAN(0, 12),	{} },
>  	[ID_MCP4922] = { MCP4922_CHAN(0, 12),	MCP4922_CHAN(1, 12) },
>  };
>  
> @@ -154,7 +157,10 @@ static int mcp4922_probe(struct spi_device *spi)
>  	indio_dev->info = &mcp4922_info;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  	indio_dev->channels = mcp4922_channels[id->driver_data];
> -	indio_dev->num_channels = MCP4922_NUM_CHANNELS;
> +	if (id->driver_data == ID_MCP4921)
> +		indio_dev->num_channels = MCP4921_NUM_CHANNELS;
> +	else
> +		indio_dev->num_channels = MCP4922_NUM_CHANNELS;
>  	indio_dev->name = id->name;
>  
>  	ret = iio_device_register(indio_dev);
> @@ -185,6 +191,7 @@ static void mcp4922_remove(struct spi_device *spi)
>  static const struct spi_device_id mcp4922_id[] = {
>  	{"mcp4902", ID_MCP4902},
>  	{"mcp4912", ID_MCP4912},
> +	{"mcp4921", ID_MCP4921},
>  	{"mcp4922", ID_MCP4922},
>  	{}
>  };


Thanks,
Miquèl

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

* Re: [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921
  2022-06-24  9:56 [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Kory Maincent
  2022-06-24  9:56 ` [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support Kory Maincent
  2022-06-24 17:59 ` [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Miquel Raynal
@ 2022-06-25 11:15 ` Jonathan Cameron
  2 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2022-06-25 11:15 UTC (permalink / raw)
  To: Kory Maincent
  Cc: linux-iio, linux-kernel, thomas.petazzoni, Lars-Peter Clausen,
	Cai Huoqing, Alexandre Belloni, Geert Uytterhoeven,
	Miquel Raynal, Uwe Kleine-König

On Fri, 24 Jun 2022 11:56:17 +0200
Kory Maincent <kory.maincent@bootlin.com> wrote:

> Add support to mcp4921 which has only one output channel.
> 
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>

Obviously not been on the list long, but as it 'seems' totally trivial
and has already gottten some review I'll queue it up now anyway.

Series applied to the togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/dac/mcp4922.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/mcp4922.c b/drivers/iio/dac/mcp4922.c
> index cb9e60e71b91..0d41c0f25515 100644
> --- a/drivers/iio/dac/mcp4922.c
> +++ b/drivers/iio/dac/mcp4922.c
> @@ -17,10 +17,12 @@
>  #include <linux/bitops.h>
>  
>  #define MCP4922_NUM_CHANNELS	2
> +#define MCP4921_NUM_CHANNELS	1
>  
>  enum mcp4922_supported_device_ids {
>  	ID_MCP4902,
>  	ID_MCP4912,
> +	ID_MCP4921,
>  	ID_MCP4922,
>  };
>  
> @@ -105,9 +107,10 @@ static int mcp4922_write_raw(struct iio_dev *indio_dev,
>  	}
>  }
>  
> -static const struct iio_chan_spec mcp4922_channels[3][MCP4922_NUM_CHANNELS] = {
> +static const struct iio_chan_spec mcp4922_channels[4][MCP4922_NUM_CHANNELS] = {
>  	[ID_MCP4902] = { MCP4922_CHAN(0, 8),	MCP4922_CHAN(1, 8) },
>  	[ID_MCP4912] = { MCP4922_CHAN(0, 10),	MCP4922_CHAN(1, 10) },
> +	[ID_MCP4921] = { MCP4922_CHAN(0, 12),	{} },
>  	[ID_MCP4922] = { MCP4922_CHAN(0, 12),	MCP4922_CHAN(1, 12) },
>  };
>  
> @@ -154,7 +157,10 @@ static int mcp4922_probe(struct spi_device *spi)
>  	indio_dev->info = &mcp4922_info;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  	indio_dev->channels = mcp4922_channels[id->driver_data];
> -	indio_dev->num_channels = MCP4922_NUM_CHANNELS;
> +	if (id->driver_data == ID_MCP4921)
> +		indio_dev->num_channels = MCP4921_NUM_CHANNELS;
> +	else
> +		indio_dev->num_channels = MCP4922_NUM_CHANNELS;
>  	indio_dev->name = id->name;
>  
>  	ret = iio_device_register(indio_dev);
> @@ -185,6 +191,7 @@ static void mcp4922_remove(struct spi_device *spi)
>  static const struct spi_device_id mcp4922_id[] = {
>  	{"mcp4902", ID_MCP4902},
>  	{"mcp4912", ID_MCP4912},
> +	{"mcp4921", ID_MCP4921},
>  	{"mcp4922", ID_MCP4922},
>  	{}
>  };


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

end of thread, other threads:[~2022-06-25 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24  9:56 [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Kory Maincent
2022-06-24  9:56 ` [PATCH 2/2] dt-bindings: iio: dac: mcp4922: expand for mcp4921 support Kory Maincent
2022-06-24 11:40   ` Krzysztof Kozlowski
2022-06-24 17:59 ` [PATCH 1/2] iio: dac: mcp4922: add support to mcp4921 Miquel Raynal
2022-06-25 11:15 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.