From nobody Thu Mar 5 08:46:28 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6C6D93164C2; Mon, 16 Feb 2026 17:10:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771261854; cv=none; b=T/x0ebyD27g4HMRJxShmZ/GsBUXkolLf1osnxwd3bUKBs3Ad5c1Jz3KJDkPWGXO4QH7pj6rxYqvDM1ywmJOt/U80wYNF8kK3lCo1iEmE3ykQgzRLUJoCN6mshaHwLXdhf57SlJx756vQCNftKh1GGtDYnvp7jRpK2jZ8JivH9RU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771261854; c=relaxed/simple; bh=e0IeUiRaVin5omBjuJSDZUirOOK2r3E2elE9nOGlE9U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BTy0F9jcEz6ZaxHHNao5pYvJZXKAmkugTzEJ6OYKO0QU7wWlZ8imjK3L5xdwpg4eappvhKOXFedfPBRfvbiUOX+QFZSQPJRtLh9HQR57adGmgBBpx3dWWLuG6lSA5VxXrNe/ozEyYclZLQFZVlzwO+lNnVxY6fj5jGewhX2VdwQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AyxeSNxQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AyxeSNxQ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3D700C4AF0B; Mon, 16 Feb 2026 17:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771261854; bh=e0IeUiRaVin5omBjuJSDZUirOOK2r3E2elE9nOGlE9U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AyxeSNxQ8UwtUoomR9DuReWBnVu1PHUwdI/VpJnG0hfC43ojMUSTPPPr/+9w4ZqRL Mv2NXWsW8Ih2RXsJvBTXXcoghnoIYSW6ehubF+LxFABilgEL3RvVYOaNsOA+UjYgIK PAW9N4uC2/LCzH0kwwqekcCI6IzQglZs3i08+e6sJBCmNXmVHF3stHbqghnoXcbEKi cIj9eJ33XT6Tly1EBXkJ4+J/PojPafvJv/m4TYSCxYlH6/psdp/mvZm7/6C1dcA9fX +VJBHrF7Ej2yYas2ICUsJtpOWOiI5lkxHCJXaThf9aMdJZFV8hOJLuLiIGAEDjZhNc XdTTwTmLZKlsg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 300EDE81A5B; Mon, 16 Feb 2026 17:10:54 +0000 (UTC) From: Rodrigo Alencar via B4 Relay Date: Mon, 16 Feb 2026 17:10:55 +0000 Subject: [PATCH v5 11/11] iio: amplifiers: ad8366: update device support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260216-iio-ad8366-update-v5-11-7e6091357d02@analog.com> References: <20260216-iio-ad8366-update-v5-0-7e6091357d02@analog.com> In-Reply-To: <20260216-iio-ad8366-update-v5-0-7e6091357d02@analog.com> To: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Michael Hennerich , Lars-Peter Clausen , Jonathan Cameron , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Rodrigo Alencar , Alexandru Ardelean , Andy Shevchenko X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1771261851; l=6757; i=rodrigo.alencar@analog.com; s=default; h=from:subject:message-id; bh=IP0Q14Wu7q7zwFy9Nj6jg6zOD0UoOhkxtbBst3yVtgM=; b=A3+YY8X4cn13eCtaxB/G4oBGtatXQZylFpHWeG9NWFGhG7LCmYQ50UeE9aHAw0mLNTN7WxDw1 BkghbVjuI7xDTPOvNkskVtrvTx0PywSJB090uvucDemK/QFjDv/u41D X-Developer-Key: i=rodrigo.alencar@analog.com; a=ed25519; pk=ULeHbgU/OYh/PG/4anHDfLgldFItQHAhOktYRVLMFRo= X-Endpoint-Received: by B4 Relay for rodrigo.alencar@analog.com/default with auth_id=561 X-Original-From: Rodrigo Alencar Reply-To: rodrigo.alencar@analog.com From: Rodrigo Alencar Add support for the following digital step attenuators: - HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT, 0.7 - 3.7 GHz - ADRF5720: 0.5 dB LSB, 6-Bit, Digital Attenuator, 9 kHz to 40 GHz - ADRF5730: 0.5 dB LSB, 6-Bit, Digital Attenuator, 100 MHz to 40 GHz - ADRF5731: 2 dB LSB, 4-Bit, Digital Attenuator, 100 MHz to 40 GHz - HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz - HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz Additionally, copyright notice was updated with current year. Co-developed-by: Alexandru Ardelean Signed-off-by: Alexandru Ardelean Co-developed-by: Michael Hennerich Signed-off-by: Michael Hennerich Reviewed-by: Andy Shevchenko Signed-off-by: Rodrigo Alencar --- drivers/iio/amplifiers/Kconfig | 6 +++ drivers/iio/amplifiers/ad8366.c | 84 +++++++++++++++++++++++++++++++++++++= +++- 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/drivers/iio/amplifiers/Kconfig b/drivers/iio/amplifiers/Kconfig index a8a604863eed..39d280d4d437 100644 --- a/drivers/iio/amplifiers/Kconfig +++ b/drivers/iio/amplifiers/Kconfig @@ -18,7 +18,13 @@ config AD8366 AD8366 Dual-Digital Variable Gain Amplifier (VGA) ADA4961 BiCMOS RF Digital Gain Amplifier (DGA) ADL5240 Digitally controlled variable gain amplifier (VGA) + ADRF5720: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator + ADRF5730: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator + ADRF5731: 2 dB LSB, 4-Bit, Silicon Digital Attenuator + HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT HMC792A 0.25 dB LSB GaAs MMIC 6-Bit Digital Attenuator + HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT Digital Attenuator + HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT Digital Attenuator HMC1119 0.25 dB LSB, 7-Bit, Silicon Digital Attenuator =20 To compile this driver as a module, choose M here: the diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad836= 6.c index d4499af0518a..334ca91c0f59 100644 --- a/drivers/iio/amplifiers/ad8366.c +++ b/drivers/iio/amplifiers/ad8366.c @@ -5,10 +5,16 @@ * AD8366 Dual-Digital Variable Gain Amplifier (VGA) * ADA4961 BiCMOS RF Digital Gain Amplifier (DGA) * ADL5240 Digitally controlled variable gain amplifier (VGA) + * ADRF5720: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator, 9 kHz to 40 = GHz + * ADRF5730: 0.5 dB LSB, 6-Bit, Silicon Digital Attenuator, 100 MHz to 4= 0 GHz + * ADRF5731: 2 dB LSB, 4-Bit, Silicon Digital Attenuator, 100 MHz to 40 = GHz + * HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT, 0.7 - 3.7 GHz * HMC792A 0.25 dB LSB GaAs MMIC 6-Bit Digital Attenuator + * HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz + * HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz * HMC1119 0.25 dB LSB, 7-Bit, Silicon Digital Attenuator * - * Copyright 2012-2019 Analog Devices Inc. + * Copyright 2012-2026 Analog Devices Inc. */ =20 #include @@ -61,6 +67,20 @@ static size_t ad8366_pack_code(const unsigned char *code= , size_t num_channels, return sizeof(__be16); } =20 +static size_t adrf5731_pack_code(const unsigned char *code, size_t num_cha= nnels, + unsigned char *data) +{ + data[0] =3D code[0] << 2; + return 1; +} + +static size_t hmc271_pack_code(const unsigned char *code, size_t num_chann= els, + unsigned char *data) +{ + data[0] =3D bitrev8(code[0]) >> 3; + return 1; +} + static const struct ad8366_info ad8366_chip_info =3D { .name =3D "ad8366", .gain_min =3D 4500, @@ -86,6 +106,40 @@ static const struct ad8366_info adl5240_chip_info =3D { .num_channels =3D 1, }; =20 +static const struct ad8366_info adrf5720_chip_info =3D { + .name =3D "adrf5720", + .gain_min =3D -31500, + .gain_max =3D 0, + .gain_step =3D -500, + .num_channels =3D 1, +}; + +static const struct ad8366_info adrf5730_chip_info =3D { + .name =3D "adrf5730", + .gain_min =3D -31500, + .gain_max =3D 0, + .gain_step =3D -500, + .num_channels =3D 1, +}; + +static const struct ad8366_info adrf5731_chip_info =3D { + .name =3D "adrf5731", + .gain_min =3D -30000, + .gain_max =3D 0, + .gain_step =3D -2000, + .num_channels =3D 1, + .pack_code =3D adrf5731_pack_code, +}; + +static const struct ad8366_info hmc271_chip_info =3D { + .name =3D "hmc271a", + .gain_min =3D -31000, + .gain_max =3D 0, + .gain_step =3D 1000, + .num_channels =3D 1, + .pack_code =3D hmc271_pack_code, +}; + static const struct ad8366_info hmc792_chip_info =3D { .name =3D "hmc792a", .gain_min =3D -15750, @@ -94,6 +148,22 @@ static const struct ad8366_info hmc792_chip_info =3D { .num_channels =3D 1, }; =20 +static const struct ad8366_info hmc1018_chip_info =3D { + .name =3D "hmc1018a", + .gain_min =3D -31000, + .gain_max =3D 0, + .gain_step =3D 1000, + .num_channels =3D 1, +}; + +static const struct ad8366_info hmc1019_chip_info =3D { + .name =3D "hmc1019a", + .gain_min =3D -15500, + .gain_max =3D 0, + .gain_step =3D 500, + .num_channels =3D 1, +}; + static const struct ad8366_info hmc1119_chip_info =3D { .name =3D "hmc1119", .gain_min =3D -31750, @@ -267,7 +337,13 @@ static const struct spi_device_id ad8366_id[] =3D { { "ad8366", (kernel_ulong_t)&ad8366_chip_info }, { "ada4961", (kernel_ulong_t)&ada4961_chip_info }, { "adl5240", (kernel_ulong_t)&adl5240_chip_info }, + { "adrf5720", (kernel_ulong_t)&adrf5720_chip_info }, + { "adrf5730", (kernel_ulong_t)&adrf5730_chip_info }, + { "adrf5731", (kernel_ulong_t)&adrf5731_chip_info }, + { "hmc271a", (kernel_ulong_t)&hmc271_chip_info }, { "hmc792a", (kernel_ulong_t)&hmc792_chip_info }, + { "hmc1018a", (kernel_ulong_t)&hmc1018_chip_info }, + { "hmc1019a", (kernel_ulong_t)&hmc1019_chip_info }, { "hmc1119", (kernel_ulong_t)&hmc1119_chip_info }, { } }; @@ -277,7 +353,13 @@ static const struct of_device_id ad8366_of_match[] =3D= { { .compatible =3D "adi,ad8366", .data =3D &ad8366_chip_info }, { .compatible =3D "adi,ada4961", .data =3D &ada4961_chip_info }, { .compatible =3D "adi,adl5240", .data =3D &adl5240_chip_info }, + { .compatible =3D "adi,adrf5720", .data =3D &adrf5720_chip_info }, + { .compatible =3D "adi,adrf5730", .data =3D &adrf5730_chip_info }, + { .compatible =3D "adi,adrf5731", .data =3D &adrf5731_chip_info }, + { .compatible =3D "adi,hmc271a", .data =3D &hmc271_chip_info }, { .compatible =3D "adi,hmc792a", .data =3D &hmc792_chip_info }, + { .compatible =3D "adi,hmc1018a", .data =3D &hmc1018_chip_info }, + { .compatible =3D "adi,hmc1019a", .data =3D &hmc1019_chip_info }, { .compatible =3D "adi,hmc1119", .data =3D &hmc1119_chip_info }, { } }; --=20 2.43.0