* [PATCH v2 0/3] iio: amplifiers: add support for ADL8113 Low Noise Amplifier
@ 2025-11-08 17:43 Antoniu Miclaus
2025-11-08 17:43 ` [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113 Antoniu Miclaus
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Antoniu Miclaus @ 2025-11-08 17:43 UTC (permalink / raw)
To: jic23, robh, conor+dt, linux-iio, linux-kernel, devicetree
Cc: Antoniu Miclaus
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
--
2.43.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113
2025-11-08 17:43 [PATCH v2 0/3] iio: amplifiers: add support for ADL8113 Low Noise Amplifier Antoniu Miclaus
@ 2025-11-08 17:43 ` Antoniu Miclaus
2025-11-08 18:25 ` Rob Herring (Arm)
2025-11-08 17:43 ` [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support Antoniu Miclaus
2025-11-08 17:43 ` [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation Antoniu Miclaus
2 siblings, 1 reply; 9+ messages in thread
From: Antoniu Miclaus @ 2025-11-08 17:43 UTC (permalink / raw)
To: jic23, robh, conor+dt, linux-iio, linux-kernel, devicetree
Cc: Antoniu Miclaus
Add devicetree bindings for adl8113.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
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
diff --git a/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml b/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml
new file mode 100644
index 000000000000..cf8dd6e8b887
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml
@@ -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 <antoniu.miclaus@analog.com>
+
+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>;
+ };
+...
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
2025-11-08 17:43 [PATCH v2 0/3] iio: amplifiers: add support for ADL8113 Low Noise Amplifier Antoniu Miclaus
2025-11-08 17:43 ` [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113 Antoniu Miclaus
@ 2025-11-08 17:43 ` Antoniu Miclaus
2025-11-09 17:22 ` Jonathan Cameron
2025-11-08 17:43 ` [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation Antoniu Miclaus
2 siblings, 1 reply; 9+ messages in thread
From: Antoniu Miclaus @ 2025-11-08 17:43 UTC (permalink / raw)
To: jic23, robh, conor+dt, linux-iio, linux-kernel, devicetree
Cc: Antoniu Miclaus
Add support for adl8113 10MHz to 12GHz Low Noise Amplifier with
10MHz to 14GHz bypass switches.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
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
diff --git a/drivers/iio/amplifiers/Kconfig b/drivers/iio/amplifiers/Kconfig
index 55eb16b32f6c..a8a604863eed 100644
--- a/drivers/iio/amplifiers/Kconfig
+++ b/drivers/iio/amplifiers/Kconfig
@@ -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
diff --git a/drivers/iio/amplifiers/Makefile b/drivers/iio/amplifiers/Makefile
index 2126331129cf..0a76443be1aa 100644
--- a/drivers/iio/amplifiers/Makefile
+++ b/drivers/iio/amplifiers/Makefile
@@ -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
diff --git a/drivers/iio/amplifiers/adl8113.c b/drivers/iio/amplifiers/adl8113.c
new file mode 100644
index 000000000000..8c234f0a1b6a
--- /dev/null
+++ b/drivers/iio/amplifiers/adl8113.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * ADL8113 Low Noise Amplifier with integrated bypass switches
+ *
+ * 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>
+#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>
+
+enum adl8113_mode {
+ ADL8113_INTERNAL_AMPLIFIER,
+ ADL8113_INTERNAL_BYPASS,
+ ADL8113_EXTERNAL_BYPASS_A,
+ ADL8113_EXTERNAL_BYPASS_B,
+};
+
+struct adl8113_state {
+ struct gpio_desc *gpio_va;
+ struct gpio_desc *gpio_vb;
+ enum adl8113_mode current_mode;
+};
+
+static const char * const adl8113_supply_names[] = {
+ "vdd1",
+ "vdd2",
+ "vss2"
+};
+
+static const char * const adl8113_mode_names[] = {
+ [ADL8113_INTERNAL_AMPLIFIER] = "internal_amplifier",
+ [ADL8113_INTERNAL_BYPASS] = "internal_bypass",
+ [ADL8113_EXTERNAL_BYPASS_A] = "external_bypass_a",
+ [ADL8113_EXTERNAL_BYPASS_B] = "external_bypass_b",
+};
+
+static int adl8113_set_mode(struct adl8113_state *st, enum adl8113_mode mode)
+{
+ switch (mode) {
+ case ADL8113_INTERNAL_AMPLIFIER:
+ gpiod_set_value(st->gpio_va, 0);
+ gpiod_set_value(st->gpio_vb, 0);
+ break;
+ case ADL8113_INTERNAL_BYPASS:
+ gpiod_set_value(st->gpio_va, 1);
+ gpiod_set_value(st->gpio_vb, 1);
+ break;
+ case ADL8113_EXTERNAL_BYPASS_A:
+ gpiod_set_value(st->gpio_va, 0);
+ gpiod_set_value(st->gpio_vb, 1);
+ break;
+ case ADL8113_EXTERNAL_BYPASS_B:
+ gpiod_set_value(st->gpio_va, 1);
+ gpiod_set_value(st->gpio_vb, 0);
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ st->current_mode = mode;
+ return 0;
+}
+
+static int adl8113_get_mode(struct iio_dev *indio_dev,
+ const struct iio_chan_spec *chan)
+{
+ struct adl8113_state *st = iio_priv(indio_dev);
+
+ return st->current_mode;
+}
+
+static int adl8113_set_mode_enum(struct iio_dev *indio_dev,
+ const struct iio_chan_spec *chan,
+ unsigned int mode)
+{
+ struct adl8113_state *st = iio_priv(indio_dev);
+
+ if (mode >= ARRAY_SIZE(adl8113_mode_names))
+ return -EINVAL;
+
+ return adl8113_set_mode(st, mode);
+}
+
+static const struct iio_enum adl8113_mode_enum = {
+ .items = adl8113_mode_names,
+ .num_items = ARRAY_SIZE(adl8113_mode_names),
+ .get = adl8113_get_mode,
+ .set = adl8113_set_mode_enum,
+};
+
+static const struct iio_chan_spec_ext_info adl8113_ext_info[] = {
+ IIO_ENUM("mode", IIO_SHARED_BY_ALL, &adl8113_mode_enum),
+ IIO_ENUM_AVAILABLE("mode", IIO_SHARED_BY_ALL, &adl8113_mode_enum),
+ { },
+};
+
+static const struct iio_chan_spec adl8113_channels[] = {
+ {
+ .type = IIO_VOLTAGE,
+ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_HARDWAREGAIN),
+ .indexed = 1,
+ .channel = 0,
+ .ext_info = adl8113_ext_info,
+ },
+};
+
+static int adl8113_read_raw(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ int *val, int *val2, long mask)
+{
+ 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;
+ break;
+ case ADL8113_INTERNAL_BYPASS:
+ *val = 0;
+ *val2 = 0;
+ ret = IIO_VAL_INT_PLUS_MICRO_DB;
+ break;
+ case ADL8113_EXTERNAL_BYPASS_A:
+ case ADL8113_EXTERNAL_BYPASS_B:
+ default:
+ ret = -EINVAL;
+ }
+ return ret;
+ default:
+ return -EINVAL;
+ }
+}
+
+static const struct iio_info adl8113_info = {
+ .read_raw = adl8113_read_raw,
+};
+
+static int adl8113_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct adl8113_state *st;
+ struct iio_dev *indio_dev;
+ int ret;
+
+ indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
+ if (!indio_dev)
+ return -ENOMEM;
+
+ st = iio_priv(indio_dev);
+
+ st->gpio_va = devm_gpiod_get(dev, "va", GPIOD_OUT_LOW);
+ if (IS_ERR(st->gpio_va))
+ return dev_err_probe(dev, PTR_ERR(st->gpio_va),
+ "failed to get VA GPIO\n");
+
+ st->gpio_vb = devm_gpiod_get(dev, "vb", GPIOD_OUT_LOW);
+ if (IS_ERR(st->gpio_vb))
+ return dev_err_probe(dev, PTR_ERR(st->gpio_vb),
+ "failed to get VB GPIO\n");
+
+ ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(adl8113_supply_names),
+ adl8113_supply_names);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "failed to get and enable supplies\n");
+
+ ret = adl8113_set_mode(st, ADL8113_INTERNAL_AMPLIFIER);
+ if (ret)
+ return ret;
+
+ indio_dev->info = &adl8113_info;
+ indio_dev->name = "adl8113";
+ indio_dev->channels = adl8113_channels;
+ indio_dev->num_channels = ARRAY_SIZE(adl8113_channels);
+ indio_dev->modes = INDIO_DIRECT_MODE;
+
+ return devm_iio_device_register(dev, indio_dev);
+}
+
+static const struct of_device_id adl8113_of_match[] = {
+ { .compatible = "adi,adl8113" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, adl8113_of_match);
+
+static struct platform_driver adl8113_driver = {
+ .driver = {
+ .name = "adl8113",
+ .of_match_table = adl8113_of_match,
+ },
+ .probe = adl8113_probe,
+};
+
+module_platform_driver(adl8113_driver);
+
+MODULE_AUTHOR("Antoniu Miclaus <antoniu.miclaus@analog.com>");
+MODULE_DESCRIPTION("Analog Devices ADL8113 Low Noise Amplifier");
+MODULE_LICENSE("GPL");
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation
2025-11-08 17:43 [PATCH v2 0/3] iio: amplifiers: add support for ADL8113 Low Noise Amplifier Antoniu Miclaus
2025-11-08 17:43 ` [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113 Antoniu Miclaus
2025-11-08 17:43 ` [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support Antoniu Miclaus
@ 2025-11-08 17:43 ` Antoniu Miclaus
2025-11-09 17:18 ` Jonathan Cameron
2 siblings, 1 reply; 9+ messages in thread
From: Antoniu Miclaus @ 2025-11-08 17:43 UTC (permalink / raw)
To: jic23, robh, conor+dt, linux-iio, linux-kernel, devicetree
Cc: Antoniu Miclaus
Add ABI documentation for the ADL8113 Low Noise Amplifier,
covering the 4 pin-selectable operating modes.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
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
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 b/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113
new file mode 100644
index 000000000000..6e3994283a45
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113
@@ -0,0 +1,32 @@
+What: /sys/bus/iio/devices/iio:deviceX/mode
+Date: January 2025
+KernelVersion: 6.14
+Contact: linux-iio@vger.kernel.org
+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: linux-iio@vger.kernel.org
+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.
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113
2025-11-08 17:43 ` [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113 Antoniu Miclaus
@ 2025-11-08 18:25 ` Rob Herring (Arm)
0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring (Arm) @ 2025-11-08 18:25 UTC (permalink / raw)
To: Antoniu Miclaus; +Cc: linux-iio, devicetree, linux-kernel, jic23, conor+dt
On Sat, 08 Nov 2025 17:43:52 +0000, Antoniu Miclaus wrote:
> Add devicetree bindings for adl8113.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
>
> 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
>
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/20251108174357.3748-2-antoniu.miclaus@analog.com
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation
2025-11-08 17:43 ` [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation Antoniu Miclaus
@ 2025-11-09 17:18 ` Jonathan Cameron
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2025-11-09 17:18 UTC (permalink / raw)
To: Antoniu Miclaus; +Cc: robh, conor+dt, linux-iio, linux-kernel, devicetree
On Sat, 8 Nov 2025 17:43:54 +0000
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> Add ABI documentation for the ADL8113 Low Noise Amplifier,
> covering the 4 pin-selectable operating modes.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
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.
> ---
>
> 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
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 b/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113
> new file mode 100644
> index 000000000000..6e3994283a45
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113
> @@ -0,0 +1,32 @@
> +What: /sys/bus/iio/devices/iio:deviceX/mode
> +Date: January 2025
> +KernelVersion: 6.14
> +Contact: linux-iio@vger.kernel.org
> +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: linux-iio@vger.kernel.org
> +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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
2025-11-08 17:43 ` [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support Antoniu Miclaus
@ 2025-11-09 17:22 ` Jonathan Cameron
2025-11-11 14:06 ` Miclaus, Antoniu
0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Cameron @ 2025-11-09 17:22 UTC (permalink / raw)
To: Antoniu Miclaus; +Cc: robh, conor+dt, linux-iio, linux-kernel, devicetree
On Sat, 8 Nov 2025 17:43:53 +0000
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> Add support for adl8113 10MHz to 12GHz Low Noise Amplifier with
> 10MHz to 14GHz bypass switches.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
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
> diff --git a/drivers/iio/amplifiers/adl8113.c b/drivers/iio/amplifiers/adl8113.c
> new file mode 100644
> index 000000000000..8c234f0a1b6a
> --- /dev/null
> +++ b/drivers/iio/amplifiers/adl8113.c
> @@ -0,0 +1,213 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ADL8113 Low Noise Amplifier with integrated bypass switches
> + *
> + * 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.
> +#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)
> +{
> + 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 ...
> + break;
> + case ADL8113_INTERNAL_BYPASS:
> + *val = 0;
> + *val2 = 0;
gain of bypass = 1.0 rather than 0.0 which is open circuit gain.
> + ret = IIO_VAL_INT_PLUS_MICRO_DB;
return IIO_VAL_INT...
> + 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.
> + }
> + return ret;
> + default:
> + return -EINVAL;
> + }
> +}
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
2025-11-09 17:22 ` Jonathan Cameron
@ 2025-11-11 14:06 ` Miclaus, Antoniu
2025-11-15 18:12 ` Jonathan Cameron
0 siblings, 1 reply; 9+ messages in thread
From: Miclaus, Antoniu @ 2025-11-11 14:06 UTC (permalink / raw)
To: Jonathan Cameron
Cc: robh@kernel.org, conor+dt@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
> -----Original Message-----
> From: Jonathan Cameron <jic23@kernel.org>
> Sent: Sunday, November 9, 2025 7:22 PM
> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>
> Cc: robh@kernel.org; conor+dt@kernel.org; linux-iio@vger.kernel.org; linux-
> kernel@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
>
> [External]
>
> On Sat, 8 Nov 2025 17:43:53 +0000
> Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
>
> > Add support for adl8113 10MHz to 12GHz Low Noise Amplifier with
> > 10MHz to 14GHz bypass switches.
> >
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> 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
>
> > diff --git a/drivers/iio/amplifiers/adl8113.c
> b/drivers/iio/amplifiers/adl8113.c
> > new file mode 100644
> > index 000000000000..8c234f0a1b6a
> > --- /dev/null
> > +++ b/drivers/iio/amplifiers/adl8113.c
> > @@ -0,0 +1,213 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * ADL8113 Low Noise Amplifier with integrated bypass switches
> > + *
> > + * 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.
>
> > +#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)
> > +{
> > + 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 ...
>
> > + 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.
>
> > + ret = IIO_VAL_INT_PLUS_MICRO_DB;
> return IIO_VAL_INT...
>
> > + 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.
>
> > + }
> > + return ret;
> > + default:
> > + return -EINVAL;
> > + }
> > +}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support
2025-11-11 14:06 ` Miclaus, Antoniu
@ 2025-11-15 18:12 ` Jonathan Cameron
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Cameron @ 2025-11-15 18:12 UTC (permalink / raw)
To: Miclaus, Antoniu
Cc: robh@kernel.org, conor+dt@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
> > > +
> > > +static int adl8113_read_raw(struct iio_dev *indio_dev,
> > > + struct iio_chan_spec const *chan,
> > > + int *val, int *val2, long mask)
> > > +{
> > > + 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 ...
> >
> > > + 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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-11-15 18:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-08 17:43 [PATCH v2 0/3] iio: amplifiers: add support for ADL8113 Low Noise Amplifier Antoniu Miclaus
2025-11-08 17:43 ` [PATCH v2 1/3] dt-bindings: iio: amplifiers: add adl8113 Antoniu Miclaus
2025-11-08 18:25 ` Rob Herring (Arm)
2025-11-08 17:43 ` [PATCH v2 2/3] iio: amplifiers: adl8113: add driver support Antoniu Miclaus
2025-11-09 17:22 ` Jonathan Cameron
2025-11-11 14:06 ` Miclaus, Antoniu
2025-11-15 18:12 ` Jonathan Cameron
2025-11-08 17:43 ` [PATCH v2 3/3] Documentation: ABI: adl8113: add documentation Antoniu Miclaus
2025-11-09 17:18 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox