Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators
@ 2023-07-31  9:44 Antoniu Miclaus
  2023-07-31  9:44 ` [PATCH v3 2/2] drivers: " Antoniu Miclaus
  2023-08-01 21:09 ` [PATCH v3 1/2] dt-bindings: " Conor Dooley
  0 siblings, 2 replies; 4+ messages in thread
From: Antoniu Miclaus @ 2023-07-31  9:44 UTC (permalink / raw)
  To: jic23, robh+dt, krzysztof.kozlowski+dt, conor+dt, linux-iio,
	devicetree, linux-kernel
  Cc: Antoniu Miclaus

Add bindings for the VCC regulators of the ADMV1013 microware
upconverter.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
changes in v3:
 - add missing spaces in the commit subject.
 .../bindings/iio/frequency/adi,admv1013.yaml  | 60 +++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
index fc813bcb6532..f2eb2287ed9e 100644
--- a/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
+++ b/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
@@ -39,6 +39,46 @@ properties:
     description:
       Analog voltage regulator.
 
+  vcc-drv-supply:
+    description:
+      RF Driver voltage regulator.
+
+  vcc2-drv-supply:
+    description:
+      RF predriver voltage regulator.
+
+  vcc-vva-supply:
+    description:
+      VVA Control Circuit voltage regulator.
+
+  vcc-amp1-supply:
+    description:
+      RF Amplifier 1 voltage regulator.
+
+  vcc-amp2-supply:
+    description:
+      RF Amplifier 2 voltage regulator.
+
+  vcc-env-supply:
+    description:
+      Envelope Detector voltage regulator.
+
+  vcc-bg-supply:
+    description:
+      Mixer Chip Band Gap Circuit voltage regulator.
+
+  vcc-bg2-supply:
+    description:
+      VGA Chip Band Gap Circuit voltage regulator.
+
+  vcc-mixer-supply:
+    description:
+      Mixer voltage regulator.
+
+  vcc-quad-supply:
+    description:
+      Quadruppler voltage regulator.
+
   adi,detector-enable:
     description:
       Enable the Envelope Detector available at output pins VENV_P and
@@ -69,6 +109,16 @@ required:
   - clocks
   - clock-names
   - vcm-supply
+  - vcc-drv-supply
+  - vcc2-drv-supply
+  - vcc-vva-supply
+  - vcc-amp1-supply
+  - vcc-amp2-supply
+  - vcc-env-supply
+  - vcc-bg-supply
+  - vcc-bg2-supply
+  - vcc-mixer-supply
+  - vcc-quad-supply
 
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
@@ -87,6 +137,16 @@ examples:
         clocks = <&admv1013_lo>;
         clock-names = "lo_in";
         vcm-supply = <&vcm>;
+        vcc-drv-supply = <&vcc_drv>;
+        vcc2-drv-supply = <&vcc2_drv>;
+        vcc-vva-supply = <&vcc_vva>;
+        vcc-amp1-supply = <&vcc_amp1>;
+        vcc-amp2-supply = <&vcc_amp2>;
+        vcc-env-supply = <&vcc_env>;
+        vcc-bg-supply = <&vcc_bg>;
+        vcc-bg2-supply = <&vcc_bg2>;
+        vcc-mixer-supply = <&vcc_mixer>;
+        vcc-quad-supply = <&vcc_quad>;
         adi,quad-se-mode = "diff";
         adi,detector-enable;
       };
-- 
2.41.0


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

* [PATCH v3 2/2] drivers: iio: admv1013: add vcc regulators
  2023-07-31  9:44 [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators Antoniu Miclaus
@ 2023-07-31  9:44 ` Antoniu Miclaus
  2023-08-01 21:09 ` [PATCH v3 1/2] dt-bindings: " Conor Dooley
  1 sibling, 0 replies; 4+ messages in thread
From: Antoniu Miclaus @ 2023-07-31  9:44 UTC (permalink / raw)
  To: jic23, robh+dt, krzysztof.kozlowski+dt, conor+dt, linux-iio,
	devicetree, linux-kernel
  Cc: Antoniu Miclaus

Add regulators for the VCC supplies of the admv1013.

The patch aims to align the implementation with the current admv1014
driver where all the VCC supplies are handled as regulators.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
changes in v3:
 - add missing spaces in the commit subject.
 - use dev_err_probe for error handling.
 -  - use `devm_regulator_bulk_get_enable`
 drivers/iio/frequency/admv1013.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
index 9bf8337806fc..cc01fac2dfee 100644
--- a/drivers/iio/frequency/admv1013.c
+++ b/drivers/iio/frequency/admv1013.c
@@ -379,6 +379,11 @@ static const struct iio_info admv1013_info = {
 	.debugfs_reg_access = &admv1013_reg_access,
 };
 
+static const char * const admv1013_vcc_regs[] = {
+	 "vcc-drv", "vcc2-drv", "vcc-vva", "vcc-amp1", "vcc-amp2",
+	 "vcc-env", "vcc-bg", "vcc-bg2", "vcc-mixer", "vcc-quad"
+};
+
 static int admv1013_freq_change(struct notifier_block *nb, unsigned long action, void *data)
 {
 	struct admv1013_state *st = container_of(nb, struct admv1013_state, nb);
@@ -554,6 +559,15 @@ static int admv1013_properties_parse(struct admv1013_state *st)
 		return dev_err_probe(&spi->dev, PTR_ERR(st->reg),
 				     "failed to get the common-mode voltage\n");
 
+	ret = devm_regulator_bulk_get_enable(&st->spi->dev,
+					     ARRAY_SIZE(admv1013_vcc_regs),
+					     admv1013_vcc_regs);
+	if (ret) {
+		dev_err_probe(&spi->dev, ret,
+			      "Failed to request VCC regulators\n");
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
2.41.0


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

* Re: [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators
  2023-07-31  9:44 [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators Antoniu Miclaus
  2023-07-31  9:44 ` [PATCH v3 2/2] drivers: " Antoniu Miclaus
@ 2023-08-01 21:09 ` Conor Dooley
  2023-08-05 18:10   ` Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: Conor Dooley @ 2023-08-01 21:09 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: jic23, robh+dt, krzysztof.kozlowski+dt, conor+dt, linux-iio,
	devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3174 bytes --]

On Mon, Jul 31, 2023 at 12:44:54PM +0300, Antoniu Miclaus wrote:
> Add bindings for the VCC regulators of the ADMV1013 microware
> upconverter.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>

Assuming the driver or regulator core handles the missing regulators on
older devicetrees (which I think it does with dummy regulators?)
Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
> changes in v3:
>  - add missing spaces in the commit subject.
>  .../bindings/iio/frequency/adi,admv1013.yaml  | 60 +++++++++++++++++++
>  1 file changed, 60 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
> index fc813bcb6532..f2eb2287ed9e 100644
> --- a/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
> +++ b/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
> @@ -39,6 +39,46 @@ properties:
>      description:
>        Analog voltage regulator.
>  
> +  vcc-drv-supply:
> +    description:
> +      RF Driver voltage regulator.
> +
> +  vcc2-drv-supply:
> +    description:
> +      RF predriver voltage regulator.
> +
> +  vcc-vva-supply:
> +    description:
> +      VVA Control Circuit voltage regulator.
> +
> +  vcc-amp1-supply:
> +    description:
> +      RF Amplifier 1 voltage regulator.
> +
> +  vcc-amp2-supply:
> +    description:
> +      RF Amplifier 2 voltage regulator.
> +
> +  vcc-env-supply:
> +    description:
> +      Envelope Detector voltage regulator.
> +
> +  vcc-bg-supply:
> +    description:
> +      Mixer Chip Band Gap Circuit voltage regulator.
> +
> +  vcc-bg2-supply:
> +    description:
> +      VGA Chip Band Gap Circuit voltage regulator.
> +
> +  vcc-mixer-supply:
> +    description:
> +      Mixer voltage regulator.
> +
> +  vcc-quad-supply:
> +    description:
> +      Quadruppler voltage regulator.
> +
>    adi,detector-enable:
>      description:
>        Enable the Envelope Detector available at output pins VENV_P and
> @@ -69,6 +109,16 @@ required:
>    - clocks
>    - clock-names
>    - vcm-supply
> +  - vcc-drv-supply
> +  - vcc2-drv-supply
> +  - vcc-vva-supply
> +  - vcc-amp1-supply
> +  - vcc-amp2-supply
> +  - vcc-env-supply
> +  - vcc-bg-supply
> +  - vcc-bg2-supply
> +  - vcc-mixer-supply
> +  - vcc-quad-supply
>  
>  allOf:
>    - $ref: /schemas/spi/spi-peripheral-props.yaml#
> @@ -87,6 +137,16 @@ examples:
>          clocks = <&admv1013_lo>;
>          clock-names = "lo_in";
>          vcm-supply = <&vcm>;
> +        vcc-drv-supply = <&vcc_drv>;
> +        vcc2-drv-supply = <&vcc2_drv>;
> +        vcc-vva-supply = <&vcc_vva>;
> +        vcc-amp1-supply = <&vcc_amp1>;
> +        vcc-amp2-supply = <&vcc_amp2>;
> +        vcc-env-supply = <&vcc_env>;
> +        vcc-bg-supply = <&vcc_bg>;
> +        vcc-bg2-supply = <&vcc_bg2>;
> +        vcc-mixer-supply = <&vcc_mixer>;
> +        vcc-quad-supply = <&vcc_quad>;
>          adi,quad-se-mode = "diff";
>          adi,detector-enable;
>        };
> -- 
> 2.41.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators
  2023-08-01 21:09 ` [PATCH v3 1/2] dt-bindings: " Conor Dooley
@ 2023-08-05 18:10   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2023-08-05 18:10 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Antoniu Miclaus, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	linux-iio, devicetree, linux-kernel

On Tue, 1 Aug 2023 22:09:28 +0100
Conor Dooley <conor@kernel.org> wrote:

> On Mon, Jul 31, 2023 at 12:44:54PM +0300, Antoniu Miclaus wrote:
> > Add bindings for the VCC regulators of the ADMV1013 microware
> > upconverter.
> > 
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>  
> 
> Assuming the driver or regulator core handles the missing regulators on
> older devicetrees (which I think it does with dummy regulators?)

Yup - that should happen fine.

> Acked-by: Conor Dooley <conor.dooley@microchip.com>

Series applied to the togreg branch of iio.git and pushed out as
testing for 0-day to poke at it.

Thanks,

Jonathan

> 
> Thanks,
> Conor.
> 
> > ---
> > changes in v3:
> >  - add missing spaces in the commit subject.
> >  .../bindings/iio/frequency/adi,admv1013.yaml  | 60 +++++++++++++++++++
> >  1 file changed, 60 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
> > index fc813bcb6532..f2eb2287ed9e 100644
> > --- a/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
> > +++ b/Documentation/devicetree/bindings/iio/frequency/adi,admv1013.yaml
> > @@ -39,6 +39,46 @@ properties:
> >      description:
> >        Analog voltage regulator.
> >  
> > +  vcc-drv-supply:
> > +    description:
> > +      RF Driver voltage regulator.
> > +
> > +  vcc2-drv-supply:
> > +    description:
> > +      RF predriver voltage regulator.
> > +
> > +  vcc-vva-supply:
> > +    description:
> > +      VVA Control Circuit voltage regulator.
> > +
> > +  vcc-amp1-supply:
> > +    description:in/v3_20230731_antoniu_miclaus_dt_bindings_iio_admv1013_add_vcc_regulators.mbx
> > +      RF Amplifier 1 voltage regulator.
> > +
> > +  vcc-amp2-supply:
> > +    description:
> > +      RF Amplifier 2 voltage regulator.
> > +
> > +  vcc-env-supply:
> > +    description:
> > +      Envelope Detector voltage regulator.
> > +
> > +  vcc-bg-supply:
> > +    description:
> > +      Mixer Chip Band Gap Circuit voltage regulator.
> > +
> > +  vcc-bg2-supply:
> > +    description:
> > +      VGA Chip Band Gap Circuit voltage regulator.
> > +
> > +  vcc-mixer-supply:
> > +    description:
> > +      Mixer voltage regulator.
> > +
> > +  vcc-quad-supply:
> > +    description:
> > +      Quadruppler voltage regulator.
> > +
> >    adi,detector-enable:
> >      description:
> >        Enable the Envelope Detector available at output pins VENV_P and
> > @@ -69,6 +109,16 @@ required:
> >    - clocks
> >    - clock-names
> >    - vcm-supply
> > +  - vcc-drv-supply
> > +  - vcc2-drv-supply
> > +  - vcc-vva-supply
> > +  - vcc-amp1-supply
> > +  - vcc-amp2-supply
> > +  - vcc-env-supply
> > +  - vcc-bg-supply
> > +  - vcc-bg2-supply
> > +  - vcc-mixer-supply
> > +  - vcc-quad-supply
> >  
> >  allOf:
> >    - $ref: /schemas/spi/spi-peripheral-props.yaml#
> > @@ -87,6 +137,16 @@ examples:
> >          clocks = <&admv1013_lo>;
> >          clock-names = "lo_in";
> >          vcm-supply = <&vcm>;
> > +        vcc-drv-supply = <&vcc_drv>;
> > +        vcc2-drv-supply = <&vcc2_drv>;
> > +        vcc-vva-supply = <&vcc_vva>;
> > +        vcc-amp1-supply = <&vcc_amp1>;
> > +        vcc-amp2-supply = <&vcc_amp2>;
> > +        vcc-env-supply = <&vcc_env>;
> > +        vcc-bg-supply = <&vcc_bg>;
> > +        vcc-bg2-supply = <&vcc_bg2>;
> > +        vcc-mixer-supply = <&vcc_mixer>;
> > +        vcc-quad-supply = <&vcc_quad>;
> >          adi,quad-se-mode = "diff";
> >          adi,detector-enable;
> >        };
> > -- 
> > 2.41.0
> >   


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

end of thread, other threads:[~2023-08-05 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31  9:44 [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators Antoniu Miclaus
2023-07-31  9:44 ` [PATCH v3 2/2] drivers: " Antoniu Miclaus
2023-08-01 21:09 ` [PATCH v3 1/2] dt-bindings: " Conor Dooley
2023-08-05 18:10   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox