All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Michael Hennerich <michael.hennerich@analog.com>
Subject: [PATCH 45/46] dt-bindings:iio:frequency:adi,adf4350: txt to yaml format conversion.
Date: Sat, 31 Oct 2020 18:48:53 +0000	[thread overview]
Message-ID: <20201031184854.745828-46-jic23@kernel.org> (raw)
In-Reply-To: <20201031184854.745828-1-jic23@kernel.org>

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This is a large but fairly simple binding.
It may well be possible to constrain some of the properties more than
currently done, but that would involve diving into datasheets for the
supported parts.  Hence for this initial conversion just use the
information that was in the txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
 .../bindings/iio/frequency/adf4350.txt        |  86 --------
 .../bindings/iio/frequency/adi,adf4350.yaml   | 190 ++++++++++++++++++
 2 files changed, 190 insertions(+), 86 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/frequency/adf4350.txt b/Documentation/devicetree/bindings/iio/frequency/adf4350.txt
deleted file mode 100644
index f8c181d81d2d..000000000000
--- a/Documentation/devicetree/bindings/iio/frequency/adf4350.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-Analog Devices ADF4350/ADF4351 device driver
-
-Required properties:
-	- compatible: Should be one of
-		* "adi,adf4350": When using the ADF4350 device
-		* "adi,adf4351": When using the ADF4351 device
-	- reg: SPI chip select numbert for the device
-	- spi-max-frequency: Max SPI frequency to use (< 20000000)
-	- clocks: From common clock binding. Clock is phandle to clock for
-		ADF435x Reference Clock (CLKIN).
-
-Optional properties:
-	- gpios:	 GPIO Lock detect - If set with a valid phandle and GPIO number,
-			pll lock state is tested upon read.
-	- adi,channel-spacing: Channel spacing in Hz (influences MODULUS).
-	- adi,power-up-frequency:	If set in Hz the PLL tunes to
-			the desired frequency on probe.
-	- adi,reference-div-factor: If set the driver skips dynamic calculation
-			and uses this default value instead.
-	- adi,reference-doubler-enable: Enables reference doubler.
-	- adi,reference-div2-enable: Enables reference divider.
-	- adi,phase-detector-polarity-positive-enable: Enables positive phase
-			detector polarity. Default = negative.
-	- adi,lock-detect-precision-6ns-enable: Enables 6ns lock detect precision.
-			Default = 10ns.
-	- adi,lock-detect-function-integer-n-enable: Enables lock detect
-			for integer-N mode. Default = factional-N mode.
-	- adi,charge-pump-current: Charge pump current in mA.
-			Default = 2500mA.
-	- adi,muxout-select: On chip multiplexer output selection.
-			Valid values for the multiplexer output are:
-			0: Three-State Output (default)
-			1: DVDD
-			2: DGND
-			3: R-Counter output
-			4: N-Divider output
-			5: Analog lock detect
-			6: Digital lock detect
-	- adi,low-spur-mode-enable: Enables low spur mode.
-			Default = Low noise mode.
-	- adi,cycle-slip-reduction-enable: Enables cycle slip reduction.
-	- adi,charge-cancellation-enable: Enabled charge pump
-			charge cancellation for integer-N modes.
-	- adi,anti-backlash-3ns-enable: Enables 3ns antibacklash pulse width
-			 for integer-N modes.
-	- adi,band-select-clock-mode-high-enable: Enables faster band
-			selection logic.
-	- adi,12bit-clk-divider: Clock divider value used when
-			adi,12bit-clkdiv-mode != 0
-	- adi,clk-divider-mode:
-			Valid values for the clkdiv mode are:
-			0: Clock divider off (default)
-			1: Fast lock enable
-			2: Phase resync enable
-	- adi,aux-output-enable: Enables auxiliary RF output.
-	- adi,aux-output-fundamental-enable: Selects fundamental VCO output on
-			the auxiliary RF output. Default = Output of RF dividers.
-	- adi,mute-till-lock-enable: Enables Mute-Till-Lock-Detect function.
-	- adi,output-power: Output power selection.
-			Valid values for the power mode are:
-			0: -4dBm (default)
-			1: -1dBm
-			2: +2dBm
-			3: +5dBm
-	- adi,aux-output-power: Auxiliary output power selection.
-			Valid values for the power mode are:
-			0: -4dBm (default)
-			1: -1dBm
-			2: +2dBm
-			3: +5dBm
-
-
-Example:
-		lo_pll0_rx_adf4351: adf4351-rx-lpc@4 {
-			compatible = "adi,adf4351";
-			reg = <4>;
-			spi-max-frequency = <10000000>;
-			clocks = <&clk0_ad9523 9>;
-			clock-names = "clkin";
-			adi,channel-spacing = <10000>;
-			adi,power-up-frequency = <2400000000>;
-			adi,phase-detector-polarity-positive-enable;
-			adi,charge-pump-current = <2500>;
-			adi,output-power = <3>;
-			adi,mute-till-lock-enable;
-		};
diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml
new file mode 100644
index 000000000000..d7f20b8518e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/frequency/adi,adf4350.yaml
@@ -0,0 +1,190 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/frequency/adi,adf4350.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADF4350/ADF4351 wideband synthesizer
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+properties:
+  compatible:
+    enum:
+      - adi,adf4350
+      - adi,adf4351
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 20000000
+
+  clocks:
+    maxItems: 1
+    description: Clock to provide CLKIN reference clock signal.
+
+  clock-names:
+    const: clkin
+
+  gpios:
+    maxItems: 1
+    description: Lock detect GPIO.
+
+  adi,channel-spacing:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Channel spacing in Hz (influences MODULUS).
+
+  adi,power-up-frequency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      If set the PLL tunes to this frequency (in Hz) on driver probe.
+
+  adi,reference-div-factor:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      If set the driver skips dynamic calculation and uses this default
+      value instead.
+
+  adi,reference-doubler-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables reference doubler.
+
+  adi,reference-div2-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables reference divider.
+
+  adi,phase-detector-polarity-positive-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables positive phase detector polarity. Default negative.
+
+  adi,lock-detect-precision-6ns-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables 6ns lock detect precision. Default = 10ns.
+
+  adi,lock-detect-function-integer-n-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enables lock detect for integer-N mode. Default = factional-N mode.
+
+  adi,charge-pump-current:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Charge pump current in mA. Default = 2500mA.
+
+  adi,muxout-select:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 6
+    description: |
+      On chip multiplexer output selection.
+      Valid values for the multiplexer output are:
+      0: Three-State Output (default)
+      1: DVDD
+      2: DGND
+      3: R-Counter output
+      4: N-Divider output
+      5: Analog lock detect
+      6: Digital lock detect
+
+  adi,low-spur-mode-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables low spur mode. Default = Low noise mode.
+
+  adi,cycle-slip-reduction-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables cycle slip reduction.
+
+  adi,charge-cancellation-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enabled charge pump charge cancellation for integer-N modes.
+
+  adi,anti-backlash-3ns-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enables 3ns antibacklash pulse width for integer-N modes.
+
+  adi,band-select-clock-mode-high-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables faster band selection logic.
+
+  adi,12bit-clk-divider:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Clock divider value used when adi,12bit-clkdiv-mode != 0
+
+  adi,clk-divider-mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2]
+    description: |
+      Valid values for the clkdiv mode are:
+      0: Clock divider off (default)
+      1: Fast lock enable
+      2: Phase resync enable
+
+  adi,aux-output-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables auxiliary RF output.
+
+  adi,aux-output-fundamental-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: |
+      Selects fundamental VCO output on the auxiliary RF output.
+      Default = Output of RF dividers.
+
+  adi,mute-till-lock-enable:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description: Enables Mute-Till-Lock-Detect function.
+
+  adi,output-power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    description: |
+      Output power selection.
+      Valid values for the power mode are:
+      0: -4dBm (default)
+      1: -1dBm
+      2: +2dBm
+      3: +5dBm
+
+  adi,aux-output-power:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    description: |
+      Auxiliary output power selection.
+      Valid values for the power mode are:
+      0: -4dBm (default)
+      1: -1dBm
+      2: +2dBm
+      3: +5dBm
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pll@4 {
+            compatible = "adi,adf4351";
+            reg = <4>;
+            spi-max-frequency = <10000000>;
+            clocks = <&clk0_ad9523 9>;
+            clock-names = "clkin";
+            adi,channel-spacing = <10000>;
+            adi,power-up-frequency = <2400000000>;
+            adi,phase-detector-polarity-positive-enable;
+            adi,charge-pump-current = <2500>;
+            adi,output-power = <3>;
+            adi,mute-till-lock-enable;
+        };
+    };
+...
-- 
2.28.0


  parent reply	other threads:[~2020-10-31 18:52 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 18:48 [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Jonathan Cameron
2020-10-31 18:48 ` [PATCH 01/46] dt-bindings:iio:resolver:adi,ad2s90: Conversion of binding to yaml Jonathan Cameron
2020-10-31 18:48 ` [PATCH 02/46] dt-bindings:iio:potentiometer:adi,ad5272 yaml conversion Jonathan Cameron
2020-11-02  4:48   ` Phil Reid
2020-11-03 16:10   ` Rob Herring
2020-11-03 17:28     ` Jonathan Cameron
2020-11-04  0:39       ` Phil Reid
2020-11-04  3:12         ` Rob Herring
2020-11-04  4:53           ` Phil Reid
2020-11-09  2:56             ` Phil Reid
2020-11-22 16:35               ` Jonathan Cameron
2020-11-23 23:33                 ` Phil Reid
2020-10-31 18:48 ` [PATCH 03/46] dt-bindings:iio:potentiometer:microchip,mcp4131 txt to " Jonathan Cameron
2020-11-02 16:19   ` Slawomir Stepien
2020-11-03 16:11   ` Rob Herring
2020-10-31 18:48 ` [PATCH 04/46] dt-bindings:iio:potentiometer:microchip,mcp41010 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 05/46] dt-bindings:iio:impedance-analyzer:adi,ad5933 " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 06/46] dt-bindings:iio:samsung,sensorhub-rinato: " Jonathan Cameron
2020-11-22 16:43   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 07/46] dt-bindings:iio:health:ti,afe4403: txt to yaml binding Jonathan Cameron
2020-11-22 17:32   ` Jonathan Cameron
2020-11-28 16:15     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 08/46] dt-bindings:iio:health:ti,afe4404: txt to yaml conversion Jonathan Cameron
2020-11-28 16:24   ` Jonathan Cameron
2020-12-18 19:42   ` Rob Herring
2020-12-30 12:21     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 09/46] dt-bindings:iio:health:maxim,max30100: " Jonathan Cameron
2020-10-31 21:41   ` Matt Ranostay
2020-11-22 16:58     ` Jonathan Cameron
2020-11-22 17:24       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 10/46] dt-bindings:iio:health:maxim,max30102: " Jonathan Cameron
2020-10-31 21:38   ` Matt Ranostay
2020-11-22 17:29     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 11/46] dt-bindings:iio:imu:adi,adis16480: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 12/46] dt-bindings:iio:imu:st,lsm6dsx: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 13/46] dt-bindings:iio:light:avago,apds9300: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 14/46] dt-bindings:iio:light:avago,apds9960: " Jonathan Cameron
2020-10-31 21:33   ` Matt Ranostay
2020-10-31 21:35     ` Matt Ranostay
2020-11-01 14:57       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 15/46] dt-bindings:iio:light:capella,cm36651: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 16/46] dt-bindings:iio:light:sharp,gp2ap020a00f: " Jonathan Cameron
2020-11-22 17:42   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 17/46] dt-bindings:iio:light:maxim,max44009: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 18/46] dt-bindings:iio:light:ti,opt3001: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 19/46] dt-bindings:iio:light:upisemi,us51882: " Jonathan Cameron
2020-11-03 16:18   ` Rob Herring
2020-10-31 18:48 ` [PATCH 20/46] dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor Jonathan Cameron
2020-10-31 18:48 ` [PATCH 21/46] dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion Jonathan Cameron
2020-11-22 17:52   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 22/46] dt-bindings:iio:light:st,vl6180: txt to yaml format conversion Jonathan Cameron
2020-11-01 15:26   ` Manivannan Sadhasivam
2020-10-31 18:48 ` [PATCH 23/46] dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 24/46] dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion Jonathan Cameron
2020-11-04 14:47   ` Linus Walleij
2020-11-08 15:55     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 25/46] dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 26/46] dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 27/46] dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 28/46] dt-bindings:iio:adc:atmel,sama5d2-adc: " Jonathan Cameron
2020-11-22 18:07   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 29/46] dt-bindings:iio:adc:atmel,sama9260-adc: conversion to yaml from at91_adc.txt Jonathan Cameron
2020-11-13  9:22   ` Alexandre Belloni
2020-11-14 15:37     ` Jonathan Cameron
2020-11-22 18:09       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 30/46] dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion Jonathan Cameron
2020-11-03 16:26   ` Rob Herring
2020-11-27  8:14   ` Geert Uytterhoeven
2020-10-31 18:48 ` [PATCH 31/46] dt-bindings:iio:adc:x-powers,axp209-adc: " Jonathan Cameron
2020-11-22 18:15   ` Jonathan Cameron
2020-11-23  3:02     ` Chen-Yu Tsai
2020-11-23 20:36       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 32/46] dt-bindings:iio:adc:brcm,iproc-static-adc: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 33/46] dt-bindings:iio:adc:mediatek,mt2701-auxadc: rename and " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 34/46] dt-bindings:iio:adc:ti,palmas-gpadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:20   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 35/46] dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename Jonathan Cameron
2020-11-04 14:51   ` Linus Walleij
2020-10-31 18:48 ` [PATCH 36/46] dt-bindings:iio:adc:qcom,spmi-iadc: txt to yaml format conversion Jonathan Cameron
2020-11-22 18:25   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 37/46] dt-binding:iio:adc:ti,ads124s08: " Jonathan Cameron
2020-11-02 12:49   ` Dan Murphy
2020-11-08 16:59     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 38/46] dt-bindings:iio:dac:ad5592r: " Jonathan Cameron
2020-11-03 16:31   ` Rob Herring
2020-11-22 18:38     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 39/46] dt-bindings:iio:dac:ad5755: " Jonathan Cameron
2020-11-03 16:32   ` Rob Herring
2020-11-22 18:40     ` Jonathan Cameron
2021-02-21 16:33       ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 40/46] dt-bindings:iio:accel:bosch,bma180: " Jonathan Cameron
2020-11-22 18:44   ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 41/46] dt-bindings:iio:accel:kionix,kxcjk1013: " Jonathan Cameron
2020-10-31 18:48 ` [PATCH 42/46] dt-bindings:iio:accel:fsl,mma8452: txt to yaml conversion Jonathan Cameron
2020-11-03 16:34   ` Rob Herring
2020-11-22 18:50     ` Jonathan Cameron
2020-10-31 18:48 ` [PATCH 43/46] dt-bindings:iio:gyro:bosch,bmg180: txt to yaml format conversion Jonathan Cameron
2020-10-31 18:48 ` [PATCH 44/46] dt-bindings:iio:st,st-sensors: txt to yaml conversion Jonathan Cameron
2020-11-02 16:16   ` Denis CIOCCA
2020-10-31 18:48 ` Jonathan Cameron [this message]
2020-10-31 18:48 ` [PATCH 46/46] dt-bindings:iio:temperature: Drop generic binding file Jonathan Cameron
2020-11-03 16:38 ` [PATCH 00/46] dt-bindings:iio: yet more txt to yam conversions Rob Herring
2020-11-03 17:24   ` Jonathan Cameron
2020-11-22 18:59     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201031184854.745828-46-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.