public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/3] ADF4371 refin mode and doubler support
@ 2025-01-27 10:10 Antoniu Miclaus
  2025-01-27 10:10 ` [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode Antoniu Miclaus
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Antoniu Miclaus @ 2025-01-27 10:10 UTC (permalink / raw)
  To: jic23, robh, conor+dt, linux-iio, devicetree, linux-kernel,
	linux-pwm
  Cc: Antoniu Miclaus

Add support for selecting between single-ended and differential
reference input. By default the single-ended input is enabled.

Input frequency boundaries are change based on the mode selected
(single-ended/differential).

Add support for the reference doubler. This feature is enabled
automatically to improve noise performance if the input frequency
is within the accepted range.

Antoniu Miclaus (3):
  dt-bindings: iio: adf4371: add refin mode
  iio: frequency: adf4371: add refin mode
  iio: frequency: adf4371: add ref doubler

 .../bindings/iio/frequency/adf4371.yaml       |  5 +-
 drivers/iio/frequency/adf4371.c               | 47 ++++++++++++++++---
 2 files changed, 44 insertions(+), 8 deletions(-)

-- 
2.48.1


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

* [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode
  2025-01-27 10:10 [PATCH v6 0/3] ADF4371 refin mode and doubler support Antoniu Miclaus
@ 2025-01-27 10:10 ` Antoniu Miclaus
  2025-01-27 17:53   ` Conor Dooley
  2025-01-27 10:10 ` [PATCH v6 2/3] iio: frequency: " Antoniu Miclaus
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Antoniu Miclaus @ 2025-01-27 10:10 UTC (permalink / raw)
  To: jic23, robh, conor+dt, linux-iio, devicetree, linux-kernel,
	linux-pwm
  Cc: Antoniu Miclaus

Add support for selecting between single-ended and differential
reference input.

Input frequency boundaries are change based on the mode selected
(single-ended/differential).

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
no changes in v6.
 Documentation/devicetree/bindings/iio/frequency/adf4371.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
index 1cb2adaf66f9..53d607441612 100644
--- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
+++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
@@ -30,8 +30,9 @@ properties:
 
   clock-names:
     description:
-      Must be "clkin"
-    maxItems: 1
+      Must be "clkin" if the input reference is single ended or "clkin-diff"
+      if the input reference is differential.
+    enum: [clkin, clkin-diff]
 
   adi,mute-till-lock-en:
     type: boolean
-- 
2.48.1


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

* [PATCH v6 2/3] iio: frequency: adf4371: add refin mode
  2025-01-27 10:10 [PATCH v6 0/3] ADF4371 refin mode and doubler support Antoniu Miclaus
  2025-01-27 10:10 ` [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode Antoniu Miclaus
@ 2025-01-27 10:10 ` Antoniu Miclaus
  2025-02-01 12:32   ` Jonathan Cameron
  2025-01-27 10:10 ` [PATCH v6 3/3] iio: frequency: adf4371: add ref doubler Antoniu Miclaus
  2025-02-01 12:33 ` [PATCH v6 0/3] ADF4371 refin mode and doubler support Jonathan Cameron
  3 siblings, 1 reply; 9+ messages in thread
From: Antoniu Miclaus @ 2025-01-27 10:10 UTC (permalink / raw)
  To: jic23, robh, conor+dt, linux-iio, devicetree, linux-kernel,
	linux-pwm
  Cc: Antoniu Miclaus, Nuno Sa

Add support for single-ended/differential reference input mode.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
no changes in v6.
 drivers/iio/frequency/adf4371.c | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
index d752507e0c98..205dfd341489 100644
--- a/drivers/iio/frequency/adf4371.c
+++ b/drivers/iio/frequency/adf4371.c
@@ -42,6 +42,10 @@
 #define ADF4371_MOD2WORD_MSK		GENMASK(5, 0)
 #define ADF4371_MOD2WORD(x)		FIELD_PREP(ADF4371_MOD2WORD_MSK, x)
 
+/* ADF4371_REG22 */
+#define ADF4371_REFIN_MODE_MASK		BIT(6)
+#define ADF4371_REFIN_MODE(x)		FIELD_PREP(ADF4371_REFIN_MODE_MASK, x)
+
 /* ADF4371_REG24 */
 #define ADF4371_RF_DIV_SEL_MSK		GENMASK(6, 4)
 #define ADF4371_RF_DIV_SEL(x)		FIELD_PREP(ADF4371_RF_DIV_SEL_MSK, x)
@@ -70,6 +74,7 @@
 
 #define ADF4371_MAX_FREQ_PFD		250000000UL /* Hz */
 #define ADF4371_MAX_FREQ_REFIN		600000000UL /* Hz */
+#define ADF4371_MAX_FREQ_REFIN_SE	500000000UL /* Hz */
 
 /* MOD1 is a 24-bit primary modulus with fixed value of 2^25 */
 #define ADF4371_MODULUS1		33554432ULL
@@ -176,6 +181,7 @@ struct adf4371_state {
 	unsigned int mod2;
 	unsigned int rf_div_sel;
 	unsigned int ref_div_factor;
+	bool ref_diff_en;
 	u8 buf[10] __aligned(IIO_DMA_MINALIGN);
 };
 
@@ -505,6 +511,17 @@ static int adf4371_setup(struct adf4371_state *st)
 				 ADF4371_ADDR_ASC(1) | ADF4371_ADDR_ASC_R(1));
 	if (ret < 0)
 		return ret;
+
+	if ((st->ref_diff_en && st->clkin_freq > ADF4371_MAX_FREQ_REFIN) ||
+	    (!st->ref_diff_en && st->clkin_freq > ADF4371_MAX_FREQ_REFIN_SE))
+		return -EINVAL;
+
+	ret = regmap_update_bits(st->regmap,  ADF4371_REG(0x22),
+				 ADF4371_REFIN_MODE_MASK,
+				 ADF4371_REFIN_MODE(st->ref_diff_en));
+	if (ret < 0)
+		return ret;
+
 	/*
 	 * Calculate and maximize PFD frequency
 	 * fPFD = REFIN × ((1 + D)/(R × (1 + T)))
@@ -574,10 +591,16 @@ static int adf4371_probe(struct spi_device *spi)
 	indio_dev->channels = st->chip_info->channels;
 	indio_dev->num_channels = st->chip_info->num_channels;
 
-	clkin = devm_clk_get_enabled(&spi->dev, "clkin");
-	if (IS_ERR(clkin))
-		return dev_err_probe(&spi->dev, PTR_ERR(clkin),
-				     "Failed to get clkin\n");
+	st->ref_diff_en = false;
+
+	st->clkin = devm_clk_get_enabled(&spi->dev, "clkin");
+	if (IS_ERR(st->clkin)) {
+		st->clkin = devm_clk_get_enabled(&spi->dev, "clkin-diff");
+		if (IS_ERR(st->clkin))
+			return dev_err_probe(&spi->dev, PTR_ERR(clkin),
+				     "Failed to get clkin/clkin-diff\n");
+		st->ref_diff_en = true;
+	}
 
 	st->clkin_freq = clk_get_rate(clkin);
 
-- 
2.48.1


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

* [PATCH v6 3/3] iio: frequency: adf4371: add ref doubler
  2025-01-27 10:10 [PATCH v6 0/3] ADF4371 refin mode and doubler support Antoniu Miclaus
  2025-01-27 10:10 ` [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode Antoniu Miclaus
  2025-01-27 10:10 ` [PATCH v6 2/3] iio: frequency: " Antoniu Miclaus
@ 2025-01-27 10:10 ` Antoniu Miclaus
  2025-02-01 12:33 ` [PATCH v6 0/3] ADF4371 refin mode and doubler support Jonathan Cameron
  3 siblings, 0 replies; 9+ messages in thread
From: Antoniu Miclaus @ 2025-01-27 10:10 UTC (permalink / raw)
  To: jic23, robh, conor+dt, linux-iio, devicetree, linux-kernel,
	linux-pwm
  Cc: Antoniu Miclaus, Nuno Sa

Add support for the reference doubler.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
changes in v6:
 - rebase with latest version and resolve conflicts.
 drivers/iio/frequency/adf4371.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
index 205dfd341489..55516ececb23 100644
--- a/drivers/iio/frequency/adf4371.c
+++ b/drivers/iio/frequency/adf4371.c
@@ -45,6 +45,8 @@
 /* ADF4371_REG22 */
 #define ADF4371_REFIN_MODE_MASK		BIT(6)
 #define ADF4371_REFIN_MODE(x)		FIELD_PREP(ADF4371_REFIN_MODE_MASK, x)
+#define ADF4371_REF_DOUB_MASK		BIT(5)
+#define ADF4371_REF_DOUB(x)		FIELD_PREP(ADF4371_REF_DOUB_MASK, x)\
 
 /* ADF4371_REG24 */
 #define ADF4371_RF_DIV_SEL_MSK		GENMASK(6, 4)
@@ -76,6 +78,9 @@
 #define ADF4371_MAX_FREQ_REFIN		600000000UL /* Hz */
 #define ADF4371_MAX_FREQ_REFIN_SE	500000000UL /* Hz */
 
+#define ADF4371_MIN_CLKIN_DOUB_FREQ	10000000ULL /* Hz */
+#define ADF4371_MAX_CLKIN_DOUB_FREQ	125000000ULL /* Hz */
+
 /* MOD1 is a 24-bit primary modulus with fixed value of 2^25 */
 #define ADF4371_MODULUS1		33554432ULL
 /* MOD2 is the programmable, 14-bit auxiliary fractional modulus */
@@ -483,7 +488,7 @@ static const struct iio_info adf4371_info = {
 static int adf4371_setup(struct adf4371_state *st)
 {
 	unsigned int synth_timeout = 2, timeout = 1, vco_alc_timeout = 1;
-	unsigned int vco_band_div, tmp;
+	unsigned int vco_band_div, tmp, ref_doubler_en = 0;
 	int ret;
 
 	/* Perform a software reset */
@@ -516,8 +521,14 @@ static int adf4371_setup(struct adf4371_state *st)
 	    (!st->ref_diff_en && st->clkin_freq > ADF4371_MAX_FREQ_REFIN_SE))
 		return -EINVAL;
 
+	if (st->clkin_freq < ADF4371_MAX_CLKIN_DOUB_FREQ &&
+	    st->clkin_freq > ADF4371_MIN_CLKIN_DOUB_FREQ)
+		ref_doubler_en = 1;
+
 	ret = regmap_update_bits(st->regmap,  ADF4371_REG(0x22),
+				 ADF4371_REF_DOUB_MASK |
 				 ADF4371_REFIN_MODE_MASK,
+				 ADF4371_REF_DOUB(ref_doubler_en) |
 				 ADF4371_REFIN_MODE(st->ref_diff_en));
 	if (ret < 0)
 		return ret;
@@ -531,7 +542,8 @@ static int adf4371_setup(struct adf4371_state *st)
 	 */
 	do {
 		st->ref_div_factor++;
-		st->fpfd = st->clkin_freq / st->ref_div_factor;
+		st->fpfd = st->clkin_freq * (1 + ref_doubler_en) /
+			   st->ref_div_factor;
 	} while (st->fpfd > ADF4371_MAX_FREQ_PFD);
 
 	/* Calculate Timeouts */
-- 
2.48.1


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

* Re: [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode
  2025-01-27 10:10 ` [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode Antoniu Miclaus
@ 2025-01-27 17:53   ` Conor Dooley
  2025-01-28 10:24     ` Miclaus, Antoniu
  0 siblings, 1 reply; 9+ messages in thread
From: Conor Dooley @ 2025-01-27 17:53 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: jic23, robh, conor+dt, linux-iio, devicetree, linux-kernel,
	linux-pwm

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

On Mon, Jan 27, 2025 at 12:10:21PM +0200, Antoniu Miclaus wrote:
> Add support for selecting between single-ended and differential
> reference input.
> 
> Input frequency boundaries are change based on the mode selected
> (single-ended/differential).
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
> no changes in v6.

Why'd you not pick up my ack?
https://lore.kernel.org/all/20250121-crumb-dispense-b455b591481a@spud/
:
>  Documentation/devicetree/bindings/iio/frequency/adf4371.yaml | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> index 1cb2adaf66f9..53d607441612 100644
> --- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> +++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> @@ -30,8 +30,9 @@ properties:
>  
>    clock-names:
>      description:
> -      Must be "clkin"
> -    maxItems: 1
> +      Must be "clkin" if the input reference is single ended or "clkin-diff"
> +      if the input reference is differential.
> +    enum: [clkin, clkin-diff]
>  
>    adi,mute-till-lock-en:
>      type: boolean
> -- 
> 2.48.1
> 

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

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

* RE: [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode
  2025-01-27 17:53   ` Conor Dooley
@ 2025-01-28 10:24     ` Miclaus, Antoniu
  2025-01-28 17:08       ` Conor Dooley
  0 siblings, 1 reply; 9+ messages in thread
From: Miclaus, Antoniu @ 2025-01-28 10:24 UTC (permalink / raw)
  To: Conor Dooley
  Cc: jic23@kernel.org, robh@kernel.org, conor+dt@kernel.org,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org

> On Mon, Jan 27, 2025 at 12:10:21PM +0200, Antoniu Miclaus wrote:
> > Add support for selecting between single-ended and differential
> > reference input.
> >
> > Input frequency boundaries are change based on the mode selected
> > (single-ended/differential).
> >
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > ---
> > no changes in v6.
> 
> Why'd you not pick up my ack?
> https://lore.kernel.org/all/20250121-crumb-dispense-
> b455b591481a@spud/
I'm sorry, I missed it. Should I send a new version with it?
> >  Documentation/devicetree/bindings/iio/frequency/adf4371.yaml | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> > index 1cb2adaf66f9..53d607441612 100644
> > --- a/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> > +++ b/Documentation/devicetree/bindings/iio/frequency/adf4371.yaml
> > @@ -30,8 +30,9 @@ properties:
> >
> >    clock-names:
> >      description:
> > -      Must be "clkin"
> > -    maxItems: 1
> > +      Must be "clkin" if the input reference is single ended or "clkin-diff"
> > +      if the input reference is differential.
> > +    enum: [clkin, clkin-diff]
> >
> >    adi,mute-till-lock-en:
> >      type: boolean
> > --
> > 2.48.1
> >

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

* Re: [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode
  2025-01-28 10:24     ` Miclaus, Antoniu
@ 2025-01-28 17:08       ` Conor Dooley
  0 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-01-28 17:08 UTC (permalink / raw)
  To: Miclaus, Antoniu
  Cc: jic23@kernel.org, robh@kernel.org, conor+dt@kernel.org,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org

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

On Tue, Jan 28, 2025 at 10:24:37AM +0000, Miclaus, Antoniu wrote:
> > On Mon, Jan 27, 2025 at 12:10:21PM +0200, Antoniu Miclaus wrote:
> > > Add support for selecting between single-ended and differential
> > > reference input.
> > >
> > > Input frequency boundaries are change based on the mode selected
> > > (single-ended/differential).
> > >
> > > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > > ---
> > > no changes in v6.
> > 
> > Why'd you not pick up my ack?
> > https://lore.kernel.org/all/20250121-crumb-dispense-
> > b455b591481a@spud/
> I'm sorry, I missed it. Should I send a new version with it?

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

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

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

* Re: [PATCH v6 2/3] iio: frequency: adf4371: add refin mode
  2025-01-27 10:10 ` [PATCH v6 2/3] iio: frequency: " Antoniu Miclaus
@ 2025-02-01 12:32   ` Jonathan Cameron
  0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2025-02-01 12:32 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: robh, conor+dt, linux-iio, devicetree, linux-kernel, linux-pwm,
	Nuno Sa

On Mon, 27 Jan 2025 12:10:22 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> Add support for single-ended/differential reference input mode.
> 
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
> no changes in v6.
This needed a rebase. There is no st->clkin any more.

Rather than go around again, I fixed it up as:
diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
index 205dfd341489..41155af3c4f6 100644
--- a/drivers/iio/frequency/adf4371.c
+++ b/drivers/iio/frequency/adf4371.c
@@ -593,10 +593,10 @@ static int adf4371_probe(struct spi_device *spi)
 
        st->ref_diff_en = false;
 
-       st->clkin = devm_clk_get_enabled(&spi->dev, "clkin");
-       if (IS_ERR(st->clkin)) {
-               st->clkin = devm_clk_get_enabled(&spi->dev, "clkin-diff");
-               if (IS_ERR(st->clkin))
+       clkin = devm_clk_get_enabled(&spi->dev, "clkin");
+       if (IS_ERR(clkin)) {
+               clkin = devm_clk_get_enabled(&spi->dev, "clkin-diff");
+               if (IS_ERR(clkin))
                        return dev_err_probe(&spi->dev, PTR_ERR(clkin),
                                     "Failed to get clkin/clkin-diff\n");
                st->ref_diff_en = true;


>  drivers/iio/frequency/adf4371.c | 31 +++++++++++++++++++++++++++----
>  1 file changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/frequency/adf4371.c b/drivers/iio/frequency/adf4371.c
> index d752507e0c98..205dfd341489 100644
> --- a/drivers/iio/frequency/adf4371.c
> +++ b/drivers/iio/frequency/adf4371.c
> @@ -42,6 +42,10 @@
>  #define ADF4371_MOD2WORD_MSK		GENMASK(5, 0)
>  #define ADF4371_MOD2WORD(x)		FIELD_PREP(ADF4371_MOD2WORD_MSK, x)
>  
> +/* ADF4371_REG22 */
> +#define ADF4371_REFIN_MODE_MASK		BIT(6)
> +#define ADF4371_REFIN_MODE(x)		FIELD_PREP(ADF4371_REFIN_MODE_MASK, x)
> +
>  /* ADF4371_REG24 */
>  #define ADF4371_RF_DIV_SEL_MSK		GENMASK(6, 4)
>  #define ADF4371_RF_DIV_SEL(x)		FIELD_PREP(ADF4371_RF_DIV_SEL_MSK, x)
> @@ -70,6 +74,7 @@
>  
>  #define ADF4371_MAX_FREQ_PFD		250000000UL /* Hz */
>  #define ADF4371_MAX_FREQ_REFIN		600000000UL /* Hz */
> +#define ADF4371_MAX_FREQ_REFIN_SE	500000000UL /* Hz */
>  
>  /* MOD1 is a 24-bit primary modulus with fixed value of 2^25 */
>  #define ADF4371_MODULUS1		33554432ULL
> @@ -176,6 +181,7 @@ struct adf4371_state {
>  	unsigned int mod2;
>  	unsigned int rf_div_sel;
>  	unsigned int ref_div_factor;
> +	bool ref_diff_en;
>  	u8 buf[10] __aligned(IIO_DMA_MINALIGN);
>  };
>  
> @@ -505,6 +511,17 @@ static int adf4371_setup(struct adf4371_state *st)
>  				 ADF4371_ADDR_ASC(1) | ADF4371_ADDR_ASC_R(1));
>  	if (ret < 0)
>  		return ret;
> +
> +	if ((st->ref_diff_en && st->clkin_freq > ADF4371_MAX_FREQ_REFIN) ||
> +	    (!st->ref_diff_en && st->clkin_freq > ADF4371_MAX_FREQ_REFIN_SE))
> +		return -EINVAL;
> +
> +	ret = regmap_update_bits(st->regmap,  ADF4371_REG(0x22),
> +				 ADF4371_REFIN_MODE_MASK,
> +				 ADF4371_REFIN_MODE(st->ref_diff_en));
> +	if (ret < 0)
> +		return ret;
> +
>  	/*
>  	 * Calculate and maximize PFD frequency
>  	 * fPFD = REFIN × ((1 + D)/(R × (1 + T)))
> @@ -574,10 +591,16 @@ static int adf4371_probe(struct spi_device *spi)
>  	indio_dev->channels = st->chip_info->channels;
>  	indio_dev->num_channels = st->chip_info->num_channels;
>  
> -	clkin = devm_clk_get_enabled(&spi->dev, "clkin");
> -	if (IS_ERR(clkin))
> -		return dev_err_probe(&spi->dev, PTR_ERR(clkin),
> -				     "Failed to get clkin\n");
> +	st->ref_diff_en = false;
> +
> +	st->clkin = devm_clk_get_enabled(&spi->dev, "clkin");
> +	if (IS_ERR(st->clkin)) {
> +		st->clkin = devm_clk_get_enabled(&spi->dev, "clkin-diff");
> +		if (IS_ERR(st->clkin))
> +			return dev_err_probe(&spi->dev, PTR_ERR(clkin),
> +				     "Failed to get clkin/clkin-diff\n");
> +		st->ref_diff_en = true;
> +	}
>  
>  	st->clkin_freq = clk_get_rate(clkin);
>  


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

* Re: [PATCH v6 0/3] ADF4371 refin mode and doubler support
  2025-01-27 10:10 [PATCH v6 0/3] ADF4371 refin mode and doubler support Antoniu Miclaus
                   ` (2 preceding siblings ...)
  2025-01-27 10:10 ` [PATCH v6 3/3] iio: frequency: adf4371: add ref doubler Antoniu Miclaus
@ 2025-02-01 12:33 ` Jonathan Cameron
  3 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2025-02-01 12:33 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: robh, conor+dt, linux-iio, devicetree, linux-kernel, linux-pwm

On Mon, 27 Jan 2025 12:10:20 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> Add support for selecting between single-ended and differential
> reference input. By default the single-ended input is enabled.
> 
> Input frequency boundaries are change based on the mode selected
> (single-ended/differential).
> 
> Add support for the reference doubler. This feature is enabled
> automatically to improve noise performance if the input frequency
> is within the accepted range.
Applied to the togreg branch of iio.git with fix to patch 2.
I'll be rebasing that tree on rc1 when available so until then only
pushed out as testing.

Thanks,

Jonathan

> 
> Antoniu Miclaus (3):
>   dt-bindings: iio: adf4371: add refin mode
>   iio: frequency: adf4371: add refin mode
>   iio: frequency: adf4371: add ref doubler
> 
>  .../bindings/iio/frequency/adf4371.yaml       |  5 +-
>  drivers/iio/frequency/adf4371.c               | 47 ++++++++++++++++---
>  2 files changed, 44 insertions(+), 8 deletions(-)
> 


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

end of thread, other threads:[~2025-02-01 12:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 10:10 [PATCH v6 0/3] ADF4371 refin mode and doubler support Antoniu Miclaus
2025-01-27 10:10 ` [PATCH v6 1/3] dt-bindings: iio: adf4371: add refin mode Antoniu Miclaus
2025-01-27 17:53   ` Conor Dooley
2025-01-28 10:24     ` Miclaus, Antoniu
2025-01-28 17:08       ` Conor Dooley
2025-01-27 10:10 ` [PATCH v6 2/3] iio: frequency: " Antoniu Miclaus
2025-02-01 12:32   ` Jonathan Cameron
2025-01-27 10:10 ` [PATCH v6 3/3] iio: frequency: adf4371: add ref doubler Antoniu Miclaus
2025-02-01 12:33 ` [PATCH v6 0/3] ADF4371 refin mode and doubler support Jonathan Cameron

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