linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute
@ 2019-06-24 15:13 Stefan Popa
  2019-06-26 19:48 ` Jonathan Cameron
  2019-06-26 19:59 ` Rob Herring
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Popa @ 2019-06-24 15:13 UTC (permalink / raw)
  To: jic23, robh+dt
  Cc: mark.rutland, knaack.h, lars, pmeerw, Michael.Hennerich, gregkh,
	linux-iio, devicetree, linux-kernel, stefan.popa

Another feature of the ADF4371/ADF4372 is that the supply current to the
RF8P and RF8N output stage can shut down until the ADF4371 achieves lock
as measured by the digital lock detect circuitry. The mute to lock
detect bit (MUTE_LD) in REG25 enables this function.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
---
 .../devicetree/bindings/iio/frequency/adf4371.yaml          |  6 ++++++
 drivers/iio/frequency/adf4371.c                             | 13 +++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
index a268a9d..6db8742 100644
--- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
+++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
@@ -32,6 +32,12 @@ properties:
     items:
       - clkin
 
+  adi,mute-till-lock-en:
+    description:
+      If this property is present, then the supply current to RF8P and RF8N
+      output stage will shut down until the ADF4371/ADF4372 achieves lock as
+      measured by the digital lock detect circuitry.
+
 required:
   - compatible
   - reg
diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
index f874219..e48f15c 100644
--- a/drivers/iio/frequency/adf4371.c
+++ b/drivers/iio/frequency/adf4371.c
@@ -45,6 +45,10 @@
 #define ADF4371_RF_DIV_SEL_MSK		GENMASK(6, 4)
 #define ADF4371_RF_DIV_SEL(x)		FIELD_PREP(ADF4371_RF_DIV_SEL_MSK, x)
 
+/* ADF4371_REG25 */
+#define ADF4371_MUTE_LD_MSK		BIT(7)
+#define ADF4371_MUTE_LD(x)		FIELD_PREP(ADF4371_MUTE_LD_MSK, x)
+
 /* ADF4371_REG32 */
 #define ADF4371_TIMEOUT_MSK		GENMASK(1, 0)
 #define ADF4371_TIMEOUT(x)		FIELD_PREP(ADF4371_TIMEOUT_MSK, x)
@@ -484,6 +488,15 @@ static int adf4371_setup(struct adf4371_state *st)
 	if (ret < 0)
 		return ret;
 
+	/* Mute to Lock Detect */
+	if (device_property_read_bool(&st->spi->dev, "adi,mute-till-lock-en")) {
+		ret = regmap_update_bits(st->regmap, ADF4371_REG(0x25),
+					 ADF4371_MUTE_LD_MSK,
+					 ADF4371_MUTE_LD(1));
+		if (ret < 0)
+			return ret;
+	}
+
 	/* Set address in ascending order, so the bulk_write() will work */
 	ret = regmap_update_bits(st->regmap, ADF4371_REG(0x0),
 				 ADF4371_ADDR_ASC_MSK | ADF4371_ADDR_ASC_R_MSK,
-- 
2.7.4


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

* Re: [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute
  2019-06-24 15:13 [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute Stefan Popa
@ 2019-06-26 19:48 ` Jonathan Cameron
  2019-06-26 20:04   ` Rob Herring
  2019-06-26 19:59 ` Rob Herring
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2019-06-26 19:48 UTC (permalink / raw)
  To: Stefan Popa
  Cc: robh+dt, mark.rutland, knaack.h, lars, pmeerw, Michael.Hennerich,
	gregkh, linux-iio, devicetree, linux-kernel

On Mon, 24 Jun 2019 18:13:56 +0300
Stefan Popa <stefan.popa@analog.com> wrote:

> Another feature of the ADF4371/ADF4372 is that the supply current to the
> RF8P and RF8N output stage can shut down until the ADF4371 achieves lock
> as measured by the digital lock detect circuitry. The mute to lock
> detect bit (MUTE_LD) in REG25 enables this function.
> 
> Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Bit of fuzz on this due to me ignoring patch 1 for now.

Rob probably missed the binding as it was buried inside a patch that wasn't
clearly labelled and it is unlike him to review part of the bindings in
a series.

I'll take the view it isn't complex enough to bother him and apply it.
(of course, should any DT people want to comment it would be welcome!)

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  .../devicetree/bindings/iio/frequency/adf4371.yaml          |  6 ++++++
>  drivers/iio/frequency/adf4371.c                             | 13 +++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> index a268a9d..6db8742 100644
> --- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> +++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> @@ -32,6 +32,12 @@ properties:
>      items:
>        - clkin
>  
> +  adi,mute-till-lock-en:
> +    description:
> +      If this property is present, then the supply current to RF8P and RF8N
> +      output stage will shut down until the ADF4371/ADF4372 achieves lock as
> +      measured by the digital lock detect circuitry.
> +
>  required:
>    - compatible
>    - reg
> diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
> index f874219..e48f15c 100644
> --- a/drivers/iio/frequency/adf4371.c
> +++ b/drivers/iio/frequency/adf4371.c
> @@ -45,6 +45,10 @@
>  #define ADF4371_RF_DIV_SEL_MSK		GENMASK(6, 4)
>  #define ADF4371_RF_DIV_SEL(x)		FIELD_PREP(ADF4371_RF_DIV_SEL_MSK, x)
>  
> +/* ADF4371_REG25 */
> +#define ADF4371_MUTE_LD_MSK		BIT(7)
> +#define ADF4371_MUTE_LD(x)		FIELD_PREP(ADF4371_MUTE_LD_MSK, x)
> +
>  /* ADF4371_REG32 */
>  #define ADF4371_TIMEOUT_MSK		GENMASK(1, 0)
>  #define ADF4371_TIMEOUT(x)		FIELD_PREP(ADF4371_TIMEOUT_MSK, x)
> @@ -484,6 +488,15 @@ static int adf4371_setup(struct adf4371_state *st)
>  	if (ret < 0)
>  		return ret;
>  
> +	/* Mute to Lock Detect */
> +	if (device_property_read_bool(&st->spi->dev, "adi,mute-till-lock-en")) {
> +		ret = regmap_update_bits(st->regmap, ADF4371_REG(0x25),
> +					 ADF4371_MUTE_LD_MSK,
> +					 ADF4371_MUTE_LD(1));
> +		if (ret < 0)
> +			return ret;
> +	}
> +
>  	/* Set address in ascending order, so the bulk_write() will work */
>  	ret = regmap_update_bits(st->regmap, ADF4371_REG(0x0),
>  				 ADF4371_ADDR_ASC_MSK | ADF4371_ADDR_ASC_R_MSK,


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

* Re: [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute
  2019-06-24 15:13 [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute Stefan Popa
  2019-06-26 19:48 ` Jonathan Cameron
@ 2019-06-26 19:59 ` Rob Herring
  2019-06-26 20:13   ` Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Rob Herring @ 2019-06-26 19:59 UTC (permalink / raw)
  To: Stefan Popa
  Cc: Jonathan Cameron, Mark Rutland, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, Michael Hennerich,
	Greg Kroah-Hartman, open list:IIO SUBSYSTEM AND DRIVERS,
	devicetree, linux-kernel

On Mon, Jun 24, 2019 at 9:14 AM Stefan Popa <stefan.popa@analog.com> wrote:
>
> Another feature of the ADF4371/ADF4372 is that the supply current to the
> RF8P and RF8N output stage can shut down until the ADF4371 achieves lock
> as measured by the digital lock detect circuitry. The mute to lock
> detect bit (MUTE_LD) in REG25 enables this function.
>
> Signed-off-by: Stefan Popa <stefan.popa@analog.com>
> ---
>  .../devicetree/bindings/iio/frequency/adf4371.yaml          |  6 ++++++

If you resend and in the future, please split bindings to separate patch.

>  drivers/iio/frequency/adf4371.c                             | 13 +++++++++++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> index a268a9d..6db8742 100644
> --- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> +++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> @@ -32,6 +32,12 @@ properties:
>      items:
>        - clkin
>
> +  adi,mute-till-lock-en:
> +    description:
> +      If this property is present, then the supply current to RF8P and RF8N
> +      output stage will shut down until the ADF4371/ADF4372 achieves lock as
> +      measured by the digital lock detect circuitry.

You need to define the type:

type: boolean

Maybe Jonathan will fix up.

Rob

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

* Re: [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute
  2019-06-26 19:48 ` Jonathan Cameron
@ 2019-06-26 20:04   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2019-06-26 20:04 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Stefan Popa, Mark Rutland, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Michael Hennerich, Greg Kroah-Hartman,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree, linux-kernel

On Wed, Jun 26, 2019 at 1:48 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> On Mon, 24 Jun 2019 18:13:56 +0300
> Stefan Popa <stefan.popa@analog.com> wrote:
>
> > Another feature of the ADF4371/ADF4372 is that the supply current to the
> > RF8P and RF8N output stage can shut down until the ADF4371 achieves lock
> > as measured by the digital lock detect circuitry. The mute to lock
> > detect bit (MUTE_LD) in REG25 enables this function.
> >
> > Signed-off-by: Stefan Popa <stefan.popa@analog.com>
> Bit of fuzz on this due to me ignoring patch 1 for now.
>
> Rob probably missed the binding as it was buried inside a patch that wasn't
> clearly labelled and it is unlike him to review part of the bindings in
> a series.

I wrote my reply this morning, but then got distracted with why the
meta-schema didn't catch the problem of missing a type definition. Now
it will once I commit it and fix the other cases that we already have.

Rob

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

* Re: [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute
  2019-06-26 19:59 ` Rob Herring
@ 2019-06-26 20:13   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2019-06-26 20:13 UTC (permalink / raw)
  To: Rob Herring
  Cc: Stefan Popa, Mark Rutland, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Michael Hennerich, Greg Kroah-Hartman,
	open list:IIO SUBSYSTEM AND DRIVERS, devicetree, linux-kernel

On Wed, 26 Jun 2019 13:59:49 -0600
Rob Herring <robh+dt@kernel.org> wrote:

> On Mon, Jun 24, 2019 at 9:14 AM Stefan Popa <stefan.popa@analog.com> wrote:
> >
> > Another feature of the ADF4371/ADF4372 is that the supply current to the
> > RF8P and RF8N output stage can shut down until the ADF4371 achieves lock
> > as measured by the digital lock detect circuitry. The mute to lock
> > detect bit (MUTE_LD) in REG25 enables this function.
> >
> > Signed-off-by: Stefan Popa <stefan.popa@analog.com>
> > ---
> >  .../devicetree/bindings/iio/frequency/adf4371.yaml          |  6 ++++++  
> 
> If you resend and in the future, please split bindings to separate patch.
> 
> >  drivers/iio/frequency/adf4371.c                             | 13 +++++++++++++
> >  2 files changed, 19 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> > index a268a9d..6db8742 100644
> > --- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> > +++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> > @@ -32,6 +32,12 @@ properties:
> >      items:
> >        - clkin
> >
> > +  adi,mute-till-lock-en:
> > +    description:
> > +      If this property is present, then the supply current to RF8P and RF8N
> > +      output stage will shut down until the ADF4371/ADF4372 achieves lock as
> > +      measured by the digital lock detect circuitry.  
> 
> You need to define the type:
> 
> type: boolean
> 
> Maybe Jonathan will fix up.
Doh. I should have caught that.

Fixed up with
type: boolean

Hopefully I did it right

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=6e68162fcc94ec81c1656e15e6e1893fee0c309a

Thanks Rob!

Jonathan

> 
> Rob


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

end of thread, other threads:[~2019-06-26 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 15:13 [PATCH 4/4] iio: frequency: adf4371: Add support for output stage mute Stefan Popa
2019-06-26 19:48 ` Jonathan Cameron
2019-06-26 20:04   ` Rob Herring
2019-06-26 19:59 ` Rob Herring
2019-06-26 20:13   ` 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).