devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree
@ 2023-11-27 15:55 Nuno Sa via B4 Relay
  2023-11-27 15:55 ` [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF Nuno Sa via B4 Relay
  2023-11-27 15:55 ` [PATCH 2/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree Nuno Sa via B4 Relay
  0 siblings, 2 replies; 6+ messages in thread
From: Nuno Sa via B4 Relay @ 2023-11-27 15:55 UTC (permalink / raw)
  To: linux-iio, devicetree
  Cc: Lars-Peter Clausen, Michael Hennerich, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Michael Hennerich

Simple series to add support for an external amplifier to be connected
in again of two configuration.

---
Michael Hennerich (2):
      dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF
      iio: dac: ad5791: Add support for controlling RBUF via devicetree

 Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml | 5 +++++
 drivers/iio/dac/ad5791.c                                  | 9 ++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

Thanks!
- Nuno Sá


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

* [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF
  2023-11-27 15:55 [PATCH 0/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree Nuno Sa via B4 Relay
@ 2023-11-27 15:55 ` Nuno Sa via B4 Relay
  2023-11-28  9:33   ` Krzysztof Kozlowski
  2023-11-27 15:55 ` [PATCH 2/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree Nuno Sa via B4 Relay
  1 sibling, 1 reply; 6+ messages in thread
From: Nuno Sa via B4 Relay @ 2023-11-27 15:55 UTC (permalink / raw)
  To: linux-iio, devicetree
  Cc: Lars-Peter Clausen, Michael Hennerich, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

This patch adds support for an external amplifier to be connected in a
gain of two configuration.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
index 3a84739736f6..c81285d84db7 100644
--- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
@@ -26,6 +26,11 @@ properties:
   vdd-supply: true
   vss-supply: true
 
+  adi,rbuf-gain2-en:
+    description: Specify to allow an external amplifier to be connected in a
+      gain of two configuration.
+    type: boolean
+
 required:
   - compatible
   - reg

-- 
2.43.0


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

* [PATCH 2/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree
  2023-11-27 15:55 [PATCH 0/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree Nuno Sa via B4 Relay
  2023-11-27 15:55 ` [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF Nuno Sa via B4 Relay
@ 2023-11-27 15:55 ` Nuno Sa via B4 Relay
  1 sibling, 0 replies; 6+ messages in thread
From: Nuno Sa via B4 Relay @ 2023-11-27 15:55 UTC (permalink / raw)
  To: linux-iio, devicetree
  Cc: Lars-Peter Clausen, Michael Hennerich, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

This patch adds support for an external amplifier to be connected in a
gain of two configuration.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/iio/dac/ad5791.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5791.c b/drivers/iio/dac/ad5791.c
index a4167454da81..75b549827e15 100644
--- a/drivers/iio/dac/ad5791.c
+++ b/drivers/iio/dac/ad5791.c
@@ -345,6 +345,7 @@ static int ad5791_probe(struct spi_device *spi)
 	struct iio_dev *indio_dev;
 	struct ad5791_state *st;
 	int ret, pos_voltage_uv = 0, neg_voltage_uv = 0;
+	bool use_rbuf_gain2;
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
 	if (!indio_dev)
@@ -379,6 +380,12 @@ static int ad5791_probe(struct spi_device *spi)
 	st->pwr_down = true;
 	st->spi = spi;
 
+	if (pdata)
+		use_rbuf_gain2 = pdata->use_rbuf_gain2;
+	else
+		use_rbuf_gain2 = device_property_read_bool(&spi->dev,
+							   "adi,rbuf-gain2-en");
+
 	if (!IS_ERR(st->reg_vss) && !IS_ERR(st->reg_vdd)) {
 		st->vref_mv = (pos_voltage_uv + neg_voltage_uv) / 1000;
 		st->vref_neg_mv = neg_voltage_uv / 1000;
@@ -398,7 +405,7 @@ static int ad5791_probe(struct spi_device *spi)
 
 
 	st->ctrl = AD5761_CTRL_LINCOMP(st->chip_info->get_lin_comp(st->vref_mv))
-		  | ((pdata && pdata->use_rbuf_gain2) ? 0 : AD5791_CTRL_RBUF) |
+		  | (use_rbuf_gain2 ? 0 : AD5791_CTRL_RBUF) |
 		  AD5791_CTRL_BIN2SC;
 
 	ret = ad5791_spi_write(st, AD5791_ADDR_CTRL, st->ctrl |

-- 
2.43.0


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

* Re: [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF
  2023-11-27 15:55 ` [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF Nuno Sa via B4 Relay
@ 2023-11-28  9:33   ` Krzysztof Kozlowski
  2023-11-28 10:11     ` Nuno Sá
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-28  9:33 UTC (permalink / raw)
  To: nuno.sa, linux-iio, devicetree
  Cc: Lars-Peter Clausen, Michael Hennerich, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On 27/11/2023 16:55, Nuno Sa via B4 Relay wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
> 

Subject: drop ".yaml"

> This patch adds support for an external amplifier to be connected in a

Please do not use "This commit/patch", but imperative mood. See longer
explanation here:
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

> gain of two configuration.
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> ---
>  Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> index 3a84739736f6..c81285d84db7 100644
> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> @@ -26,6 +26,11 @@ properties:
>    vdd-supply: true
>    vss-supply: true
>  
> +  adi,rbuf-gain2-en:
> +    description: Specify to allow an external amplifier to be connected in a
> +      gain of two configuration.

I don't understand this. Without this property external amplifier is not
allowed to be connected? This sounds like some policy, but should rather
focus on hardware.

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF
  2023-11-28 10:11     ` Nuno Sá
@ 2023-11-28 10:09       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-28 10:09 UTC (permalink / raw)
  To: Nuno Sá, nuno.sa, linux-iio, devicetree
  Cc: Lars-Peter Clausen, Michael Hennerich, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On 28/11/2023 11:11, Nuno Sá wrote:
> On Tue, 2023-11-28 at 10:33 +0100, Krzysztof Kozlowski wrote:
>> On 27/11/2023 16:55, Nuno Sa via B4 Relay wrote:
>>> From: Michael Hennerich <michael.hennerich@analog.com>
>>>
>>
>> Subject: drop ".yaml"
> 
> Will do...
> 
>>
>>> This patch adds support for an external amplifier to be connected in a
>>
>> Please do not use "This commit/patch", but imperative mood. See longer
>> explanation here:
>> https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95
> 
> ack...
> 
>>
>>> gain of two configuration.
>>>
>>> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
>>> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
>>> ---
>>>  Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
>>> b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
>>> index 3a84739736f6..c81285d84db7 100644
>>> --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
>>> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
>>> @@ -26,6 +26,11 @@ properties:
>>>    vdd-supply: true
>>>    vss-supply: true
>>>  
>>> +  adi,rbuf-gain2-en:
>>> +    description: Specify to allow an external amplifier to be connected in
>>> a
>>> +      gain of two configuration.
>>
>> I don't understand this. Without this property external amplifier is not
>> allowed to be connected? This sounds like some policy, but should rather
>> focus on hardware.
>>
> 
> Well, this really translates in a different configuration in the device. If this
> is set then the device is configured to allow an external amplifier to be
> connected in a gain of two configuration which depends on the HW setup you want
> the chip to be.
> 
> The description already states pretty much what the datasheet says. So while I
> understand it's a fair question from you (you don't have the time to check all
> datasheets for reviews you do), I'm not sure there's much more to add into the
> description of the property.
> 

OK, it's fine there. With earlier fixes:

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

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF
  2023-11-28  9:33   ` Krzysztof Kozlowski
@ 2023-11-28 10:11     ` Nuno Sá
  2023-11-28 10:09       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Nuno Sá @ 2023-11-28 10:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski, nuno.sa, linux-iio, devicetree
  Cc: Lars-Peter Clausen, Michael Hennerich, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On Tue, 2023-11-28 at 10:33 +0100, Krzysztof Kozlowski wrote:
> On 27/11/2023 16:55, Nuno Sa via B4 Relay wrote:
> > From: Michael Hennerich <michael.hennerich@analog.com>
> > 
> 
> Subject: drop ".yaml"

Will do...

> 
> > This patch adds support for an external amplifier to be connected in a
> 
> Please do not use "This commit/patch", but imperative mood. See longer
> explanation here:
> https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

ack...

> 
> > gain of two configuration.
> > 
> > Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > ---
> >  Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > index 3a84739736f6..c81285d84db7 100644
> > --- a/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5791.yaml
> > @@ -26,6 +26,11 @@ properties:
> >    vdd-supply: true
> >    vss-supply: true
> >  
> > +  adi,rbuf-gain2-en:
> > +    description: Specify to allow an external amplifier to be connected in
> > a
> > +      gain of two configuration.
> 
> I don't understand this. Without this property external amplifier is not
> allowed to be connected? This sounds like some policy, but should rather
> focus on hardware.
> 

Well, this really translates in a different configuration in the device. If this
is set then the device is configured to allow an external amplifier to be
connected in a gain of two configuration which depends on the HW setup you want
the chip to be.

The description already states pretty much what the datasheet says. So while I
understand it's a fair question from you (you don't have the time to check all
datasheets for reviews you do), I'm not sure there's much more to add into the
description of the property.

- Nuno Sá


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

end of thread, other threads:[~2023-11-28 10:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27 15:55 [PATCH 0/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree Nuno Sa via B4 Relay
2023-11-27 15:55 ` [PATCH 1/2] dt-bindings: adi,ad5791.yaml: Add support for controlling RBUF Nuno Sa via B4 Relay
2023-11-28  9:33   ` Krzysztof Kozlowski
2023-11-28 10:11     ` Nuno Sá
2023-11-28 10:09       ` Krzysztof Kozlowski
2023-11-27 15:55 ` [PATCH 2/2] iio: dac: ad5791: Add support for controlling RBUF via devicetree Nuno Sa via B4 Relay

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