From nobody Sun Feb 8 12:32:17 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 D81C0315D26; Fri, 14 Nov 2025 11:59:04 +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=1763121546; cv=none; b=BP7deuNFN3YuFdEmYySzWSW1qucZBhH7xJ8fdCjwcJxmorjkouK8ViJPbev5vMofU0AV6saSHksD5r23Hdeaz4vhn3EFJ4TQO0OlKAW6RslNhNdU4EBpoeFtsViipZ3ZYQukyiblnVe31ecT1OCA8bD+mzkD6koWugL0j70gDdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763121546; c=relaxed/simple; bh=/cA/XdSGxsW0TXEoARCprt05ZAOkKn5eOCNRG4dittI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JI2bZoraO/L16ZUEFI6t6ehPe3GwGwrmfmYQ2Z/2aryZ6F9mJSzu12qoymUHZPlh/N3IYc56aiVgax/6AiYWOgDfzaPOuJMsthnHR+j9Uu4Hpv+8dd38Uu3/qkbuaZ7UEG3MOsy6W3+0/MvzOEyAl44eaOB7Qu9Fkf8u3UyIdFg= 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=oofDH1OX; 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="oofDH1OX" 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 5AE9nMQq3285328; Fri, 14 Nov 2025 06:59:02 -0500 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=3LjSl i5vUyvXqqEjgijtpPtqffwKzmiVZ1q8xmOZd2s=; b=oofDH1OXqAgshtn6kJnK/ aVV/XW5+m3aYwvxNuatpvHpzaiVaZeww1+eOmBc78wROHsW3ttVpZFcpjXPTNdDH ZEUIjpaQdf+U1WYIeMlLnvuf80XCE10zLD0XNjWAmOb7QFbbSm+XG2ttrx84Ve5/ M1vPXskE43z8ntBBKBeRG3nNJK203krcH6Uk2T6v8lJlLHac14ibab0HVVNtUINa kmqTJ78eTXpb6rfQfhP3ExbEJGJdjRuiAtTwOvq2ODFhVe4kvqCZM5fIi3IfH2AN XQ5Xdeve8jCsDyHnmAci3SNEefU5sGC2PuUvL2vK86SjAOABaAsF5Ph0GcVl+d0Z g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4adr7uud3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Nov 2025 06:59:01 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 5AEBx0Xw044605 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2025 06:59:00 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) 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, 14 Nov 2025 06:59:00 -0500 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, 14 Nov 2025 06:59:00 -0500 Received: from Ubuntu.ad.analog.com ([10.66.6.193]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 5AEBwodh018389; Fri, 14 Nov 2025 06:58:56 -0500 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH v3 1/3] dt-bindings: iio: amplifiers: add adl8113 Date: Fri, 14 Nov 2025 11:57:23 +0000 Message-ID: <20251114115725.5660-2-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251114115725.5660-1-antoniu.miclaus@analog.com> References: <20251114115725.5660-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: a0RgU8YZoVdS87GqFqa0Stqi0eV0cShN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE0MDA5NSBTYWx0ZWRfX9m4r6rM4VIqI //kzDoi4OjX20z9VaxVyd/TbKdCh8Hwvbn7YA4J78pCEFCz8UqFLeBZAu9R7MU92uDxn5v+j9Cu NHt9aGnzdKNOr3EYS7pm9M/1hYD/6RhZjlW16WVeC8PytJLP6F/veepFgme+IOrEq+Zi2yrtOAr aOjw6PI3VQIYjbHrdbyXQag/J6kDmaOZA7NUR+OJtaTLVaVgk+WdAGQdjQPPCvj49Nsl3KV9wm7 QimZqOBhRqrC7w6b8j21CDvwXQLPbXCyIuyFkRQMGylX2p1HAj6TMnJLpaiFlbVnI1wfwqZyVdu 2CjJRbBGfbXpdWYkCgVuXMLjQb622QvjhzDgjVv8Gz+EbkVgKBXUwdZeV6oPV5QzU0zssQnQzw/ tytUGr2IJFtbFFhPj0TZS4+/9nknSw== X-Proofpoint-ORIG-GUID: a0RgU8YZoVdS87GqFqa0Stqi0eV0cShN X-Authority-Analysis: v=2.4 cv=NLTYOk6g c=1 sm=1 tr=0 ts=69171985 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=6UeiqGixMTsA: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-11-14_03,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 clxscore=1015 phishscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511140095 Content-Type: text/plain; charset="utf-8" Add devicetree bindings for adl8113. Signed-off-by: Antoniu Miclaus Reviewed-by: Conor Dooley --- Changes in v3: - Remove extra blank line from YAML file for cleaner formatting --- .../bindings/iio/amplifiers/adi,adl8113.yaml | 64 +++++++++++++++++++ 1 file changed, 64 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..0ad83a01ee37 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/amplifiers/adi,adl8113.yaml @@ -0,0 +1,64 @@ +# 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 from RFIN to OUT_A= and from IN_A to RFOUT + - External Bypass B: VA=3D1, VB=3D0 - 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_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 + +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>; + }; +... --=20 2.43.0 From nobody Sun Feb 8 12:32:17 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 8AEDD309DB4; Fri, 14 Nov 2025 11:59:06 +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=1763121548; cv=none; b=YXVCUoV1r8xA2xyoNCCmx8q/Oa8cWAWw0U9HGiFUTAuru3C3tjD4XKaE5Y8/zus4SjOLM3WxFzESRmvYUSTCOHn0yowAWfnlSW0/UHbodXlTzUilIxzrP9ETPmADj8JZhKqLb5Zofi+m6lCv3v0PwPVqW5/c18dgCcLd5UJCcl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763121548; c=relaxed/simple; bh=yY5+NFuoa4dQGrpHp8S8B6JuVsSyNV7MofF1eDK9AYI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bt8w9wqLo20FVL5VXxtHHl374QxNkLdSdRyZM4XGWdyB9PxjSA3iZ7GWdbiIctzVGEuzYz7U3DLKEC79ARt9M48XDYACib7x1ql81XOPUchv2w8V9YYhZWoDG2+vT3fcoOoJbwN+onGLPapL0QrzbLLGbcrrJ4fb6GxwvoQlf8o= 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=m0IGUP9Q; 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="m0IGUP9Q" 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 5AEADISe182922; Fri, 14 Nov 2025 06:59:04 -0500 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=0smta RxADYyUgby7El4Ufc6SVsESNV2PYpQVpgBXHI8=; b=m0IGUP9QoBojQwsIh5+oA i8DLKSYJSHrP4uJuyMKl2XEqlSKMou2qoGBQcjwR9jswEmFvyFvFlG4QpQlbuxKD PbYT/dE+NnghcUN+t5q5BYR+E3bZ+zoOHHU8e0Fr0gxO5ntnAKl3X7nf3FIJr0OY 2bu/QWCKHyRMobEfCYnmMDCbjL6rWDhPuFZ8mBzI6tsomRI7mCGlsLR1Fa738z8y Eag6yNYRjCp4oZhmE7rb6f+mJqHkbb0LwUsDpDWju/Kcmr+2aFphf76ECjgej9b5 wEIDRUz5AqLMZGXny16Qy446rJLIEoYAXhWk83QUf48fWtlmdlMQ3+OjEZ6Lqtnl A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4ady1fhdjx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Nov 2025 06:59:03 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 5AEBx2CF044608 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2025 06:59:02 -0500 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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, 14 Nov 2025 06:59:02 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 14 Nov 2025 06:59:02 -0500 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, 14 Nov 2025 06:59:02 -0500 Received: from Ubuntu.ad.analog.com ([10.66.6.193]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 5AEBwodi018389; Fri, 14 Nov 2025 06:58:58 -0500 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH v3 2/3] iio: amplifiers: adl8113: add driver support Date: Fri, 14 Nov 2025 11:57:24 +0000 Message-ID: <20251114115725.5660-3-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251114115725.5660-1-antoniu.miclaus@analog.com> References: <20251114115725.5660-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=YcywJgRf c=1 sm=1 tr=0 ts=69171987 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gAnH3GRIAAAA:8 a=1dhURQ85q9Mw_Kxh2T0A:9 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-ORIG-GUID: adLy2muIFh2VEvzhHKZocGT3gDdFvNEH X-Proofpoint-GUID: adLy2muIFh2VEvzhHKZocGT3gDdFvNEH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE0MDA5NSBTYWx0ZWRfX5HsBRyzowmfu BvW99MJf+sPsE5joCRRtwgzeNWwh/3UWbsQkvdakpJCp4jZb9XaRK/PPaoa4SgRJZ2OfW0gjshw 6k36eJoLcoXBmL1cASCt2jjE5hWW9ChFtYAXzV8eYMEa5gcSR8AUxvIdEq2HkH8jFvBfqCBwETD S4E1SinRL7ijN/+QxQG0n5CF27+iBvcPyM5ol6FCcngO5+G/RqjN7cNNh8N0bDZZs1MKhlMUzga TH/L+XqE4xaMzZjI8i0dYXhVruUZrItGuJZ3prWKlS2lsFUsgevWEYSp1UOwrT9aO+SPcc3QEka lHCKXw3TBiDlBCbkE7NzF5cG+0a60HmE2qtTQhOHFhA9Zs6kgbJx8nArvvkD5JHVcd3wduWxtIG dlt0jwn4GLECuzJCrGPcoBj+FehEaQ== 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-11-14_03,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511140095 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 --- Changes in v3: - Major architecture refactor: separate gain mode and signal path controls - Replace single "mode" enum with separate gain_mode and signal_path enums - Add write_raw support for IIO_CHAN_INFO_HARDWAREGAIN to control amplifier= (14dB) vs bypass (0dB) - Replace mode attribute with signal_path attribute for controlling routing - Automatically enforce constraints: external paths require bypass mode - Remove linux/iio/sysfs.h include (no longer needed) - Add comprehensive GPIO state validation in adl8113_update_gpio() - Enhance error handling with proper -EINVAL returns for invalid combinatio= ns --- drivers/iio/amplifiers/Kconfig | 12 ++ drivers/iio/amplifiers/Makefile | 1 + drivers/iio/amplifiers/adl8113.c | 252 +++++++++++++++++++++++++++++++ 3 files changed, 265 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..155291f4ec89 --- /dev/null +++ b/drivers/iio/amplifiers/adl8113.c @@ -0,0 +1,252 @@ +// 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 + +enum adl8113_gain_mode { + ADL8113_AMPLIFIER, + ADL8113_BYPASS, +}; + +enum adl8113_signal_path { + ADL8113_INTERNAL, + ADL8113_EXTERNAL_A, + ADL8113_EXTERNAL_B, +}; + +struct adl8113_state { + struct gpio_desc *gpio_va; + struct gpio_desc *gpio_vb; + enum adl8113_gain_mode gain_mode; + enum adl8113_signal_path signal_path; +}; + +static const char * const adl8113_supply_names[] =3D { + "vdd1", + "vdd2", + "vss2" +}; + +static const char * const adl8113_signal_path_names[] =3D { + [ADL8113_INTERNAL] =3D "internal", + [ADL8113_EXTERNAL_A] =3D "external_a", + [ADL8113_EXTERNAL_B] =3D "external_b", +}; + +static int adl8113_update_gpio(struct adl8113_state *st) +{ + int va, vb; + + /* Determine GPIO values based on gain mode and signal path */ + switch (st->gain_mode) { + case ADL8113_AMPLIFIER: + if (st->signal_path !=3D ADL8113_INTERNAL) + return -EINVAL; + va =3D 0; vb =3D 0; /* Internal amplifier */ + break; + case ADL8113_BYPASS: + switch (st->signal_path) { + case ADL8113_INTERNAL: + va =3D 1; vb =3D 1; /* Internal bypass */ + break; + case ADL8113_EXTERNAL_A: + va =3D 0; vb =3D 1; /* External bypass A */ + break; + case ADL8113_EXTERNAL_B: + va =3D 1; vb =3D 0; /* External bypass B */ + break; + default: + return -EINVAL; + } + break; + default: + return -EINVAL; + } + + gpiod_set_value(st->gpio_va, va); + gpiod_set_value(st->gpio_vb, vb); + return 0; +} + +static int adl8113_get_signal_path(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan) +{ + struct adl8113_state *st =3D iio_priv(indio_dev); + + return st->signal_path; +} + +static int adl8113_set_signal_path(struct iio_dev *indio_dev, + const struct iio_chan_spec *chan, + unsigned int path) +{ + struct adl8113_state *st =3D iio_priv(indio_dev); + + if (path >=3D ARRAY_SIZE(adl8113_signal_path_names)) + return -EINVAL; + + /* External paths require bypass mode, so switch to it automatically */ + if (path !=3D ADL8113_INTERNAL) + st->gain_mode =3D ADL8113_BYPASS; + + st->signal_path =3D path; + return adl8113_update_gpio(st); +} + +static const struct iio_enum adl8113_signal_path_enum =3D { + .items =3D adl8113_signal_path_names, + .num_items =3D ARRAY_SIZE(adl8113_signal_path_names), + .get =3D adl8113_get_signal_path, + .set =3D adl8113_set_signal_path, +}; + +static const struct iio_chan_spec_ext_info adl8113_ext_info[] =3D { + IIO_ENUM("signal_path", IIO_SHARED_BY_ALL, &adl8113_signal_path_enum), + IIO_ENUM_AVAILABLE("signal_path", IIO_SHARED_BY_ALL, + &adl8113_signal_path_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); + + switch (mask) { + case IIO_CHAN_INFO_HARDWAREGAIN: + if (st->gain_mode =3D=3D ADL8113_AMPLIFIER) { + /* Amplifier mode: 14dB gain */ + *val =3D 14; + *val2 =3D 0; + return IIO_VAL_INT_PLUS_MICRO_DB; + } + + /* Bypass mode: 0dB gain */ + *val =3D 0; + *val2 =3D 0; + return IIO_VAL_INT_PLUS_MICRO_DB; + default: + return -EINVAL; + } +} + +static int adl8113_write_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); + + switch (mask) { + case IIO_CHAN_INFO_HARDWAREGAIN: + /* Accept dB values: 0dB (bypass) or 14dB (amplifier) */ + if (val =3D=3D 0 && val2 =3D=3D 0) { + st->gain_mode =3D ADL8113_BYPASS; + } else if (val =3D=3D 14 && val2 =3D=3D 0) { + st->gain_mode =3D ADL8113_AMPLIFIER; + /* Force internal path for amplifier mode */ + st->signal_path =3D ADL8113_INTERNAL; + } else { + return -EINVAL; + } + return adl8113_update_gpio(st); + default: + return -EINVAL; + } +} + +static const struct iio_info adl8113_info =3D { + .read_raw =3D adl8113_read_raw, + .write_raw =3D adl8113_write_raw, +}; + +static int adl8113_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct adl8113_state *st; + struct iio_dev *indio_dev; + int ret; + + indio_dev =3D devm_iio_device_alloc(dev, sizeof(*st)); + if (!indio_dev) + return -ENOMEM; + + st =3D iio_priv(indio_dev); + + 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_names), + adl8113_supply_names); + if (ret) + return dev_err_probe(dev, ret, + "failed to get and enable supplies\n"); + + /* Initialize to amplifier mode with internal path */ + st->gain_mode =3D ADL8113_AMPLIFIER; + st->signal_path =3D ADL8113_INTERNAL; + ret =3D adl8113_update_gpio(st); + 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; + + return devm_iio_device_register(dev, indio_dev); +} + +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 12:32:17 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 AD3F13164BD; Fri, 14 Nov 2025 11:59:07 +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=1763121549; cv=none; b=C84L9/ZccQL2f8RetmvpEhX2XTB9iy6za/X2AYdoMiIbln0WNeVz6JEBv7opYphrTJyFoV4dZWbpgO0J/DDY7jg5HuzaymG6eYC83+XRTMeHt+Ut6W9dKJ/xiperqpi6QhSHhg5mdKysuHBJJz3R0DTuRoXvatCIT4D3xM/0VDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763121549; c=relaxed/simple; bh=chS5KKJaPztbPdIXVZ5m62FYLu/JYz0ViEuZQ1U7lpE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I4Zp3LybJD0a1l7DWgPPHN+SZbSwahjmPhjQbuzT+5PzSsqLeWqRo8ZrkG4qbBwUrxf07ekL7Jd4bsG5Ag3td/XAf3DjPIzPRyPKOdLBNdQ/6o/hfa/SHlW48PVYNSU5BDg5ZVeqfOO3oDwMMgEF6UQrDCHMurMe8WsPwpA0wkg= 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=FK7LCx1L; 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="FK7LCx1L" 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 5AEAtU9u3284412; Fri, 14 Nov 2025 06:59:05 -0500 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=U9e02 7WOgqVWc/VJc/EDU47B3+WLKgCwbm4urOldRrg=; b=FK7LCx1LlRaFimQdUvRKK WXse57MfzhtI22UM2LDdSIKtXs9lDqW6rh7gor95w47vYylvwRietIxtx4RYsPVB v9WuVyuGkN942Z3aondcbSWJZBLHjpgKIeS+17wZ+N32MNn7z2dYo6weOvSl6Zdp VOz/gUecEk6WcO2ZQVSDVK31wwvjJ9C6uyoBzxPizkAsPK57tnpZyEq/fDPZoapz cm4Gp/SmWXisxtdCUE1HJo8RUCVzyH/W8F3rQTj1w9ERbifwQ3wbhmgQV87J+Jjo a2qFBTkjQ3uZvVIKSYgPsbDoGyJkmz8nqnJyxESwkPQMol1wRnCXkJaN1s0LI02z g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4adr7uud3n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Nov 2025 06:59:05 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 5AEBx45m044611 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2025 06:59:04 -0500 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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, 14 Nov 2025 06:59:04 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 14 Nov 2025 06:59:04 -0500 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, 14 Nov 2025 06:59:03 -0500 Received: from Ubuntu.ad.analog.com ([10.66.6.193]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 5AEBwodj018389; Fri, 14 Nov 2025 06:59:00 -0500 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH v3 3/3] Documentation: ABI: adl8113: add documentation Date: Fri, 14 Nov 2025 11:57:25 +0000 Message-ID: <20251114115725.5660-4-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251114115725.5660-1-antoniu.miclaus@analog.com> References: <20251114115725.5660-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: 5QGvq9z8D9ZEh5lq1C2s-HjNG7ObN2n5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE0MDA5NSBTYWx0ZWRfX0xTt/sJyG1Yw T0/LDFCYabcYP9wenlX8Cq1NnMVuFq6uyYmgeZefWMKEY1QsX+uggW394OS2YNkojDGldhEWoZ9 RXi2tjpLKbbdPSOExGsbRTlOEFe/Dhgn0q6h1Xggb/8SjGpHOHUkXMZUXxYYh0fpn6fGL6lBu+y 1R4w9ANmgZCd0vpqhLKJXRB4Z68Atxta+GhfwvT8/jaGFlkTIbuQ7oSjgDN1U2eUfjl5+wA0LiI f44NKrDTbaSBJGA4KSvgPDWBMGLghQOpnKL9YIL6v62L3RtBpBmIwM2Own2An9J4S5OpNiFKGiY I92OvGPvg8g6TrTDz7TBXV7vR79iWss6zmTGmMwZWFZeEZqxPtwhM271RtP4Agp5Ig+o2id5LzU ljWngt2PXqQY9AROa53P0nk5lzdC+w== X-Proofpoint-ORIG-GUID: 5QGvq9z8D9ZEh5lq1C2s-HjNG7ObN2n5 X-Authority-Analysis: v=2.4 cv=NLTYOk6g c=1 sm=1 tr=0 ts=69171989 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gAnH3GRIAAAA:8 a=VwQbUJbxAAAA:8 a=V4WCqAB441VHpSYF5VcA: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-11-14_03,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=0 clxscore=1015 phishscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511140095 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 --- Changes in v3: - Replace "mode" attribute documentation with "signal_path" attribute - Update descriptions to reflect separation of gain control (hardwaregain) = and path control (signal_path) - Add explanation of automatic bypass mode switching when selecting externa= l paths - Update attribute names from mode/mode_available to signal_path/signal_pat= h_available - Clarify that external paths enable connection of external components for = filtering or amplification --- .../testing/sysfs-bus-iio-amplifiers-adl8113 | 30 +++++++++++++++++++ 1 file changed, 30 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..31fb1e6e80fc --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-iio-amplifiers-adl8113 @@ -0,0 +1,30 @@ +What: /sys/bus/iio/devices/iio:deviceX/signal_path +Date: January 2025 +KernelVersion: 6.14 +Contact: linux-iio@vger.kernel.org +Description: + This attribute controls the signal routing path for the ADL8113 + Low Noise Amplifier. The supported signal paths are: + + * internal - Signal passes through internal path. Can be used with + either amplifier mode (14dB gain) or bypass mode (0dB gain). + + * external_a - Signal routes from RFIN to OUT_A and from IN_A to RFOUT + (VA=3D0, VB=3D1). External components can be connected for filtering or + additional amplification. Automatically switches to bypass mode (0dB). + + * external_b - Signal routes from RFIN to OUT_B and from IN_B to RFOUT + (VA=3D1, VB=3D0). External components can be connected for filtering or + additional amplification. Automatically switches to bypass mode (0dB). + + Note: Selecting an external path automatically sets the hardware gain + to 0dB (bypass mode) since external paths require bypass operation. + +What: /sys/bus/iio/devices/iio:deviceX/signal_path_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 signal paths for the ADL8113 device. The available paths + may depend on the current gain mode (hardwaregain setting). --=20 2.43.0