public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] *** Add ADF4378 Support ***
@ 2024-07-29  9:50 Antoniu Miclaus
  2024-07-29  9:50 ` [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support Antoniu Miclaus
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Antoniu Miclaus @ 2024-07-29  9:50 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Antoniu Miclaus,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Dragos Bogdan, linux-iio, devicetree, linux-kernel

Add support for ADF4378 high performance, ultra-low jitter, integer-N
phased locked loop (PLL) with an integrated voltage controlled
oscillator (VCO) and system reference (SYSREF) retimer ideally
suited for data converter and mixed signal front end (MxFE) clock
applications.

The main difference between ADF4377 and ADF4378 is that the second one
provides only one output frequency channel which is enable/disabled via
one GPIO. 

Both the driver and the bindings are updated to reflect that difference.

Antoniu Miclaus (2):
  dt-bindings: iio: adf4377: add adf4378 support
  iio: frequency: adf4377: add adf4378 support

 .../bindings/iio/frequency/adi,adf4377.yaml   | 10 ++++++
 drivers/iio/frequency/adf4377.c               | 35 +++++++++++++++----
 2 files changed, 38 insertions(+), 7 deletions(-)

-- 
2.45.2


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

* [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support
  2024-07-29  9:50 [PATCH v3 0/2] *** Add ADF4378 Support *** Antoniu Miclaus
@ 2024-07-29  9:50 ` Antoniu Miclaus
  2024-07-30  8:44   ` Krzysztof Kozlowski
  2024-07-29  9:50 ` [PATCH v3 2/2] iio: frequency: " Antoniu Miclaus
  2024-07-29 14:58 ` [PATCH v3 0/2] *** Add ADF4378 Support *** Krzysztof Kozlowski
  2 siblings, 1 reply; 8+ messages in thread
From: Antoniu Miclaus @ 2024-07-29  9:50 UTC (permalink / raw)
  To: Antoniu Miclaus, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Dragos Bogdan, linux-iio, devicetree, linux-kernel

The adf4378 provides only one output channel. Therefore there is only
one gpio available to enable the output. Reflect that into the bindings
using property conditions.

Add product link for the adf4378.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
changes in v3:
 - update commit description
 .../devicetree/bindings/iio/frequency/adi,adf4377.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,adf4377.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,adf4377.yaml
index aa6a3193b4e0..5f950ee9aec7 100644
--- a/Documentation/devicetree/bindings/iio/frequency/adi,adf4377.yaml
+++ b/Documentation/devicetree/bindings/iio/frequency/adi,adf4377.yaml
@@ -17,6 +17,7 @@ description: |
    applications.
 
    https://www.analog.com/en/products/adf4377.html
+   https://www.analog.com/en/products/adf4378.html
 
 properties:
   compatible:
@@ -73,6 +74,15 @@ required:
 
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,adf4378
+    then:
+      properties:
+        clk2-enable-gpios: false
 
 unevaluatedProperties: false
 
-- 
2.45.2


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

* [PATCH v3 2/2] iio: frequency: adf4377: add adf4378 support
  2024-07-29  9:50 [PATCH v3 0/2] *** Add ADF4378 Support *** Antoniu Miclaus
  2024-07-29  9:50 ` [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support Antoniu Miclaus
@ 2024-07-29  9:50 ` Antoniu Miclaus
  2024-07-29 14:58 ` [PATCH v3 0/2] *** Add ADF4378 Support *** Krzysztof Kozlowski
  2 siblings, 0 replies; 8+ messages in thread
From: Antoniu Miclaus @ 2024-07-29  9:50 UTC (permalink / raw)
  To: Antoniu Miclaus, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Dragos Bogdan, linux-iio, devicetree, linux-kernel

Add separate handling for adf4378 within the driver.

The main difference between adf4377 and adf4378 is that adf4378 has only
one output which is handled by only one gpio.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
changes in v3:
 - use separate structures for chip_info instead of array.
 drivers/iio/frequency/adf4377.c | 35 ++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
index 9284c13f1abb..5613d524deaa 100644
--- a/drivers/iio/frequency/adf4377.c
+++ b/drivers/iio/frequency/adf4377.c
@@ -400,7 +400,13 @@ enum muxout_select_mode {
 	ADF4377_MUXOUT_HIGH = 0x8,
 };
 
+struct adf4377_chip_info {
+	const char *name;
+	bool has_gpio_enclk2;
+};
+
 struct adf4377_state {
+	const struct adf4377_chip_info	*chip_info;
 	struct spi_device	*spi;
 	struct regmap		*regmap;
 	struct clk		*clkin;
@@ -889,11 +895,13 @@ static int adf4377_properties_parse(struct adf4377_state *st)
 		return dev_err_probe(&spi->dev, PTR_ERR(st->gpio_enclk1),
 				     "failed to get the CE GPIO\n");
 
-	st->gpio_enclk2 = devm_gpiod_get_optional(&st->spi->dev, "clk2-enable",
-						  GPIOD_OUT_LOW);
-	if (IS_ERR(st->gpio_enclk2))
-		return dev_err_probe(&spi->dev, PTR_ERR(st->gpio_enclk2),
-				     "failed to get the CE GPIO\n");
+	if (st->chip_info->has_gpio_enclk2) {
+		st->gpio_enclk2 = devm_gpiod_get_optional(&st->spi->dev, "clk2-enable",
+							  GPIOD_OUT_LOW);
+		if (IS_ERR(st->gpio_enclk2))
+			return dev_err_probe(&spi->dev, PTR_ERR(st->gpio_enclk2),
+					"failed to get the CE GPIO\n");
+	}
 
 	ret = device_property_match_property_string(&spi->dev, "adi,muxout-select",
 						    adf4377_muxout_modes,
@@ -921,6 +929,16 @@ static int adf4377_freq_change(struct notifier_block *nb, unsigned long action,
 	return NOTIFY_OK;
 }
 
+static const struct adf4377_chip_info adf4377_chip_info = {
+	.name = "adf4377",
+	.has_gpio_enclk2 = true,
+};
+
+static const struct adf4377_chip_info adf4378_chip_info = {
+	.name = "adf4378",
+	.has_gpio_enclk2 = false,
+};
+
 static int adf4377_probe(struct spi_device *spi)
 {
 	struct iio_dev *indio_dev;
@@ -945,6 +963,7 @@ static int adf4377_probe(struct spi_device *spi)
 
 	st->regmap = regmap;
 	st->spi = spi;
+	st->chip_info = spi_get_device_match_data(spi);
 	mutex_init(&st->lock);
 
 	ret = adf4377_properties_parse(st);
@@ -964,13 +983,15 @@ static int adf4377_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id adf4377_id[] = {
-	{ "adf4377", 0 },
+	{ "adf4377", (kernel_ulong_t)&adf4377_chip_info },
+	{ "adf4378", (kernel_ulong_t)&adf4378_chip_info },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, adf4377_id);
 
 static const struct of_device_id adf4377_of_match[] = {
-	{ .compatible = "adi,adf4377" },
+	{ .compatible = "adi,adf4377", .data = &adf4377_chip_info },
+	{ .compatible = "adi,adf4378", .data = &adf4378_chip_info },
 	{}
 };
 MODULE_DEVICE_TABLE(of, adf4377_of_match);
-- 
2.45.2


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

* Re: [PATCH v3 0/2] *** Add ADF4378 Support ***
  2024-07-29  9:50 [PATCH v3 0/2] *** Add ADF4378 Support *** Antoniu Miclaus
  2024-07-29  9:50 ` [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support Antoniu Miclaus
  2024-07-29  9:50 ` [PATCH v3 2/2] iio: frequency: " Antoniu Miclaus
@ 2024-07-29 14:58 ` Krzysztof Kozlowski
  2024-07-30  8:23   ` Miclaus, Antoniu
  2 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-29 14:58 UTC (permalink / raw)
  To: Antoniu Miclaus, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Dragos Bogdan, linux-iio, devicetree, linux-kernel

On 29/07/2024 11:50, Antoniu Miclaus wrote:
> Add support for ADF4378 high performance, ultra-low jitter, integer-N
> phased locked loop (PLL) with an integrated voltage controlled
> oscillator (VCO) and system reference (SYSREF) retimer ideally
> suited for data converter and mixed signal front end (MxFE) clock
> applications.
> 
> The main difference between ADF4377 and ADF4378 is that the second one
> provides only one output frequency channel which is enable/disabled via
> one GPIO. 
> 
> Both the driver and the bindings are updated to reflect that difference.

That's a v3, but where is the changelog?

Best regards,
Krzysztof


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

* RE: [PATCH v3 0/2] *** Add ADF4378 Support ***
  2024-07-29 14:58 ` [PATCH v3 0/2] *** Add ADF4378 Support *** Krzysztof Kozlowski
@ 2024-07-30  8:23   ` Miclaus, Antoniu
  2024-07-30  8:42     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 8+ messages in thread
From: Miclaus, Antoniu @ 2024-07-30  8:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Lars-Peter Clausen, Hennerich, Michael,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bogdan, Dragos, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: Monday, July 29, 2024 5:58 PM
> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>; Lars-Peter Clausen
> <lars@metafoo.de>; Hennerich, Michael <Michael.Hennerich@analog.com>;
> Jonathan Cameron <jic23@kernel.org>; Rob Herring <robh@kernel.org>;
> Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
> <conor+dt@kernel.org>; Bogdan, Dragos <Dragos.Bogdan@analog.com>;
> linux-iio@vger.kernel.org; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [PATCH v3 0/2] *** Add ADF4378 Support ***
> 
> [External]
> 
> On 29/07/2024 11:50, Antoniu Miclaus wrote:
> > Add support for ADF4378 high performance, ultra-low jitter, integer-N
> > phased locked loop (PLL) with an integrated voltage controlled
> > oscillator (VCO) and system reference (SYSREF) retimer ideally
> > suited for data converter and mixed signal front end (MxFE) clock
> > applications.
> >
> > The main difference between ADF4377 and ADF4378 is that the second one
> > provides only one output frequency channel which is enable/disabled via
> > one GPIO.
> >
> > Both the driver and the bindings are updated to reflect that difference.
> 
> That's a v3, but where is the changelog?

Each of the two patches has their own changelog.
For the cover letter there's no changelog since it was added with v3. 

Regards,
Antoniu
> 
> Best regards,
> Krzysztof


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

* Re: [PATCH v3 0/2] *** Add ADF4378 Support ***
  2024-07-30  8:23   ` Miclaus, Antoniu
@ 2024-07-30  8:42     ` Krzysztof Kozlowski
  2024-07-30 18:19       ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-30  8:42 UTC (permalink / raw)
  To: Miclaus, Antoniu, Lars-Peter Clausen, Hennerich, Michael,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bogdan, Dragos, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org

On 30/07/2024 10:23, Miclaus, Antoniu wrote:
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzk@kernel.org>
>> Sent: Monday, July 29, 2024 5:58 PM
>> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>; Lars-Peter Clausen
>> <lars@metafoo.de>; Hennerich, Michael <Michael.Hennerich@analog.com>;
>> Jonathan Cameron <jic23@kernel.org>; Rob Herring <robh@kernel.org>;
>> Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
>> <conor+dt@kernel.org>; Bogdan, Dragos <Dragos.Bogdan@analog.com>;
>> linux-iio@vger.kernel.org; devicetree@vger.kernel.org; linux-
>> kernel@vger.kernel.org
>> Subject: Re: [PATCH v3 0/2] *** Add ADF4378 Support ***
>>
>> [External]
>>
>> On 29/07/2024 11:50, Antoniu Miclaus wrote:
>>> Add support for ADF4378 high performance, ultra-low jitter, integer-N
>>> phased locked loop (PLL) with an integrated voltage controlled
>>> oscillator (VCO) and system reference (SYSREF) retimer ideally
>>> suited for data converter and mixed signal front end (MxFE) clock
>>> applications.
>>>
>>> The main difference between ADF4377 and ADF4378 is that the second one
>>> provides only one output frequency channel which is enable/disabled via
>>> one GPIO.
>>>
>>> Both the driver and the bindings are updated to reflect that difference.
>>
>> That's a v3, but where is the changelog?
> 
> Each of the two patches has their own changelog.
> For the cover letter there's no changelog since it was added with v3. 

Ah, ok, it was not that easy to find, without any spacing from the diffstat.

Best regards,
Krzysztof


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

* Re: [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support
  2024-07-29  9:50 ` [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support Antoniu Miclaus
@ 2024-07-30  8:44   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-30  8:44 UTC (permalink / raw)
  To: Antoniu Miclaus, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Dragos Bogdan, linux-iio, devicetree, linux-kernel

On 29/07/2024 11:50, Antoniu Miclaus wrote:
> The adf4378 provides only one output channel. Therefore there is only
> one gpio available to enable the output. Reflect that into the bindings
> using property conditions.
> 
> Add product link for the adf4378.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>

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

Best regards,
Krzysztof


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

* Re: [PATCH v3 0/2] *** Add ADF4378 Support ***
  2024-07-30  8:42     ` Krzysztof Kozlowski
@ 2024-07-30 18:19       ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2024-07-30 18:19 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miclaus, Antoniu, Lars-Peter Clausen, Hennerich, Michael,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bogdan, Dragos,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, 30 Jul 2024 10:42:51 +0200
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On 30/07/2024 10:23, Miclaus, Antoniu wrote:
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzk@kernel.org>
> >> Sent: Monday, July 29, 2024 5:58 PM
> >> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>; Lars-Peter Clausen
> >> <lars@metafoo.de>; Hennerich, Michael <Michael.Hennerich@analog.com>;
> >> Jonathan Cameron <jic23@kernel.org>; Rob Herring <robh@kernel.org>;
> >> Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
> >> <conor+dt@kernel.org>; Bogdan, Dragos <Dragos.Bogdan@analog.com>;
> >> linux-iio@vger.kernel.org; devicetree@vger.kernel.org; linux-
> >> kernel@vger.kernel.org
> >> Subject: Re: [PATCH v3 0/2] *** Add ADF4378 Support ***
> >>
> >> [External]
> >>
> >> On 29/07/2024 11:50, Antoniu Miclaus wrote:  
> >>> Add support for ADF4378 high performance, ultra-low jitter, integer-N
> >>> phased locked loop (PLL) with an integrated voltage controlled
> >>> oscillator (VCO) and system reference (SYSREF) retimer ideally
> >>> suited for data converter and mixed signal front end (MxFE) clock
> >>> applications.
> >>>
> >>> The main difference between ADF4377 and ADF4378 is that the second one
> >>> provides only one output frequency channel which is enable/disabled via
> >>> one GPIO.
> >>>
> >>> Both the driver and the bindings are updated to reflect that difference.  
> >>
> >> That's a v3, but where is the changelog?  
> > 
> > Each of the two patches has their own changelog.
> > For the cover letter there's no changelog since it was added with v3.   
> 
> Ah, ok, it was not that easy to find, without any spacing from the diffstat.
> 
> Best regards,
> Krzysztof
> 
Applied to the togreg branch of iio.git and pushed out as testing initially
for 0-day to take a first look at it.

Thanks,

Jonathan



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

end of thread, other threads:[~2024-07-30 18:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29  9:50 [PATCH v3 0/2] *** Add ADF4378 Support *** Antoniu Miclaus
2024-07-29  9:50 ` [PATCH v3 1/2] dt-bindings: iio: adf4377: add adf4378 support Antoniu Miclaus
2024-07-30  8:44   ` Krzysztof Kozlowski
2024-07-29  9:50 ` [PATCH v3 2/2] iio: frequency: " Antoniu Miclaus
2024-07-29 14:58 ` [PATCH v3 0/2] *** Add ADF4378 Support *** Krzysztof Kozlowski
2024-07-30  8:23   ` Miclaus, Antoniu
2024-07-30  8:42     ` Krzysztof Kozlowski
2024-07-30 18:19       ` Jonathan Cameron

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