2023-07-31 12:20:46

by Antoniu Miclaus

[permalink] [raw]
Subject: [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators

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

Signed-off-by: Antoniu Miclaus <[email protected]>
---
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



2023-07-31 12:55:32

by Antoniu Miclaus

[permalink] [raw]
Subject: [PATCH v3 2/2] drivers: iio: admv1013: add vcc regulators

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 <[email protected]>
---
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


2023-08-01 21:28:53

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators

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 <[email protected]>

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 <[email protected]>

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
>


Attachments:
(No filename) (3.10 kB)
signature.asc (235.00 B)
Download all attachments

2023-08-05 19:47:06

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v3 1/2] dt-bindings: iio: admv1013: add vcc regulators

On Tue, 1 Aug 2023 22:09:28 +0100
Conor Dooley <[email protected]> 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 <[email protected]>
>
> 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 <[email protected]>

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