iio: amplifiers: add support for ADL8113 Low Noise Amplifier
Antoniu Miclaus
maintainerv2 cover iio: amplifiers: add support for ADL8113 Low Noise Amplifier
This patch series adds support for the Analog Devices ADL8113, a 10MHz to 12GHz Low Noise Amplifier with integrated bypass switches.
The ADL8113 provides four operation modes controlled by two GPIO pins:
- Internal Amplifier (14dB gain)
- Internal Bypass (0dB gain)
- External Bypass A (0dB gain) - Signal routes from RFIN to OUT_A and from IN_A to RFOUT
- External Bypass B (0dB gain) - Signal routes from RFIN to OUT_B and from IN_B to RFOUT
The external bypass modes enable external signal processing, conditioning, or filtering while maintaining signal integrity through dedicated signal paths.
Changes in v2:
- Enhanced documentation of external bypass A and B modes in device tree bindings, clarifying the signal routing paths (RFIN→OUT_A/OUT_B and IN_A/IN_B→RFOUT)
- Updated ABI documentation to provide clearer descriptions of external bypass modes and their signal routing behavior
Antoniu Miclaus (3):
dt-bindings: iio: amplifiers: add adl8113
iio: amplifiers: adl8113: add driver support
Documentation: ABI: adl8113: add documentation
.../testing/sysfs-bus-iio-amplifiers-adl8113 | 32 +++ .../bindings/iio/amplifiers/adi,adl8113.yaml | 65 ++++++ drivers/iio/amplifiers/Kconfig | 12 + drivers/iio/amplifiers/Makefile | 1 + drivers/iio/amplifiers/adl8113.c | 213 ++++++++++++++++++ 5 files changed, 323 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 create mode 100644 Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml create mode 100644 drivers/iio/amplifiers/adl8113.c
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 1/3 dt-bindings: iio: amplifiers: add adl8113
Add devicetree bindings for adl8113.
---
Changes in v2:
- Enhance External Bypass A mode description: clarify signal routing from RFIN to OUT_A and from IN_A to RFOUT
- Enhance External Bypass B mode description: clarify signal routing from RFIN to OUT_B and from IN_B to RFOUT
- Remove adi,initial-mode property and its description, enum values, and example usage
- Simplify device tree example by removing adi,initial-mode = <0> parameter
.../bindings/iio/amplifiers/adi,adl8113.yaml | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml
Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml new file +65 -0
@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/amplifiers/adi,adl8113.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices ADL8113 Low Noise Amplifier with integrated bypass switches + +maintainers: + - Antoniu Miclaus <[email protected]> + +description: | + The ADL8113 is a 10MHz to 12GHz Low Noise Amplifier with integrated bypass + switches controlled by two GPIO pins (VA and VB). The device supports four + operation modes: + - Internal Amplifier: VA=0, VB=0 - Signal passes through the internal LNA + - Internal Bypass: VA=1, VB=1 - Signal bypasses through internal path + - External Bypass A: VA=0, VB=1 - Signal routes from RFIN to OUT_A and from IN_A to RFOUT + - External Bypass B: VA=1, VB=0 - Signal routes from RFIN to OUT_B and from IN_B to RFOUT + + https://www.analog.com/en/products/adl8113.html + +properties: + compatible: + const: adi,adl8113 + + vdd1-supply: true + + vdd2-supply: true + + vss2-supply: true + + va-gpios: + description: + GPIO connected to the VA control pin. Must be specified as GPIO_ACTIVE_HIGH. + maxItems: 1 + + vb-gpios: + description: + GPIO connected to the VB control pin. Must be specified as GPIO_ACTIVE_HIGH. + maxItems: 1 + + +required: + - compatible + - va-gpios + - vb-gpios + - vdd1-supply + - vdd2-supply + - vss2-supply + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + amplifier { + compatible = "adi,adl8113"; + va-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + vb-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; + vdd1-supply = <&vdd1_5v>; + vdd2-supply = <&vdd2_3v3>; + vss2-supply = <&vss2_neg>; + }; +...
Signature · 1 line
2.43.0
Rob Herring (Arm)
maintainerRe: [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113
Quoted 5 lines · Antoniu Miclaus
Add devicetree bindings for adl8113.
Signed-off-by Antoniu Miclaus <[email protected]>---
Quoted 9 lines
Changes in v2:
- Enhance External Bypass A mode description: clarify signal routing from RFIN toOUT_Aand fromIN_Ato RFOUT
- Enhance External Bypass B mode description: clarify signal routing from RFIN toOUT_Band fromIN_Bto RFOUT
- Remove adi,initial-mode property and its description, enum values, and example usage
- Simplify device tree example by removing adi,initial-mode = <0> parameter.../bindings/iio/amplifiers/adi,adl8113.yaml | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:./Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml:43:1: [warning] too many blank lines (2 > 1) (empty-lines)
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Antoniu Miclaus
maintainerPATCH v2 2/3 iio: amplifiers: adl8113: add driver support
In reply to Antoniu MiclausAdd support for adl8113 10MHz to 12GHz Low Noise Amplifier with 10MHz to 14GHz bypass switches.
---
Changes in v2:
- Add linux/array_size.h include for ARRAY_SIZE macro usage
- Remove linux/kernel.h and linux/mutex.h includes (no longer needed)
- Remove mutex lock from struct adl8113_state (simplify concurrency model)
- Add trailing comma to ADL8113_EXTERNAL_BYPASS_B enum value for consistency
- Simplify adl8113_set_mode_enum() by removing mutex locking and direct return
- Reorder case statements in adl8113_read_raw() for external bypass modes
- Remove mutex locking from hardware gain reading operation
- Remove adi,initial-mode device property support and related logic
- Simplify probe function by removing initial_mode variable and property reading
- Always initialize device to ADL8113_INTERNAL_AMPLIFIER mode
- Remove device registration success message and simplify return logic
- Fix of_device_id array formatting (spacing)
drivers/iio/amplifiers/Kconfig | 12 ++ drivers/iio/amplifiers/Makefile | 1 + drivers/iio/amplifiers/adl8113.c | 213 +++++++++++++++++++++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 drivers/iio/amplifiers/adl8113.c
drivers/iio/amplifiers/Kconfig +12 -0
@@ -36,6 +36,18 @@ config ADA4250 To compile this driver as a module, choose M here: the module will be called ada4250. +config ADL8113 + tristate "Analog Devices ADL8113 Low Noise Amplifier" + depends on GPIOLIB + help + Say yes here to build support for Analog Devices ADL8113 Low Noise + Amplifier with integrated bypass switches. The device supports four + operation modes controlled by GPIO pins: internal amplifier, + internal bypass, and two external bypass modes. + + To compile this driver as a module, choose M here: the + module will be called adl8113. + config HMC425 tristate "Analog Devices HMC425A and similar GPIO Gain Amplifiers" depends on GPIOLIB
drivers/iio/amplifiers/Makefile +1 -0
@@ -6,4 +6,5 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_AD8366) += ad8366.o obj-$(CONFIG_ADA4250) += ada4250.o +obj-$(CONFIG_ADL8113) += adl8113.o obj-$(CONFIG_HMC425) += hmc425a.o
drivers/iio/amplifiers/adl8113.c new file +213 -0
213 lines not on this page · raw message
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerRe: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
Quoted 4 lines · On Sat, 8 Nov 2025 17:43:53 +0000 Antoniu Miclaus <[email protected]>…
Add support for adl8113 10MHz to 12GHz Low Noise Amplifier with 10MHz to 14GHz bypass switches.
Signed-off-by Antoniu Miclaus <[email protected]>
Hi Antoniu
I think we need to come up with an innovative solution for the "mode". I'm not sure what it is yet though so very much looking for some discussion.
thanks,
Jonathan
Quoted 9 lines
drivers/iio/amplifiers/adl8113.c new file +3
-0@@ -0,0 +1,213 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* ADL8113 Low Noise Amplifier with integrated bypass switches
drivers/iio/amplifiers/adl8113.c line 13
Quoted 10 lines
drivers/iio/amplifiers/adl8113.c new file +10
-0+* +* Copyright 2025 Analog Devices Inc. +*/ + +#include <linux/array_size.h> +#include <linux/device.h> +#include <linux/err.h> +#include <linux/gpio/consumer.h> +#include <linux/iio/iio.h> +#include <linux/iio/sysfs.h>
Not sure if this file is being used. It is rare to see it needed in a modern drive.
Quoted 13 lines
drivers/iio/amplifiers/adl8113.c new file +12
-0+#include <linux/mod_devicetable.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> +#include <linux/regulator/consumer.h> +#include <linux/slab.h> +#include <linux/sysfs.h> + +static int adl8113_read_raw (struct iio_dev *indio_dev, +struct iio_chan_spec const *chan, +int *val,int *val2,long mask) +{
drivers/iio/amplifiers/adl8113.c line 131
Quoted 10 lines
drivers/iio/amplifiers/adl8113.c new file +10
-0+struct adl8113_state *st =iio_priv (indio_dev); +int ret; + +switch (mask) { +case IIO_CHAN_INFO_HARDWAREGAIN : +switch (st->current_mode) { +case ADL8113_INTERNAL_AMPLIFIER : + *val =14 ; + *val2 =0 ; + ret =IIO_VAL_INT_PLUS_MICRO_DB ;
return ...
drivers/iio/amplifiers/adl8113.c line 135
Quoted 4 lines
drivers/iio/amplifiers/adl8113.c new file +4
-0+break ; +case ADL8113_INTERNAL_BYPASS : + *val =0 ; + *val2 =0 ;
gain of bypass = 1.0 rather than 0.0 which is open circuit gain.
drivers/iio/amplifiers/adl8113.c
Quoted 1 line
drivers/iio/amplifiers/adl8113.c new file +1
-0+ ret =IIO_VAL_INT_PLUS_MICRO_DB ;
return IIO_VAL_INT...
drivers/iio/amplifiers/adl8113.c line 141
Quoted 5 lines
drivers/iio/amplifiers/adl8113.c new file +5
-0+break ; +case ADL8113_EXTERNAL_BYPASS_A : +case ADL8113_EXTERNAL_BYPASS_B : +default : + ret = -EINVAL ;
return -EINVAL;
Early returns save a line of code here and I general think make for much more readable code.
Quoted 6 lines
drivers/iio/amplifiers/adl8113.c new file +6
-0+ } +return ret; +default : +return -EINVAL ; + } +}
Miclaus, Antoniu
maintainerRE: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
Quoted 76 lines
-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Sunday, November 9, 2025 7:22 PM
To: Miclaus, Antoniu <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support[External]
Quoted 4 lines · On Sat, 8 Nov 2025 17:43:53 +0000 Antoniu Miclaus <[email protected]>…
Add support for adl8113 10MHz to 12GHz Low Noise Amplifier with 10MHz to 14GHz bypass switches.
Signed-off-by Antoniu Miclaus <[email protected]>Hi Antoniu
I think we need to come up with an innovative solution for the "mode". I'm not sure what it is yet though so very much looking for some discussion.
thanks,
Jonathan
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/iio/amplifiers/adl8113.cQuoted 8 lines
new file mode 100644
index 000000000000..8c234f0a1b6adrivers/iio/amplifiers/adl8113.c new file +3
-0@@ -0,0 +1,213 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* ADL8113 Low Noise Amplifier with integrated bypass switches drivers/iio/amplifiers/adl8113.c line 13
Quoted 10 lines
drivers/iio/amplifiers/adl8113.c new file +10
-0+* +* Copyright 2025 Analog Devices Inc. +*/ + +#include <linux/array_size.h> +#include <linux/device.h> +#include <linux/err.h> +#include <linux/gpio/consumer.h> +#include <linux/iio/iio.h> +#include <linux/iio/sysfs.h> Not sure if this file is being used. It is rare to see it needed in a modern drive.
Quoted 13 lines
drivers/iio/amplifiers/adl8113.c new file +12
-0+#include <linux/mod_devicetable.h> +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/property.h> +#include <linux/regulator/consumer.h> +#include <linux/slab.h> +#include <linux/sysfs.h> + +static int adl8113_read_raw (struct iio_dev *indio_dev, +struct iio_chan_spec const *chan, +int *val,int *val2,long mask) +{drivers/iio/amplifiers/adl8113.c line 131
Quoted 10 lines
drivers/iio/amplifiers/adl8113.c new file +10
-0+struct adl8113_state *st =iio_priv (indio_dev); +int ret; + +switch (mask) { +case IIO_CHAN_INFO_HARDWAREGAIN : +switch (st->current_mode) { +case ADL8113_INTERNAL_AMPLIFIER : + *val =14 ; + *val2 =0 ; + ret =IIO_VAL_INT_PLUS_MICRO_DB ;return ...
Quoted 5 lines
drivers/iio/amplifiers/adl8113.c line 135
Quoted 4 lines
drivers/iio/amplifiers/adl8113.c new file +4
-0+break ; +case ADL8113_INTERNAL_BYPASS : + *val =0 ; + *val2 =0 ;gain of bypass = 1.0 rather than 0.0 which is open circuit gain.
Isn't this supposed to be a dB value since I am returning IIO_VAL_INT_PLUS_MICRO_DB? Linear gain of 1 = 0dB.
Quoted 20 lines
drivers/iio/amplifiers/adl8113.c
Quoted 2 lines
drivers/iio/amplifiers/adl8113.c new file +1
-0+ ret =IIO_VAL_INT_PLUS_MICRO_DB ;return
IIO_VAL_INT...drivers/iio/amplifiers/adl8113.c line 141
Quoted 5 lines
drivers/iio/amplifiers/adl8113.c new file +5
-0+break ; +case ADL8113_EXTERNAL_BYPASS_A : +case ADL8113_EXTERNAL_BYPASS_B : +default : + ret = -EINVAL ;return
-EINVAL;Early returns save a line of code here and I general think make for much more readable code.
Quoted 6 lines
drivers/iio/amplifiers/adl8113.c new file +6
-0+ } +return ret; +default : +return -EINVAL ; + } +}
Jonathan Cameron
maintainerRe: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
Quoted 18 lines
Quoted 18 lines
Quoted 6 lines
drivers/iio/amplifiers/adl8113.c new file +5
-0+ +static int adl8113_read_raw (struct iio_dev *indio_dev, +struct iio_chan_spec const *chan, +int *val,int *val2,long mask) +{drivers/iio/amplifiers/adl8113.c line 131
Quoted 10 lines
drivers/iio/amplifiers/adl8113.c new file +10
-0+struct adl8113_state *st =iio_priv (indio_dev); +int ret; + +switch (mask) { +case IIO_CHAN_INFO_HARDWAREGAIN : +switch (st->current_mode) { +case ADL8113_INTERNAL_AMPLIFIER : + *val =14 ; + *val2 =0 ; + ret =IIO_VAL_INT_PLUS_MICRO_DB ;return ...
Quoted 6 lines
Quoted 5 lines
drivers/iio/amplifiers/adl8113.c line 135
Quoted 4 lines
drivers/iio/amplifiers/adl8113.c new file +4
-0+break ; +case ADL8113_INTERNAL_BYPASS : + *val =0 ; + *val2 =0 ;gain of bypass = 1.0 rather than 0.0 which is open circuit gain.
Isn't this supposed to be a dB value since I am returning
IIO_VAL_INT_PLUS_MICRO_DB? Linear gain of 1 = 0dB.
Good point. I missed the DB type.
Thanks,
J
Antoniu Miclaus
maintainerPATCH v2 3/3 Documentation: ABI: adl8113: add documentation
In reply to Antoniu MiclausAdd ABI documentation for the ADL8113 Low Noise Amplifier, covering the 4 pin-selectable operating modes.
---
Changes in v2:
- Enhance external_bypass_a mode description: clarify signal routing from RFIN to OUT_A and from IN_A to RFOUT
- Enhance external_bypass_b mode description: clarify signal routing from RFIN to OUT_B and from IN_B to RFOUT
.../testing/sysfs-bus-iio-amplifiers-adl8113 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113
Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 new file +32 -0
@@ -0,0 +1,32 @@ +What: /sys/bus/iio/devices/iio:deviceX/mode +Date: January 2025 +KernelVersion: 6.14 +Contact: [email protected] +Description: + This attribute allows the user to set the operation mode of the + ADL8113 Low Noise Amplifier. The available modes control signal + routing through different paths within the device. + + The supported modes are: + + * internal_amplifier - Signal passes through the internal low + noise amplifier (VA=0, VB=0). Provides 14dB gain. + + * internal_bypass - Signal bypasses through internal bypass path + (VA=1, VB=1). Provides 0dB gain. + + * external_bypass_a - Signal routes from RFIN to OUT_A and from IN_A to RFOUT + (VA=0, VB=1). Provides 0dB gain. + + * external_bypass_b - Signal routes from RFIN to OUT_B and from IN_B to RFOUT + (VA=1, VB=0). Provides 0dB gain. + +What: /sys/bus/iio/devices/iio:deviceX/mode_available +Date: January 2025 +KernelVersion: 6.14 +Contact: [email protected] +Description: + Reading this attribute returns a space-separated list of all + available operation modes for the ADL8113 device. The modes + control the signal path and determine whether the signal passes + through the internal amplifier or various bypass paths.
Signature · 1 line
2.43.0
Jonathan Cameron
maintainerRe: [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation
Quoted 4 lines · On Sat, 8 Nov 2025 17:43:54 +0000 Antoniu Miclaus <[email protected]>…
Add ABI documentation for the ADL8113 Low Noise Amplifier, covering the 4 pin-selectable operating modes.
Signed-off-by Antoniu Miclaus <[email protected]>
I'm still reluctant to have a mode parameter because they are close to unusable because they always indicate something highly device specific that no generic userspace can make use of.
My hang up continues to be that the first two are normal _scale controls, but the 2nd two are saying use this path for the signal with analog components in it, but providing no info on what that means wrt to what is measured.
If we do go ahead with this, then it needs a more specific name to avoid trampling on the namespace as "mode" would.
Quoted 47 lines
---
Changes in v2:
- Enhanceexternal_bypass_amode description: clarify signal routing from RFIN toOUT_Aand fromIN_Ato RFOUT
- Enhanceexternal_bypass_bmode description: clarify signal routing from RFIN toOUT_Band fromIN_Bto RFOUT.../testing/sysfs-bus-iio-amplifiers-adl8113 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 new file +32
-0@@ -0,0 +1,32 @@ +What: /sys/bus/iio/devices/iio:deviceX/mode +Date: January 2025 +KernelVersion: 6.14 +Contact: [email protected] +Description: + This attribute allows the user to set the operation mode of the + ADL8113 Low Noise Amplifier. The available modes control signal + routing through different paths within the device. + + The supported modes are: + + * internal_amplifier - Signal passes through the internal low + noise amplifier (VA=0, VB=0). Provides 14dB gain. + + * internal_bypass - Signal bypasses through internal bypass path + (VA=1, VB=1). Provides 0dB gain. + + * external_bypass_a - Signal routes from RFIN to OUT_A and from IN_A to RFOUT + (VA=0, VB=1). Provides 0dB gain. + + * external_bypass_b - Signal routes from RFIN to OUT_B and from IN_B to RFOUT + (VA=1, VB=0). Provides 0dB gain. + +What: /sys/bus/iio/devices/iio:deviceX/mode_available +Date: January 2025 +KernelVersion: 6.14 +Contact: [email protected] +Description: + Reading this attribute returns a space-separated list of all + available operation modes for the ADL8113 device. The modes + control the signal path and determine whether the signal passes + through the internal amplifier or various bypass paths.