Skip to contentSkip to conversation

iio:frequency:admv1014: add support for ADMV1014

PATCH Superseded Antoniu Miclaus 2 participants 7 messages Feb 7, 2022 – Feb 13, 2022

Subsystems (4)

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Antoniu Miclaus

author maintainer
#0 lore raw

PATCH v6 1/4 iio:frequency:admv1014: add support for ADMV1014

The ADMV1014 is a silicon germanium (SiGe), wideband, microwave downconverter optimized for point to point microwave radio designs operating in the 24 GHz to 44 GHz frequency range.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADMV1014.pdf

---
changes in v6:
- add missing commas
- remove explicit init for spi transfer variable t
- use sizeof for transfer length
- use mult_frac when computing vcm_comp
- update quad filters comparison
- remove explicit cast cast of private in switch...case
- use kstrtoint
- update reg_name array alignment
- rework input modes dt parse
- use reversed xmas tree order for variable declaration where needed

 drivers/iio/frequency/Kconfig    |  10 +
 drivers/iio/frequency/Makefile   |   1 +
 drivers/iio/frequency/admv1014.c | 824 +++++++++++++++++++++++++++++++
 3 files changed, 835 insertions(+)
 create mode 100644 drivers/iio/frequency/admv1014.c
drivers/iio/frequency/Kconfig +10 -0
index 2c9e0559e8a4..493221f42077 100644
@@ -50,6 +50,16 @@ config ADF4371
 	  To compile this driver as a module, choose M here: the
 	  module will be called adf4371.
 
+config ADMV1014
+	tristate "Analog Devices ADMV1014 Microwave Downconverter"
+	depends on SPI && COMMON_CLK && 64BIT
+	help
+	  Say yes here to build support for Analog Devices ADMV1014
+	  24 GHz to 44 GHz, Wideband, Microwave Downconverter.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called admv1014.
+
 config ADRF6780
         tristate "Analog Devices ADRF6780 Microwave Upconverter"
         depends on SPI
drivers/iio/frequency/Makefile +1 -0
index ae3136c79202..5f0348e5eb53 100644
@@ -7,4 +7,5 @@
 obj-$(CONFIG_AD9523) += ad9523.o
 obj-$(CONFIG_ADF4350) += adf4350.o
 obj-$(CONFIG_ADF4371) += adf4371.o
+obj-$(CONFIG_ADMV1014) += admv1014.o
 obj-$(CONFIG_ADRF6780) += adrf6780.o
drivers/iio/frequency/admv1014.c new file +824 -0

824 lines not on this page · raw message

Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH v6 2/4 dt-bindings:iio:frequency: add admv1014 binding

Add device tree bindings for the ADMV1014 Upconverter.

---
no changes in v6.

 .../bindings/iio/frequency/adi,admv1014.yaml  | 137 ++++++++++++++++++
 1 file changed, 137 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml
Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml new file +137 -0
new file mode 100644
index 000000000000..fe352c01dd94
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/frequency/adi,admv1014.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADMV1014 Microwave Downconverter
+
+maintainers:
+  - Antoniu Miclaus <[email protected]>
+
+description: |
+   Wideband, microwave downconverter optimized for point to point microwave
+   radio designs operating in the 24 GHz to 44 GHz frequency range.
+
+   https://www.analog.com/en/products/admv1014.html
+
+properties:
+  compatible:
+    enum:
+      - adi,admv1014
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 1000000
+
+  clocks:
+    minItems: 1
+
+  clock-names:
+    items:
+      - const: lo_in
+    description:
+      External clock that provides the Local Oscilator input.
+
+  vcm-supply:
+    description:
+      Common-mode voltage regulator.
+
+  vcc-if-bb-supply:
+    description:
+      BB and IF supply voltage regulator.
+
+  vcc-vga-supply:
+    description:
+      RF Amplifier supply voltage regulator.
+
+  vcc-vva-supply:
+    description:
+      VVA Control Circuit supply voltage regulator.
+
+  vcc-lna-3p3-supply:
+    description:
+      Low Noise Amplifier 3.3V supply voltage regulator.
+
+  vcc-lna-1p5-supply:
+    description:
+      Low Noise Amplifier 1.5V supply voltage regulator.
+
+  vcc-bg-supply:
+    description:
+      Band Gap Circuit supply voltage regulator.
+
+  vcc-quad-supply:
+    description:
+      Quadruple supply voltage regulator.
+
+  vcc-mixer-supply:
+    description:
+      Mixer supply voltage regulator.
+
+  adi,input-mode:
+    description:
+      Select the input mode.
+      iq - in-phase quadrature (I/Q) input
+      if - complex intermediate frequency (IF) input
+    enum: [iq, if]
+
+  adi,detector-enable:
+    description:
+      Digital Rx Detector Enable. The Square Law Detector output is
+      available at output pin VDET.
+    type: boolean
+
+  adi,p1db-compensation-enable:
+    description:
+      Turn on bits to optimize P1dB.
+    type: boolean
+
+  adi,quad-se-mode:
+    description:
+      Switch the LO path from differential to single-ended operation.
+      se-neg - Single-Ended Mode, Negative Side Disabled.
+      se-pos - Single-Ended Mode, Positive Side Disabled.
+      diff - Differential Mode.
+    enum: [se-neg, se-pos, diff]
+
+  '#clock-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - vcm-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      admv1014@0{
+        compatible = "adi,admv1014";
+        reg = <0>;
+        spi-max-frequency = <1000000>;
+        clocks = <&admv1014_lo>;
+        clock-names = "lo_in";
+        vcm-supply = <&vcm>;
+        vcc-if-bb-supply = <&vcc_if_bb>;
+        vcc-vga-supply = <&vcc_vga>;
+        vcc-vva-supply = <&vcc_vva>;
+        vcc-lna-3p3-supply = <&vcc_lna_3p3>;
+        vcc-lna-1p5-supply = <&vcc_lna_1p5>;
+        vcc-bg-supply = <&vcc_bg>;
+        vcc-quad-supply = <&vcc_quad>;
+        vcc-mixer-supply = <&vcc_mixer>;
+        adi,quad-se-mode = "diff";
+        adi,detector-enable;
+        adi,p1db-compensation-enable;
+      };
+    };
+...
Signature · 1 line
2.35.1
author maintainer Reviewed-by Rob Herring on v6 2/4
#2 lore raw

RE: [PATCH v6 2/4] dt-bindings:iio:frequency: add admv1014 binding

--
Antoniu Miclăuş

Quoted 11 lines

-----Original Message-----
From: Antoniu Miclaus <[email protected]>
Sent: Monday, February 7, 2022 3:06 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: Miclaus, Antoniu <[email protected]>
Subject: [PATCH v6 2/4] dt-bindings:iio:frequency: add admv1014 binding

Add device tree bindings for the ADMV1014 Upconverter.

Forgot to add in v6:

(here, not in the ABI patch, my bad)

Quoted 156 lines

---
no changes in v6.

 .../bindings/iio/frequency/adi,admv1014.yaml  | 137 ++++++++++++++++++
 1 file changed, 137 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml

diff --git a/Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml b/Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml new file mode 100644
index 000000000000..fe352c01dd94
--- /dev/null
+++
b/Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml

Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml new file +13 -0
@@ -0,0 +1,137 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/frequency/adi,admv1014.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADMV1014 Microwave Downconverter
+
+maintainers:
+  - Antoniu Miclaus <[email protected]>
+
+description: |
+   Wideband, microwave downconverter optimized for point to point

microwave

Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml new file +124 -1
+   radio designs operating in the 24 GHz to 44 GHz frequency range.
+
+   https://www.analog.com/en/products/admv1014.html
+
+properties:
+  compatible:
+    enum:
+      - adi,admv1014
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 1000000
+
+  clocks:
+    minItems: 1
+
+  clock-names:
+    items:
+      - const: lo_in
+    description:
+      External clock that provides the Local Oscilator input.
+
+  vcm-supply:
+    description:
+      Common-mode voltage regulator.
+
+  vcc-if-bb-supply:
+    description:
+      BB and IF supply voltage regulator.
+
+  vcc-vga-supply:
+    description:
+      RF Amplifier supply voltage regulator.
+
+  vcc-vva-supply:
+    description:
+      VVA Control Circuit supply voltage regulator.
+
+  vcc-lna-3p3-supply:
+    description:
+      Low Noise Amplifier 3.3V supply voltage regulator.
+
+  vcc-lna-1p5-supply:
+    description:
+      Low Noise Amplifier 1.5V supply voltage regulator.
+
+  vcc-bg-supply:
+    description:
+      Band Gap Circuit supply voltage regulator.
+
+  vcc-quad-supply:
+    description:
+      Quadruple supply voltage regulator.
+
+  vcc-mixer-supply:
+    description:
+      Mixer supply voltage regulator.
+
+  adi,input-mode:
+    description:
+      Select the input mode.
+      iq - in-phase quadrature (I/Q) input
+      if - complex intermediate frequency (IF) input
+    enum: [iq, if]
+
+  adi,detector-enable:
+    description:
+      Digital Rx Detector Enable. The Square Law Detector output is
+      available at output pin VDET.
+    type: boolean
+
+  adi,p1db-compensation-enable:
+    description:
+      Turn on bits to optimize P1dB.
+    type: boolean
+
+  adi,quad-se-mode:
+    description:
+      Switch the LO path from differential to single-ended operation.
+      se-neg - Single-Ended Mode, Negative Side Disabled.
+      se-pos - Single-Ended Mode, Positive Side Disabled.
+      diff - Differential Mode.
+    enum: [se-neg, se-pos, diff]
+
+  '#clock-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - vcm-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      admv1014@0{
+        compatible = "adi,admv1014";
+        reg = <0>;
+        spi-max-frequency = <1000000>;
+        clocks = <&admv1014_lo>;
+        clock-names = "lo_in";
+        vcm-supply = <&vcm>;
+        vcc-if-bb-supply = <&vcc_if_bb>;
+        vcc-vga-supply = <&vcc_vga>;
+        vcc-vva-supply = <&vcc_vva>;
+        vcc-lna-3p3-supply = <&vcc_lna_3p3>;
+        vcc-lna-1p5-supply = <&vcc_lna_1p5>;
+        vcc-bg-supply = <&vcc_bg>;
+        vcc-quad-supply = <&vcc_quad>;
+        vcc-mixer-supply = <&vcc_mixer>;
+        adi,quad-se-mode = "diff";
+        adi,detector-enable;
+        adi,p1db-compensation-enable;
+      };
+    };
+...
--

2.35.1

author maintainer
#3 lore raw

PATCH v6 3/4 Documentation:ABI:testing:admv1014: add ABI docs

In reply to Antoniu Miclaus

Add documentation for the use of the Digital Attenuator gain.

---
no changes in v6.

 Documentation/ABI/testing/sysfs-bus-iio       |  1 +
 .../testing/sysfs-bus-iio-frequency-admv1014  | 23 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014
Documentation/ABI/testing/sysfs-bus-iio +1 -0
index c551301b33f1..2b5770017a84 100644
@@ -476,6 +476,7 @@ What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale
Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +23 -0
new file mode 100644
index 000000000000..395010a0ef8b
@@ -0,0 +1,23 @@
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_i_calibscale_coarse
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_I) with coarse steps.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_q_calibscale_coarse
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_Q) with coarse steps.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_i_calibscale_fine
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_I) with fine steps.
+
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_q_calibscale_fine
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_Q) with fine steps.
Signature · 1 line
2.35.1
author maintainer Reviewed-by Rob Herring on v6 3/4
#4 lore raw

RE: [PATCH v6 3/4] Documentation:ABI:testing:admv1014: add ABI docs

--
Antoniu Miclăuş

Quoted 11 lines

-----Original Message-----
From: Antoniu Miclaus <[email protected]>
Sent: Monday, February 7, 2022 3:06 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: Miclaus, Antoniu <[email protected]>
Subject: [PATCH v6 3/4] Documentation:ABI:testing:admv1014: add ABI docs

Add documentation for the use of the Digital Attenuator gain.

Forgot to add in v6:

Quoted 62 lines

---
no changes in v6.

 Documentation/ABI/testing/sysfs-bus-iio       |  1 +
 .../testing/sysfs-bus-iio-frequency-admv1014  | 23 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-frequency-

admv1014

Documentation/ABI/testing/sysfs-bus-iio +1 -0
index c551301b33f1..2b5770017a84 100644
@@ -476,6 +476,7 @@ What:
 	/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale

What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +1 -0
new file mode 100644
index 000000000000..395010a0ef8b
@@ -0,0 +1,23 @@
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_i_calibscale_coarse

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_I) with

coarse steps.

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +2 -0
+
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_q_calibscale_coarse

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_Q) with

coarse steps.

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +2 -0
+
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_i_calibscale_fine

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_I) with

fine steps.

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +2 -0
+
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_q_calibscale_fine

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_Q) with

fine steps.
--
2.35.1

maintainer
#5 lore raw

Re: [PATCH v6 3/4] Documentation:ABI:testing:admv1014: add ABI docs

Quoted 11 lines · Antoniu

--
Antoniu Miclăuş

Quoted 8 lines

-----Original Message-----
From: Antoniu Miclaus <[email protected]>
Sent: Monday, February 7, 2022 3:06 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: Miclaus, Antoniu <[email protected]>
Subject: [PATCH v6 3/4] Documentation:ABI:testing:admv1014: add ABI docs

Quoted 5 lines
Quoted 3 lines

Add documentation for the use of the Digital Attenuator gain.

Forgot to add in v6:

Ah. That will break b4 trying to pick this up (as it's in the wrong patch as you noted).

Please resend as v7 with fixed up tags.

I'm waiting to give Andy another chance to look at this if he wants anyway.

Thanks,

Jonathan

Quoted 63 lines
Quoted 62 lines

---
no changes in v6.

 Documentation/ABI/testing/sysfs-bus-iio       |  1 +
 .../testing/sysfs-bus-iio-frequency-admv1014  | 23 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-frequency-

admv1014

Documentation/ABI/testing/sysfs-bus-iio +1 -0
index c551301b33f1..2b5770017a84 100644
@@ -476,6 +476,7 @@ What:
 	/sys/bus/iio/devices/iio:deviceX/in_voltageY_i_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltageY_q_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_i_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_q_calibscale
+What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltage_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_voltage_calibscale
 What:		/sys/bus/iio/devices/iio:deviceX/in_accel_x_calibscale

What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibscale

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +1 -0
new file mode 100644
index 000000000000..395010a0ef8b
@@ -0,0 +1,23 @@
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_i_calibscale_coarse

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_I) with

coarse steps.

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +2 -0
+
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_q_calibscale_coarse

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_Q) with

coarse steps.

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +2 -0
+
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_i_calibscale_fine

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_I) with

fine steps.

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +2 -0
+
+What:

/sys/bus/iio/devices/iio:deviceX/in_altvoltage0_q_calibscale_fine

Documentation/ABI/testing/sysfs-bus-iio-frequency-admv1014 new file +4 -0
+KernelVersion: 5.18
+Contact:	[email protected]
+Description:
+		Read/write value for the digital attenuator gain (IF_Q) with

fine steps.
--
2.35.1

author maintainer
#6 lore raw

PATCH v6 4/4 MAINTAINERS: add maintainer for ADMV1014 driver

In reply to Antoniu Miclaus

Add myself as maintainer for the ADMV1014 driver.

---
no changes in v6.

 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index 170bbbeefc3f..b05148cfd4aa 100644
@@ -1119,6 +1119,14 @@ W:	http://ez.analog.com/community/linux-device-drivers
 F:	Documentation/devicetree/bindings/hwmon/adi,adm1177.yaml
 F:	drivers/hwmon/adm1177.c
 
+ANALOG DEVICES INC ADMV1014 DRIVER
+M:	Antoniu Miclaus <[email protected]>
+L:	[email protected]
+S:	Supported
+W:	https://ez.analog.com/linux-software-drivers
+F:	Documentation/devicetree/bindings/iio/frequency/adi,admv1014.yaml
+F:	drivers/iio/frequency/admv1014.c
+
 ANALOG DEVICES INC ADP5061 DRIVER
 M:	Michael Hennerich <[email protected]>
 L:	[email protected]
Signature · 1 line
2.35.1