From nobody Sun Feb 8 09:22:52 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8631F2E8894; Fri, 31 Oct 2025 16:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926678; cv=none; b=JoIgSy7Fb42IDGrkIJBRi1IWlgrgsVs+S4MtXedeas90wLoKSmgS7dKrIT+KNTexWZhB0pnZeTeSuq2W62Ag8QRvgKPyZfMeRgTzLZuCC/Mt/2itbj7y7Jaxa8L7VxBiR8pZJ18442gAjuTTxYVcIIBo1iUnB+ZaDAXYulpWz8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926678; c=relaxed/simple; bh=V0/NUajnJeCrMjUrkPKgumE5MElJqu51qxpD/GH7n1s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AM1WeK7z349aoazqv+//YFfUxen/doC01/HUuTfghIIY8XqxyGwfFAfJXP+zkabT6jrrmNNVidjIdkhkNd6BcAfan+7XoVdliHx0ebsq2FzXBjxU9H3rtrWyLfnFBWN+YKUQfBsSnJj3yNMbLzuXlmJen+b7mdc7ZSmVjkzCxpc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=f1+QyxDu; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="f1+QyxDu" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59VFGBoN2390145; Fri, 31 Oct 2025 12:04:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=kqyAP sC09TTOobFe7V+7cpVBoHxKuj6QvHdI3TC3/jA=; b=f1+QyxDu4fTaVpGGEy/9Y io3JG23lDjVuh4pvhGtr2/7ZaE58XBFtzjoAVlizzzweTq2ElYYSp2BANF4LXMDU O6nH25HN3LYG8JG6ZdMMYV9sOfAVAc1j5mqTh5EB1BqS5WLQQ1doiqawGKHiLLgl Ys9qUc2Ct+bNB7peOk1XyTsvt8CApwCdKBETxLSgzvKhJCk+ZRJTWq3vp6KGr9O8 0w4hosn/3bbaa14Ec6N2fUpz/9xTyZvgcFiKS9hO/kRWf9USXrP5Qb/ktLQBVVhQ NBlmMQpY4j2FhJEF3rVKs5ErEmIZxOJ0n4ZD3eQjFuo5ZKHZFKZSNzyMhg+UUC0q A== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4a4yktg8c8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Oct 2025 12:04:34 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 59VG4XKg064668 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2025 12:04:33 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 31 Oct 2025 12:04:33 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 31 Oct 2025 12:04:32 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 31 Oct 2025 12:04:32 -0400 Received: from Ubuntu.ad.analog.com ([10.32.15.145]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 59VG4K1L006874; Fri, 31 Oct 2025 12:04:27 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH 1/3] dt-bindings: iio: amplifiers: add adl8113 Date: Fri, 31 Oct 2025 16:04:03 +0000 Message-ID: <20251031160405.13286-2-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251031160405.13286-1-antoniu.miclaus@analog.com> References: <20251031160405.13286-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: Qdks2GWj3_1P3eXhT31PEWuD9kbxLCxZ X-Proofpoint-ORIG-GUID: Qdks2GWj3_1P3eXhT31PEWuD9kbxLCxZ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDMxMDE0NCBTYWx0ZWRfX8ocTBzoUDZWY b3v4gEIg0CxIJ46RZ5OLxdD2/DFUKPfUri0f12wbkD/kwTD7KcIrePPUlAKIcO4b03q/h3Vw4HD /QrjXaXAyRrU/QfQWidwfK8U9axmTrpK/p2b+re5dYpezVmOfDDUnblkeeUOd99Del7HQ91FTkp V5C2ebyA83QeoVW8C4j6HYB+EYNghGPrOZgMXxs2YcXOjIj7kKgHpclcBgVkE1D3Cint5VU0wk/ og2mpHWDl9lt0vdPV7WvB5Ogm1gvAtajjPzJBp5zUMJ6zPnX1goTWp9L39p74chU0wPsDXy0ux0 f22maiTa+LJn+cjcUXnCAug6Ed9WiEIuGd0Np3ulGWtx8QlVWkFC3MrBp9Am23NQXV6/D4HbovL Aw9jaM5JPIYvUxnCoVpuu2rX/iKq3g== X-Authority-Analysis: v=2.4 cv=Uq1u9uwB c=1 sm=1 tr=0 ts=6904de12 cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gEfo2CItAAAA:8 a=gAnH3GRIAAAA:8 a=fejBgCUCbQS8leEGmL4A:9 a=4Crt4hL0rqkA:10 a=shvgCOL7IKUA:10 a=sptkURWiP4Gy88Gu7hUp:22 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-10-31_05,2025-10-29_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 spamscore=0 phishscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2510310144 Content-Type: text/plain; charset="utf-8" Add devicetree bindings for adl8113. Signed-off-by: Antoniu Miclaus --- .../bindings/iio/amplifiers/adi,adl8113.yaml | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/amplifiers/adi,ad= l8113.yaml diff --git a/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.y= aml b/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml new file mode 100644 index 000000000000..4cc21c93233c --- /dev/null +++ b/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml @@ -0,0 +1,76 @@ +# 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 s= witches + +maintainers: + - Antoniu Miclaus + +description: | + The ADL8113 is a 10MHz to 12GHz Low Noise Amplifier with integrated bypa= ss + switches controlled by two GPIO pins (VA and VB). The device supports fo= ur + operation modes: + - Internal Amplifier: VA=3D0, VB=3D0 - Signal passes through the inter= nal LNA + - Internal Bypass: VA=3D1, VB=3D1 - Signal bypasses through internal p= ath + - External Bypass A: VA=3D0, VB=3D1 - Signal routes through external b= ypass path A + - External Bypass B: VA=3D1, VB=3D0 - Signal routes through external b= ypass path B + + 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_ACTI= VE_HIGH. + maxItems: 1 + + vb-gpios: + description: + GPIO connected to the VB control pin. Must be specified as GPIO_ACTI= VE_HIGH. + maxItems: 1 + + adi,initial-mode: + description: | + Initial operation mode after device initialization + 0 - Internal Amplifier (default) + 1 - Internal Bypass + 2 - External Bypass A + 3 - External Bypass B + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3] + default: 0 + +required: + - compatible + - va-gpios + - vb-gpios + - vdd1-supply + - vdd2-supply + - vss2-supply + +additionalProperties: false + +examples: + - | + #include + amplifier { + compatible =3D "adi,adl8113"; + va-gpios =3D <&gpio 22 GPIO_ACTIVE_HIGH>; + vb-gpios =3D <&gpio 23 GPIO_ACTIVE_HIGH>; + vdd1-supply =3D <&vdd1_5v>; + vdd2-supply =3D <&vdd2_3v3>; + vss2-supply =3D <&vss2_neg>; + adi,initial-mode =3D <0>; + }; +... --=20 2.43.0 From nobody Sun Feb 8 09:22:52 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF93F2F39A2; Fri, 31 Oct 2025 16:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926678; cv=none; b=akJDk0qKd8Lqq+frXpfyhl4Td2FGq2n3g8WSb1O8+MFmhHE8jkDbS7PjOAhUl4sUxBSXpnY2o/CPD0efaSvgNlfgS3mDiv+QZhZMIj8ouH1P+DYE0WU9yJMSfhxnI6A5C3q0fsRaF3fmo9CTQ6ikhUROQO8jo6OPTDPunLbDR2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926678; c=relaxed/simple; bh=blVqUcUzKxEJJlIh6iG0LdcfhNncKpWXQAlkPsrzzVg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QO/DGP8TP68zJv6mdfgYk1sXJt/WlNkblSeEVXUUEajytvb/WjRk6k02b276bqcEGc9/gj6IS5wE+MQD/rokqmnNSZSQz0a4PUEKR9113d5yhJNYa3ecEAdi1VLhq07LRB6JJ2RrPIPBInChJC99fS07g5r8HZLH3SN95fMFZd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=h6GgfEQp; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="h6GgfEQp" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59VDvg0Z1108539; Fri, 31 Oct 2025 12:04:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=2S48F aLVKvvE61pzF2BaBmKyYzUkJR5ipows9oemtjA=; b=h6GgfEQp+eSFOy4xGpetK Xr95DIM0WHmh59MidKArQnBdw9iadsgeNEU3HyZzfbVNhyOuRttyJ2W5T+Oc+Ftg iFkPt1MkqLt1CEIvkJZ9whr4eB6L10Wgz6T4gpl/Pnvk1q1ChESC1FSvJsNywwcV W4yPAqt8fkDkpLPCJNVze5Zx/466f1Q+GlumlhDfhu1FQGThFXVJ64ZW8d3HedbI 9mkfi3dfDg8fXfj7vFOMUV1jMO2M6gwqpC3LdCTanDivMT+ngUaW/Bl0raxbozrU zLFzjD5Vz8gclaf3Ph8mwvikwJgm0+/LafnBcKBtQxb3cN3thY0xd74O4kHXaZjT w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4a4p8atvfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Oct 2025 12:04:34 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 59VG4WtU064375 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2025 12:04:32 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 31 Oct 2025 12:04:32 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 31 Oct 2025 12:04:32 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 31 Oct 2025 12:04:32 -0400 Received: from Ubuntu.ad.analog.com ([10.32.15.145]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 59VG4K1M006874; Fri, 31 Oct 2025 12:04:28 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH 2/3] iio: amplifiers: adl8113: add driver support Date: Fri, 31 Oct 2025 16:04:04 +0000 Message-ID: <20251031160405.13286-3-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251031160405.13286-1-antoniu.miclaus@analog.com> References: <20251031160405.13286-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Authority-Analysis: v=2.4 cv=R4QO2NRX c=1 sm=1 tr=0 ts=6904de12 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gAnH3GRIAAAA:8 a=zrLN1I9oeIiPOX2w8Z4A:9 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-ORIG-GUID: iPjwVNdzILxibjbeMQwSC_jR-PJ_j2a9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDMxMDE0NCBTYWx0ZWRfXwtMcWcXxKCpQ 3qEdbu8KI9yEw3iVTUZu49zPDBHbQlahb54IotnvYqWmoX0npoRLbDdKcfuqwrJ+/PBIj5IWoFu uLOc0BfaFPAVW8JyCatA6TSs48Rq9W08WtaDtCcplD/ixtq+9Qus72Xh5WfV0TEfVDJ965ncJm7 /x6ULR6BEtP0olFfafU/RGyIAZRnL6v1PaGs3Gk+XZexPlevs0hU+PMLGmDb+tBDuk+jNliwSVE 1qNnd7E7c14ZhG/H5+NPexnNLlvxFKvloPI7utT1w7OxVCQiH6CfURXBEE+nckgOoLKz9yBTCTy et9elPIRzyCg64zwqo3Ntc0UJp7twMdmHQVmFTLqCquksB9J3OdRjfHzHUoS29/TwMVE/d+YF0v XIgaaDG65VaDU4kgWDabI2hKJuM0vg== X-Proofpoint-GUID: iPjwVNdzILxibjbeMQwSC_jR-PJ_j2a9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-10-31_05,2025-10-29_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2510310144 Content-Type: text/plain; charset="utf-8" Add support for adl8113 10MHz to 12GHz Low Noise Amplifier with 10MHz to 14GHz bypass switches. Signed-off-by: Antoniu Miclaus --- drivers/iio/amplifiers/Kconfig | 12 ++ drivers/iio/amplifiers/Makefile | 1 + drivers/iio/amplifiers/adl8113.c | 235 +++++++++++++++++++++++++++++++ 3 files changed, 248 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. =20 +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/Makef= ile 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) +=3D ad8366.o obj-$(CONFIG_ADA4250) +=3D ada4250.o +obj-$(CONFIG_ADL8113) +=3D adl8113.o obj-$(CONFIG_HMC425) +=3D hmc425a.o diff --git a/drivers/iio/amplifiers/adl8113.c b/drivers/iio/amplifiers/adl8= 113.c new file mode 100644 index 000000000000..4a05c1497913 --- /dev/null +++ b/drivers/iio/amplifiers/adl8113.c @@ -0,0 +1,235 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ADL8113 Low Noise Amplifier with integrated bypass switches + * + * Copyright 2025 Analog Devices Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum adl8113_mode { + ADL8113_INTERNAL_AMPLIFIER, + ADL8113_INTERNAL_BYPASS, + ADL8113_EXTERNAL_BYPASS_A, + ADL8113_EXTERNAL_BYPASS_B +}; + +struct adl8113_state { + struct mutex lock; /* protect sensor state */ + struct gpio_desc *gpio_va; + struct gpio_desc *gpio_vb; + enum adl8113_mode current_mode; +}; + +static const char * const adl8113_supply_names[] =3D { + "vdd1", + "vdd2", + "vss2" +}; + +static const char * const adl8113_mode_names[] =3D { + [ADL8113_INTERNAL_AMPLIFIER] =3D "internal_amplifier", + [ADL8113_INTERNAL_BYPASS] =3D "internal_bypass", + [ADL8113_EXTERNAL_BYPASS_A] =3D "external_bypass_a", + [ADL8113_EXTERNAL_BYPASS_B] =3D "external_bypass_b", +}; + +static int adl8113_set_mode(struct adl8113_state *st, enum adl8113_mode mo= de) +{ + 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 =3D mode; + return 0; +} + +static int adl8113_get_mode(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan) +{ + struct adl8113_state *st =3D 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 =3D iio_priv(indio_dev); + int ret; + + if (mode >=3D ARRAY_SIZE(adl8113_mode_names)) + return -EINVAL; + + mutex_lock(&st->lock); + ret =3D adl8113_set_mode(st, mode); + mutex_unlock(&st->lock); + + return ret; +} + +static const struct iio_enum adl8113_mode_enum =3D { + .items =3D adl8113_mode_names, + .num_items =3D ARRAY_SIZE(adl8113_mode_names), + .get =3D adl8113_get_mode, + .set =3D adl8113_set_mode_enum, +}; + +static const struct iio_chan_spec_ext_info adl8113_ext_info[] =3D { + 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[] =3D { + { + .type =3D IIO_VOLTAGE, + .info_mask_shared_by_type =3D BIT(IIO_CHAN_INFO_HARDWAREGAIN), + .indexed =3D 1, + .channel =3D 0, + .ext_info =3D 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 =3D iio_priv(indio_dev); + int ret; + + switch (mask) { + case IIO_CHAN_INFO_HARDWAREGAIN: + mutex_lock(&st->lock); + switch (st->current_mode) { + case ADL8113_INTERNAL_AMPLIFIER: + *val =3D 14; + *val2 =3D 0; + ret =3D IIO_VAL_INT_PLUS_MICRO_DB; + break; + case ADL8113_INTERNAL_BYPASS: + case ADL8113_EXTERNAL_BYPASS_A: + case ADL8113_EXTERNAL_BYPASS_B: + *val =3D 0; + *val2 =3D 0; + ret =3D IIO_VAL_INT_PLUS_MICRO_DB; + break; + default: + ret =3D -EINVAL; + } + mutex_unlock(&st->lock); + return ret; + default: + return -EINVAL; + } +} + +static const struct iio_info adl8113_info =3D { + .read_raw =3D adl8113_read_raw, +}; + +static int adl8113_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct adl8113_state *st; + struct iio_dev *indio_dev; + u32 initial_mode =3D ADL8113_INTERNAL_AMPLIFIER; + int ret; + + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*st)); + if (!indio_dev) + return -ENOMEM; + + st =3D iio_priv(indio_dev); + mutex_init(&st->lock); + + st->gpio_va =3D 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 =3D 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 =3D devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(adl8113_supply_nam= es), + adl8113_supply_names); + if (ret) + return dev_err_probe(dev, ret, + "failed to get and enable supplies\n"); + + device_property_read_u32(dev, "adi,initial-mode", &initial_mode); + if (initial_mode >=3D ARRAY_SIZE(adl8113_mode_names)) + return -EINVAL; + + ret =3D adl8113_set_mode(st, initial_mode); + if (ret) + return ret; + + indio_dev->info =3D &adl8113_info; + indio_dev->name =3D "adl8113"; + indio_dev->channels =3D adl8113_channels; + indio_dev->num_channels =3D ARRAY_SIZE(adl8113_channels); + indio_dev->modes =3D INDIO_DIRECT_MODE; + + ret =3D devm_iio_device_register(dev, indio_dev); + if (ret) + return ret; + + dev_info(dev, "ADL8113 registered, initial mode: %s\n", + adl8113_mode_names[initial_mode]); + + return 0; +} + +static const struct of_device_id adl8113_of_match[] =3D { + { .compatible =3D "adi,adl8113" }, + {} +}; +MODULE_DEVICE_TABLE(of, adl8113_of_match); + +static struct platform_driver adl8113_driver =3D { + .driver =3D { + .name =3D "adl8113", + .of_match_table =3D adl8113_of_match, + }, + .probe =3D adl8113_probe, +}; + +module_platform_driver(adl8113_driver); + +MODULE_AUTHOR("Antoniu Miclaus "); +MODULE_DESCRIPTION("Analog Devices ADL8113 Low Noise Amplifier"); +MODULE_LICENSE("GPL"); --=20 2.43.0 From nobody Sun Feb 8 09:22:52 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CF282F5328; Fri, 31 Oct 2025 16:04:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926681; cv=none; b=OFqNYcNA7SCot1kk3PewjMF5SYJos74d4eoeRI1bAocI2Ajms2BWuxPO8QQPI29h8p+dYVAkNtx+px1u2Kj631UJTtYOYdZ5YPSTjNTUTRPc9OL8PuTEgOTc+794fgQMdZv56zO2A51w881OWxOCj4y1o8muRQQi7qyZ10FFcGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926681; c=relaxed/simple; bh=5nJubTjjNG9NKAIGiUGcTFQ2vFJbo2q8cvOpWG0OPwM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n3qP/yJF7JUFGVfqP/r6XQs+4ng2Z9hMgHD3ijdG/yNNHWatZmfiJ5LqVQQ8faE8XNFXwGowQCKSXcZ69Fc/BqN7MXf9z8b5oOuTvoc73OYJl9oerPI1ZeSmDu1l6M5WGSqUM5Yc6/mB9YHv1YWWe48hn6pgDId0VTk5D+ulXZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=iKRIkobG; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="iKRIkobG" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 59VFFuAe2389589; Fri, 31 Oct 2025 12:04:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=ACaFc ZXW4lsjQ8W8UsFyNwiqNeeTdM/FeLiR7V0spOw=; b=iKRIkobGSSDmFtCB54R1R Sck8Vuj2cAP8qd2TOUqr439TC2MZcdestkVISzTLNshgSj5pidU2pAGX8A23Xjz3 AD6KRNpoeKWKdcTqWF2DfljFznhv4KdVq6IS8+0Ks16cjxfEZmFfRKGVz5IDSWUv uLryonr7Sap0bmNrq0FM0yVZaQJS0J8M4yq73dzo7P65WYQsVQrJkBUPmkHmJ4Uh QrfysHXH26u/Z5DgQ4YQUwUWmLKgcOGHIZDdP7Y8CmrWBt5cEoAhMutjcBqxYXn+ 2Orxc86jUGS/egwS3PoR+mumn6SmVJF5u66ie6Q6wMNTMKVisUTnaEKI3MTtsjeM w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4a4yktg8ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Oct 2025 12:04:35 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 59VG4YDi064378 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2025 12:04:34 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 31 Oct 2025 12:04:34 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 31 Oct 2025 12:04:34 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 31 Oct 2025 12:04:34 -0400 Received: from Ubuntu.ad.analog.com ([10.32.15.145]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 59VG4K1N006874; Fri, 31 Oct 2025 12:04:30 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH 3/3] Documentation: ABI: adl8113: add documentation Date: Fri, 31 Oct 2025 16:04:05 +0000 Message-ID: <20251031160405.13286-4-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251031160405.13286-1-antoniu.miclaus@analog.com> References: <20251031160405.13286-1-antoniu.miclaus@analog.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 8EKqH7PB3eWYEbMD1xDhiyoS124djkfp X-Proofpoint-ORIG-GUID: 8EKqH7PB3eWYEbMD1xDhiyoS124djkfp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDMxMDE0NCBTYWx0ZWRfX0t2CdHzunGj8 NAJlkt2w0fVf01hSWFAu0HExgRIvpDp5P1a8PAyMBBFzyW7alcZ+SpKTAFbXpboB5o93KaVv0Ld mqo0PEMSeyGe0Uj1PLgLcWF8NRIjQi0ujm+Em75Xw23Moljq9YNPxcTEiqBX+aKNx/RVBz3y1tY zUtuMdDzwDgoHKcaGwr9vUuyDyOJeVV+vYqVk2pkpqllzn+1IjExi8+B4gmoSTVq/JZXg1D1RpY bgE2d8izXkNQI+zrNDrhmgIBx2MI/NtpPxcpFm1NszewaadO0wdH6Pq6rHalhNWRnBz5V0NsVOm ZkE7BvdIk+JxQM0ZtOgqRd1jt9e6kEzIuZXD9VBiysovUOmEPEY/2PMriq9C2o1awG2LmCVcr47 pHUm0X3LSeEuv2Lqe6MqtzkuGJ/dGQ== X-Authority-Analysis: v=2.4 cv=Uq1u9uwB c=1 sm=1 tr=0 ts=6904de14 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=x6icFKpwvdMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gAnH3GRIAAAA:8 a=VwQbUJbxAAAA:8 a=5ChSaQLCZzwPHQEXt9AA:9 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-10-31_05,2025-10-29_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 spamscore=0 phishscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2510310144 Content-Type: text/plain; charset="utf-8" Add ABI documentation for the ADL8113 Low Noise Amplifier, covering the 4 pin-selectable operating modes. Signed-off-by: Antoniu Miclaus --- .../testing/sysfs-bus-iio-amplifiers-adl8113 | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8= 113 diff --git a/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 b/D= ocumentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 new file mode 100644 index 000000000000..6155b79e6b83 --- /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=3D0, VB=3D0). Provides 14dB gain. + + * internal_bypass - Signal bypasses through internal bypass path + (VA=3D1, VB=3D1). Provides 0dB gain. + + * external_bypass_a - Signal routes through external bypass path A + (VA=3D0, VB=3D1). Provides 0dB gain. + + * external_bypass_b - Signal routes through external bypass path B + (VA=3D1, VB=3D0). 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. --=20 2.43.0