From nobody Sun Feb 8 11:22:02 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 E03C92D9499; Tue, 7 Oct 2025 11:15:59 +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=1759835761; cv=none; b=E7zRbPzWkfLNhDbUYK5dsxTavgTsYDO3//MQZCYR/e/RuvBQdlziOJowm8c4iNYSZ47/SHFUcBeA/lZklii3+/UfUWtBhfods5u+3P33in1vBHLer/B4X+wHvMVFRVISBrri/5aFOZPVr4eoTr/jBKve09yN2voP1zGOnGP2j0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835761; c=relaxed/simple; bh=IKhGS0A/e8TFGR5npPvfz4zq1/53BcIbt/+BZAsjjUY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iQXfl59filZpskl4sUC4hooZsQg4H5azJ4SzgJycI2DGEXO4MkJfRNikUHO7bmgzYv1tGsf8B69Bpj/uJSvyDCI1yWVIM13loly2QIDOokdbK8JqOzoL/c+mpWL6vpiS3+YIYupzAF4I/ZH/nKN//fMoFZU5bpJjAtvKp39QIh4= 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=R1sipLqg; 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="R1sipLqg" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5978d0RM006443; Tue, 7 Oct 2025 07:15:57 -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=xoOo7 WBzjUwhhy1qcVrjGlR8R0wYQnRehdi8XFOqcMA=; b=R1sipLqgwG/BN5UrvMl4s 1/o833nV07G2lWmCobMKSR44KcNqxIPG5zE0UhR/08GkCpIsaYZqKct1y+dWstWC a7Rmg1qXKSvQV5Yz/EvsEgTgd3pZSaIgpi0Ml6wYw+54Zun2vZ66APu/yrmE87RI b1LrbRHpViLc71EHnPDKxQcP7ZeMRQCOVZ6ngGdlCtFagk6AeJJpR5E/k0Rp+Lcw Ogbd+Qh5JLx9YGneJ6zX6GumY1CLkFmFB+/kVULXTQmFQQFByDRFIkXy7iALkt67 /G51ymXnXtG7w/j9MiefH1HCgA5fPLD7EaaT/ssevdnh7r/MlAWqGFKzvOqivCoc Q== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 49myhq8qe9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Oct 2025 07:15:57 -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 597BFu0t058182 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2025 07:15:56 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) 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; Tue, 7 Oct 2025 07:15:56 -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; Tue, 7 Oct 2025 07:15:56 -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 597BFftS006224; Tue, 7 Oct 2025 07:15:50 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus Subject: [PATCH v3 1/6] iio: adc: ad4080: fix chip identification Date: Tue, 7 Oct 2025 11:15:20 +0000 Message-ID: <20251007111525.25711-2-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251007111525.25711-1-antoniu.miclaus@analog.com> References: <20251007111525.25711-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-Spam-Details-Enc: AW1haW4tMjUxMDA3MDA2OCBTYWx0ZWRfXwq84fCBtT3qz QoYzz6DDC+rNGmKr7sDZ/ruAaCICSemwbbR+dOIsnSZxFO2fa+s8cBOVIwuoaiXGOHDX4DoHfa+ llBP9uHX3/hwEIYm6Ku5imKPZKs44Bvz9TY/RUyBGNxQbpvYIgDQwsxXTadBede/T6oLOkVXU9k HYZwcKjuwt8UHeX04WqBcm5TeCn24sc/8mgax8Hmy/yunwUhOjyhsPlF6ghPag1mrDvGxPXJXCc +fe7waT3dm288tP1rTW0PM/p9cwHxVoOQ0ZgSvrGjY3He6tme/twMMf8RreOAb7CGJui4Qd1lkG 5DINDol8qZAIuC860l1DEjJKFFLUzdfE67Hj14zuIPuvV7Fb5KzxAmfLSjVnfkgYpOHTRY9EWPV PU4HN4BCYCooyTRnqNPRXIEzBoj4rQ== X-Authority-Analysis: v=2.4 cv=IdOKmGqa c=1 sm=1 tr=0 ts=68e4f66d cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=x6icFKpwvdMA:10 a=gAnH3GRIAAAA:8 a=91vjMLyKW-Pj1BGKmtEA:9 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: LDvMijKMqHwi52RIej0LxKW-7HqoW6n9 X-Proofpoint-ORIG-GUID: LDvMijKMqHwi52RIej0LxKW-7HqoW6n9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-06_07,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 clxscore=1015 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2510070068 Content-Type: text/plain; charset="utf-8" Fix AD4080 chip identification by using the correct 16-bit product ID (0x0050) instead of GENMASK(2, 0). Update the chip reading logic to use regmap_bulk_read to read both PRODUCT_ID_L and PRODUCT_ID_H registers and combine them into a 16-bit value. The original implementation was incorrectly reading only 3 bits, which would not correctly identify the AD4080 chip. Fixes: 6b31ba1811b6 ("iio: adc: ad4080: add driver support") Signed-off-by: Antoniu Miclaus Reviewed-by: Nuno S=C3=A1 --- changes in v3: - use le16_to_cpu to convert the read little-endian value to CPU endianness drivers/iio/adc/ad4080.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c index 6e61787ed321..ae5a975a47a5 100644 --- a/drivers/iio/adc/ad4080.c +++ b/drivers/iio/adc/ad4080.c @@ -125,7 +125,7 @@ =20 /* Miscellaneous Definitions */ #define AD4080_SPI_READ BIT(7) -#define AD4080_CHIP_ID GENMASK(2, 0) +#define AD4080_CHIP_ID 0x0050 =20 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 =20 @@ -445,7 +445,8 @@ static int ad4080_setup(struct iio_dev *indio_dev) { struct ad4080_state *st =3D iio_priv(indio_dev); struct device *dev =3D regmap_get_device(st->regmap); - unsigned int id; + __le16 id_le; + u16 id; int ret; =20 ret =3D regmap_write(st->regmap, AD4080_REG_INTERFACE_CONFIG_A, @@ -458,10 +459,11 @@ static int ad4080_setup(struct iio_dev *indio_dev) if (ret) return ret; =20 - ret =3D regmap_read(st->regmap, AD4080_REG_CHIP_TYPE, &id); + ret =3D regmap_bulk_read(st->regmap, AD4080_REG_PRODUCT_ID_L, &id_le, 2); if (ret) return ret; =20 + id =3D le16_to_cpu(id_le); if (id !=3D AD4080_CHIP_ID) dev_info(dev, "Unrecognized CHIP_ID 0x%X\n", id); =20 --=20 2.43.0 From nobody Sun Feb 8 11:22:02 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 E043C2D94B5; Tue, 7 Oct 2025 11:15:59 +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=1759835761; cv=none; b=uPRnlr1lggxDPQNrK+kx7jrZj2CX84/W5YN70TjDRg/YPCtMSJqpjDiECNaq6gzf/C//poq+8yOp3iGXlzu7/q/F5ZM+R2Iz0EFPK+BU3a7m04ZWV681Cdodol3rKUpQb4X2ab91DX7JKevd8Mk3+FLAbsC2LVH3mraLy5l/ATQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835761; c=relaxed/simple; bh=Y6SUc1edRPUHtAZwrtsFW6hLf36+mw3tXxySYcCT1Hc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rpRfgW+DhfeTe1WbZ+jZg6g/nVHHYOcRFs1mDxjUUCy+dTvqM1txHHGVmRvTXd8VbMTr5k2UYbrLCgF+2fBbcl0snh7EmhLtCZPY5cNfLf6AT5/829jdLOo18Qo5T7/rCLSWmv/rW4I/MVjm3avgqJxXRko74Wch6YGIYnS3r3o= 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=HG0BzKN9; 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="HG0BzKN9" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5977w2ML010600; Tue, 7 Oct 2025 07:15:57 -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=jRW8V ii+Y6/3vQPsiswGVmgkEgtnObUQut6OYHLfFEQ=; b=HG0BzKN9m0kQmZzCRp4w5 If3hm7RAL7wuM6aKEAdfqUd4j0ub+gLAG4eEI19bPzsiP6RH+L3+4GIyluqG//Gb xdVBfjIf0vErgXX4vNAiwCFMCCW2jy8Ks4Hy7g3arRnR3Z4Z2JX8Bl2iKHXq9WuG 7laqYcwqD6aB8l6598HELsmf3vGIeeAiIVjtf1NI1cSgZmEC3dGJ5osa9udYO2Mf mcze6kupew3mcP79Jdk8R5Q82nZIwphje7X57/iEv+fLQaSEj2Bycbt1pTMSegHz rzuP+/2yHQNqwt4VvK8Shd7FxeI5zM1JAkM3iKjp8+tmqgEhxulmW54IuRRAitut A== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 49jwe1y7f8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Oct 2025 07:15:57 -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 597BFuZM058176 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2025 07:15:56 -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; Tue, 7 Oct 2025 07:15:55 -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; Tue, 7 Oct 2025 07:15:55 -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; Tue, 7 Oct 2025 07:15:55 -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 597BFftT006224; Tue, 7 Oct 2025 07:15:51 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus , =?UTF-8?q?Nuno=20S=C3=A1?= Subject: [PATCH v3 2/6] iio: adc: ad4080: prepare driver for multi-part support Date: Tue, 7 Oct 2025 11:15:21 +0000 Message-ID: <20251007111525.25711-3-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251007111525.25711-1-antoniu.miclaus@analog.com> References: <20251007111525.25711-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Authority-Analysis: v=2.4 cv=Y7n1cxeN c=1 sm=1 tr=0 ts=68e4f66d cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=gAnH3GRIAAAA:8 a=RVsaI-Iikop_xu5dod0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: BUORRWIGXh_nNL2FJ7XJ2ZHnxzJOGYpm X-Proofpoint-ORIG-GUID: BUORRWIGXh_nNL2FJ7XJ2ZHnxzJOGYpm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDA0MDA0MyBTYWx0ZWRfX2ftiDiBpeDqC bXX9ntcFdJQvfBD69+wShIbFE7WTFVEpICatrQYz/AO+Zhp5h/tQyC1B7ewh1f4idH5HfNYKI76 VTs28bq07EUCLJUHP812g4KS5kspZSQUnP45ssylCBbmzn48l77LluKCZw6TLVg3atYVKHTS5bq /fileSv3NaDYyn8TxzyitE7FLhLloKDYsCMpBY0dpavF43TdImcokpo4Fs99zZ/5hDjZq+i/2eo 0JraWp4l/hEsGalNhfzlu8c6CQLLsasf/UlIw/yR99IcWquNC7KRbeT+x96sMqbB6pAmPoFsDtF RaBhRBfA5PtxclKnSL4eC9Kjf7+a42Dvbas5JReu/CwHqMbX45BzJ+C0DYMbenlW2ZzckpYbbxK dYf8BG0jH9A1soU/YtysRg6+X9LIOg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-06_07,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2510040043 Refactor the ad4080 driver to support multiple ADC variants with different resolution bits and LVDS CNV clock count maximums. Changes: - Add lvds_cnv_clk_cnt_max field to chip_info structure - Create AD4080_CHANNEL_DEFINE macro for variable resolution/storage bits - Make LVDS CNV clock count configurable per chip variant - Use chip_info->product_id for chip identification comparison This prepares the infrastructure for adding support for additional ADC parts with different specifications while maintaining backward compatibility with existing AD4080 functionality. Reviewed-by: Nuno S=C3=A1 Signed-off-by: Antoniu Miclaus --- drivers/iio/adc/ad4080.c | 42 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c index ae5a975a47a5..7231b93821cd 100644 --- a/drivers/iio/adc/ad4080.c +++ b/drivers/iio/adc/ad4080.c @@ -167,6 +167,7 @@ struct ad4080_chip_info { const unsigned int (*scale_table)[2]; const struct iio_chan_spec *channels; unsigned int num_channels; + unsigned int lvds_cnv_clk_cnt_max; }; =20 struct ad4080_state { @@ -414,23 +415,25 @@ static struct iio_chan_spec_ext_info ad4080_ext_info[= ] =3D { { } }; =20 -static const struct iio_chan_spec ad4080_channel =3D { - .type =3D IIO_VOLTAGE, - .indexed =3D 1, - .channel =3D 0, - .info_mask_separate =3D BIT(IIO_CHAN_INFO_SCALE), - .info_mask_shared_by_all =3D BIT(IIO_CHAN_INFO_SAMP_FREQ) | - BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), - .info_mask_shared_by_all_available =3D - BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), - .ext_info =3D ad4080_ext_info, - .scan_index =3D 0, - .scan_type =3D { - .sign =3D 's', - .realbits =3D 20, - .storagebits =3D 32, - }, -}; +#define AD4080_CHANNEL_DEFINE(bits, storage) { \ + .type =3D IIO_VOLTAGE, \ + .indexed =3D 1, \ + .channel =3D 0, \ + .info_mask_separate =3D BIT(IIO_CHAN_INFO_SCALE), \ + .info_mask_shared_by_all =3D BIT(IIO_CHAN_INFO_SAMP_FREQ) | \ + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ + .info_mask_shared_by_all_available =3D \ + BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ + .ext_info =3D ad4080_ext_info, \ + .scan_index =3D 0, \ + .scan_type =3D { \ + .sign =3D 's', \ + .realbits =3D (bits), \ + .storagebits =3D (storage), \ + }, \ +} + +static const struct iio_chan_spec ad4080_channel =3D AD4080_CHANNEL_DEFINE= (20, 32); =20 static const struct ad4080_chip_info ad4080_chip_info =3D { .name =3D "ad4080", @@ -439,6 +442,7 @@ static const struct ad4080_chip_info ad4080_chip_info = =3D { .num_scales =3D ARRAY_SIZE(ad4080_scale_table), .num_channels =3D 1, .channels =3D &ad4080_channel, + .lvds_cnv_clk_cnt_max =3D AD4080_LVDS_CNV_CLK_CNT_MAX, }; =20 static int ad4080_setup(struct iio_dev *indio_dev) @@ -464,7 +468,7 @@ static int ad4080_setup(struct iio_dev *indio_dev) return ret; =20 id =3D le16_to_cpu(id_le); - if (id !=3D AD4080_CHIP_ID) + if (id !=3D st->info->product_id) dev_info(dev, "Unrecognized CHIP_ID 0x%X\n", id); =20 ret =3D regmap_set_bits(st->regmap, AD4080_REG_GPIO_CONFIG_A, @@ -490,7 +494,7 @@ static int ad4080_setup(struct iio_dev *indio_dev) AD4080_REG_ADC_DATA_INTF_CONFIG_B, AD4080_ADC_DATA_INTF_CONFIG_B_LVDS_CNV_CLK_CNT_MSK, FIELD_PREP(AD4080_ADC_DATA_INTF_CONFIG_B_LVDS_CNV_CLK_CNT_MSK, - AD4080_LVDS_CNV_CLK_CNT_MAX)); + st->info->lvds_cnv_clk_cnt_max)); if (ret) return ret; =20 --=20 2.43.0 From nobody Sun Feb 8 11:22:02 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 B52562DC32C; Tue, 7 Oct 2025 11:16:08 +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=1759835771; cv=none; b=rHRTGm3VWDJsG+ZxSOWvHwKLI14ZHxFCboLnfbpH55Fcqk1bKbpqpNaqnyx6Kza2oO1FJWxpOsgwzzCCXIyWLqQ4QWoPFXPE2XOorazLm7KIPY8jSJmtabKAJ+Ff2p/66jn8Sb9PYb7yZsBY9yilI1FzY31+HHKtPSMb/wTCBCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835771; c=relaxed/simple; bh=/UsxgCS/snPxULF62Fy/IBHq7nunfP8Q2psiFYBfErY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T4GYSKEPRoXogAHtR/EipmE8citzqDpPKpxbYiFtopS9b+8/SQ8H3HgO3Jw//szUr1MYWxNgrGPXRrKxwcAvXcN2fArQUeax0j91LHnMKcXUzjvm5Ci1vT55CYzD/YH6RiOwkl6+EA/CLl8bbMKAb0ap1Kt9K0AVJd3qKJrnGU4= 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=p6HB4R+n; 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="p6HB4R+n" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5977w2MQ010600; Tue, 7 Oct 2025 07:16:04 -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=9HiDi rBOrmGdTdeWTvi0ZtGFhWkvhbr0npmy2Mg6gsw=; b=p6HB4R+nrRUnzfBjMKXR6 2lRpdyO2jMXdkRsiPzWQX6dTzlxpf1CJb3+oST24SdqNnZkyAWdsb2kxMSI9fKVt eUZ278vbD29AL4ePgANtFrtJOX8JmOl5ZnXMYT6mv6BQlTCCx1zR5G8UKxjNV54a 5Php/6NPKxTK7zlSh2Ve90BxtAtqoCfZhYEGpmf8kwcH2Y9nTwrTyntC04R1kieE lFHOV0KwNoUztlIc/wRhLu77WlsqVlL0mtpGuGyB0XUTzseKD8hKd8ZSCrPAitRS lU2Yi+oWwS0K4uRAmu9h+EHnD2G7E5h/KZkahLHfgJMl+pIImfjT2u473V3QQCht Q== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 49jwe1y7g1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Oct 2025 07:16:04 -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 597BG3VU058211 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2025 07:16:03 -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; Tue, 7 Oct 2025 07:16:03 -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; Tue, 7 Oct 2025 07:16:01 -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; Tue, 7 Oct 2025 07:16:01 -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 597BFftU006224; Tue, 7 Oct 2025 07:15:53 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus , Conor Dooley Subject: [PATCH v3 3/6] dt-bindings: iio: adc: adi,ad4080: add support for AD4084 Date: Tue, 7 Oct 2025 11:15:22 +0000 Message-ID: <20251007111525.25711-4-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251007111525.25711-1-antoniu.miclaus@analog.com> References: <20251007111525.25711-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=Y7n1cxeN c=1 sm=1 tr=0 ts=68e4f674 cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=x6icFKpwvdMA:10 a=XYAwZIGsAAAA:8 a=gAnH3GRIAAAA:8 a=oP9NV9ZnaF3-ZFNN28cA:9 a=E8ToXWR_bxluHZ7gmE-Z:22 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: 0CY2D0YE1lu6q6ruAvJAy5mUxOoFnBJq X-Proofpoint-ORIG-GUID: 0CY2D0YE1lu6q6ruAvJAy5mUxOoFnBJq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDA0MDA0MyBTYWx0ZWRfX3fb75uiDKc13 HKywF46V1+cf4TQIse0kuUmggiFVJqehjzbdJRnD32Y63FN7HTOjGNNzy4YPWzMzSSSA9SylbZh LTR1y5sMEPvO56OxdE7IMv53942lpbrlFbUTNMP8xN29/MhRdSodAV3m7pUeI25OjT1r6cIy53g zVc8Sal4sUSUYfPE5BIPAnXwg9vfc3inS0Mn4lzsqm7NNgY5gSEX7fVzA1pCYPNF+fxD7qM43St kabHwLPfs0gCYfuywJfwa3k0xolpWzR6OAQb7tR3kfHgEneDaiD3Un/UbDj3xjePH6XOIqeNSf0 vzwjYszu7QVhQ8XmrlyhfPJ9RjC08JfRjir8bGMc0aGjxjxEWBtfDolKdq9diUS0UFsCa1X1PcX o7sLkHaMzz2SDs6lhg7TXw40agxSWw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-06_07,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 adultscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2510040043 Content-Type: text/plain; charset="utf-8" Add device tree binding support for the AD4084 16-bit SAR ADC. Add adi,ad4084 to the compatible enum. A fallback compatible string to adi,ad4080 is not appropriate as the AD4084 has different resolution (16-bit vs 20-bit) and LVDS CNV clock count maximum (2 vs 7), requiring different driver configuration. Acked-by: Conor Dooley Signed-off-by: Antoniu Miclaus --- Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad4080.yaml index ed849ba1b77b..c4c5d208f502 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml @@ -26,6 +26,7 @@ properties: compatible: enum: - adi,ad4080 + - adi,ad4084 =20 reg: maxItems: 1 --=20 2.43.0 From nobody Sun Feb 8 11:22:02 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 EF7FE2D9497; Tue, 7 Oct 2025 11:16: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=1759835767; cv=none; b=goroqxzlEoTRzl33G+pL6OPs+HC/2p9IMmJnZmTl1w4a4tysSkWuqA7LdZuK/Kc5eUXEpaeNDEDoKMJyIa9hB6MQMV69CuxFO3AwC/AySW1K1dBU2St48b9QVzE6C6HGP7JYK1Qxh3JIA1aP7+2vAwUiaQz2JKePS7c2itIGLe4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835767; c=relaxed/simple; bh=NdoXbW3w5CoPrO/WzF6G5DDhhncKUPPxcVyycEDOoag=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s3HjH/039ckb6wCvUVhPWX22cpbZ4yGkBpaPPtNFGJ8h7LHUVMKwcvT7bcXnHOhEBUGLa/ZID/1oAngfRTgjQ4od20SyTRyZXfjB3zh7SLi4KHtoPtpvmGc/3si1ZymeOhZR3k+EFflpydCNxKkxLU2eTGX4CFBqutpY197gmfI= 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=VEf/5HP/; 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="VEf/5HP/" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5979plpA010720; Tue, 7 Oct 2025 07:16:03 -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=RfwZE pDpLmpaYXkgieNnSh64amDOTmVaUeOyXE2UBGo=; b=VEf/5HP/926pDdk57+d0T s6cmgYadFGjho4QIaQoIl4vy5VD95HhubBVlCRXnrsCW7v5+C7vEMHrcw+rNLufe XufVheIawZbtSPsBvc3wojsfAI9Ci0naBrVQ9k2VsZBhcXD5qVV9fpZbrgOGjULA FykeCm5rkHXhZ1FtG/5DKEQVh6R7twj1RQ4Kq9aqW9Ub345NMk0QjusOwTze3G7U ZneMuDrgHS+1yuf/ifj3wwtQni30ZzntU7kUlPklS7KD+usBhfXGHKPQCsk445BW gv2jl4lVUXze30wiXgsNMTfuyDzIpfS9ktqmM7jLzeaUQ2CR4VhT+Bk8OzAmc0DH A== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 49jwe1y7fw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Oct 2025 07:16:02 -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 597BG1h9058204 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2025 07:16:01 -0400 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; Tue, 7 Oct 2025 07:16:01 -0400 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) 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; Tue, 7 Oct 2025 07:16:01 -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; Tue, 7 Oct 2025 07:16:01 -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 597BFftV006224; Tue, 7 Oct 2025 07:15:55 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus , =?UTF-8?q?Nuno=20S=C3=A1?= Subject: [PATCH v3 4/6] iio: adc: ad4080: add support for AD4084 Date: Tue, 7 Oct 2025 11:15:23 +0000 Message-ID: <20251007111525.25711-5-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251007111525.25711-1-antoniu.miclaus@analog.com> References: <20251007111525.25711-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Authority-Analysis: v=2.4 cv=Y7n1cxeN c=1 sm=1 tr=0 ts=68e4f672 cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=gAnH3GRIAAAA:8 a=ibccQJ5QWis0U0yrBgcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: iRXpa_fLloHKmTNSb4jSHoCCh-ND4Bh5 X-Proofpoint-ORIG-GUID: iRXpa_fLloHKmTNSb4jSHoCCh-ND4Bh5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDA0MDA0MyBTYWx0ZWRfX+odkweY/jJ5Y PugoyNWjzul6DzbZwH27c+HfaKe3l/6RPMdEdL+Md+r6y3V+KBO/vXxiRlvcs0l+HhIwvvr1afy 0x8DT1CNLCkrRDU/81kMoShm9WbjVkO33dcqZP0wI5+534VhQffk7hjv10YS64J9lcqQ8E3+FhL m0cu4voqcCen8TDVAtjrhzdCoRRwCoLWdcySHvjiSketvjlHViJyapHiB7XKJ7S/Jm2TRXrG/mf Mn0nluw+gsrLN4aGeWSS4dgOURVVvikT9Zm+vuVSmausCE8xQETZByKcdxcOMnAUZzhFY8DBCJn m9TPKHNsEcLra+lgZcUBSVqTXYvvYKkT7Bj2tGg++sG1ShbM91TQ/u79NQPhnRCaMPD3pFcHA+E HpqnIOyiNj3AzfEfT7ZrCHdlsq4Frw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-06_07,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2510040043 Add support for AD4084 16-bit SAR ADC. The AD4084 differs from AD4080 in resolution (16-bit vs 20-bit) and LVDS CNV clock count maximum (2 vs 7). Changes: - Add AD4084_CHIP_ID definition (0x0054) - Create ad4084_channel with 16-bit resolution and storage - Add ad4084_chip_info with appropriate configuration - Register AD4084 in device ID and OF match tables Reviewed-by: Nuno S=C3=A1 Signed-off-by: Antoniu Miclaus --- drivers/iio/adc/ad4080.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c index 7231b93821cd..740176e86657 100644 --- a/drivers/iio/adc/ad4080.c +++ b/drivers/iio/adc/ad4080.c @@ -126,6 +126,7 @@ /* Miscellaneous Definitions */ #define AD4080_SPI_READ BIT(7) #define AD4080_CHIP_ID 0x0050 +#define AD4084_CHIP_ID 0x0054 =20 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 =20 @@ -435,6 +436,8 @@ static struct iio_chan_spec_ext_info ad4080_ext_info[] = =3D { =20 static const struct iio_chan_spec ad4080_channel =3D AD4080_CHANNEL_DEFINE= (20, 32); =20 +static const struct iio_chan_spec ad4084_channel =3D AD4080_CHANNEL_DEFINE= (16, 16); + static const struct ad4080_chip_info ad4080_chip_info =3D { .name =3D "ad4080", .product_id =3D AD4080_CHIP_ID, @@ -445,6 +448,16 @@ static const struct ad4080_chip_info ad4080_chip_info = =3D { .lvds_cnv_clk_cnt_max =3D AD4080_LVDS_CNV_CLK_CNT_MAX, }; =20 +static const struct ad4080_chip_info ad4084_chip_info =3D { + .name =3D "ad4084", + .product_id =3D AD4084_CHIP_ID, + .scale_table =3D ad4080_scale_table, + .num_scales =3D ARRAY_SIZE(ad4080_scale_table), + .num_channels =3D 1, + .channels =3D &ad4084_channel, + .lvds_cnv_clk_cnt_max =3D 2, +}; + static int ad4080_setup(struct iio_dev *indio_dev) { struct ad4080_state *st =3D iio_priv(indio_dev); @@ -599,12 +612,14 @@ static int ad4080_probe(struct spi_device *spi) =20 static const struct spi_device_id ad4080_id[] =3D { { "ad4080", (kernel_ulong_t)&ad4080_chip_info }, + { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, { } }; MODULE_DEVICE_TABLE(spi, ad4080_id); =20 static const struct of_device_id ad4080_of_match[] =3D { { .compatible =3D "adi,ad4080", &ad4080_chip_info }, + { .compatible =3D "adi,ad4084", &ad4084_chip_info }, { } }; MODULE_DEVICE_TABLE(of, ad4080_of_match); --=20 2.43.0 From nobody Sun Feb 8 11:22:02 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 6CAF32D979B; Tue, 7 Oct 2025 11:16:08 +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=1759835769; cv=none; b=Fsaudbt425z45hGfoKDU4VwNLBvj2W8kmZK6ow0LOEnQ06jv8DXhCTCP4vFGwFBq3+BAWN4Tzl43GfdyBCasLpkzDlY2qcDSyouwF1hcDDEHFDN83cl2O3koN/xEtpHXJkeOplR6sbhLS6jBDgY9GlhoPb+jJCanSKlgtJ/u9g8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835769; c=relaxed/simple; bh=jOgDvwSxbvYJ89vK8YrkxDQzRdk6MzF0oeWOEDC0qXU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ugWtU2WXVaMpB1jRdlSTNxzSExv42nf25Nzp7L8/8/tujkKOOT6JpjvSDp5fX3AhNqvICUMzGllYStMM+EplV1gTGsMnFKvXrUMUohdgedheKjCk32VLmCBOEGF9b81kMQ/W1o3Ke1woDcxCOffB8F9ZRUFwail2jYJQCEgmLc8= 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=IcFkSfpD; 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="IcFkSfpD" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5978cxX1006425; Tue, 7 Oct 2025 07:16:05 -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=MiZWZ S4vTjspL484kzVfuKXNQdVXhFW8P1QQ9vuqTNs=; b=IcFkSfpDYr9p7/zyhIMVJ aHYSWVSUOGspI0H2HeTZdiA3uuynjiAjDa1tl47xHwMLtZ0u/PXd862OmMAAfuvx PBJpGxQrN3xkTpP7023btebNFeFiYqXhH5cqdjIdezOKmKxmUkhTbVpZ+nqLPTQP jmwISrVlVoCyOxLUCOlIyS7LoLuxTIss2w7Zfk6iU2OI330UBuRysZ1/M2WpxoFV Qte6Rdd82JYtA+KaL/JFXupwWNl7V9bT/PRwghp2cmGHnwe+jbxAYclmp3RqNH1V 7FUw+N9VVceK5F1RsMDKk7EsJtk9O4798gLaM2WyjDM42RmyBlqJp0ijj/BrS4oY w== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 49myhq8qf7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Oct 2025 07:16:04 -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 597BG3wF058221 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2025 07:16:03 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) 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; Tue, 7 Oct 2025 07:16:03 -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; Tue, 7 Oct 2025 07:16:03 -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 597BFftW006224; Tue, 7 Oct 2025 07:15:57 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus , Conor Dooley Subject: [PATCH v3 5/6] dt-bindings: iio: adc: adi,ad4080: add support for AD4081 Date: Tue, 7 Oct 2025 11:15:24 +0000 Message-ID: <20251007111525.25711-6-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251007111525.25711-1-antoniu.miclaus@analog.com> References: <20251007111525.25711-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-Spam-Details-Enc: AW1haW4tMjUxMDA3MDA2OCBTYWx0ZWRfX/EOQnequk+OU TWPVhxmbbBFZLzQsZEHC61KjqYMAsUG4V8WWRsKQP5TQwg1Y7UYfN4ChA077LhJyLRo3JklCWBL I6g1wSHm/8odGjbucGE924gt+XLghbqwzG0HIhCX963prGkDSk3BfS16FlXu9bdFnpf5hpQFALj sjhhzwDwNeAQZdb9APgbRAtC4dcNnsPG4QZZQvU0zxC+sVBWgsJDZLTR9I2NO7gdYyJg6MDnatE 916et9cnGlLm9DWPHf+ADxqpbgd5RwxsWZ7BKHTukA0tKD+FlGP4i+F60aaF1OZNqPxvIEFq/n2 MscWgW/XozG8CYn1LUbA6L0rN89ca5KjWeniK/0L4/e1dtX7iOck6GmGT4cgMpiAHWA3iu3mosa EgzdjamPqvU4FjB7d+24s/6tK1tmxQ== X-Authority-Analysis: v=2.4 cv=IdOKmGqa c=1 sm=1 tr=0 ts=68e4f674 cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=x6icFKpwvdMA:10 a=XYAwZIGsAAAA:8 a=gAnH3GRIAAAA:8 a=agZHL2U0blbLjZyOsOkA:9 a=E8ToXWR_bxluHZ7gmE-Z:22 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: crBYb_Tqm82ZE3Coh0f0l3LMpEl9NqAl X-Proofpoint-ORIG-GUID: crBYb_Tqm82ZE3Coh0f0l3LMpEl9NqAl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-06_07,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 clxscore=1011 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2510070068 Content-Type: text/plain; charset="utf-8" Add device tree binding support for the AD4081 20-bit SAR ADC. Add adi,ad4081 to the compatible enum. A fallback compatible string to adi,ad4080 is not appropriate as the AD4081 has a different LVDS CNV clock count maximum (2 vs 7), requiring different driver configuration. Acked-by: Conor Dooley Signed-off-by: Antoniu Miclaus --- Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad4080.yaml index c4c5d208f502..a9fa068189ea 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml @@ -26,6 +26,7 @@ properties: compatible: enum: - adi,ad4080 + - adi,ad4081 - adi,ad4084 =20 reg: --=20 2.43.0 From nobody Sun Feb 8 11:22:02 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 2FD392DC353; Tue, 7 Oct 2025 11:16:10 +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=1759835772; cv=none; b=kzlXEEMNocWwvVmDh/f6K398xY0qvHHRrmJHXnJT3EDKZT1KLLorO7jfkHhEG1dIe/muf/XHSpLlHkJMNb3VZD4kLrc+eAdu+azop/AsQ8/K37wL6PWKijBrCmRQZ9yqhnzdFSjL+tjeiL0KBFmzHf5+a7GQrG3+cA2PTXyFp0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835772; c=relaxed/simple; bh=4BPRVIybPN0FhEsNBKBqsBzqNrv5vT4vefr34WGVwiY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MRIUhlO/MXdAKmc3deqUocGEJ64NOub3oEWtyVC3/LqWj5rJOyYhEqzXYn6GcDWK2jIjmNA6w5UQNxJMIqDfQwJLqH0s4y8/OCoww0wH7CrOgvrEbKHEWiq0bOJ6HgmX6b8j3dxEOg8QDe4DypLlAJlzhZqNv23kJeJ/wQwCex0= 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=0+1m3dd0; 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="0+1m3dd0" Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5978cxX3006425; Tue, 7 Oct 2025 07:16:09 -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=pdmPQ Tc0qANVndu/pYEtKyYCa5kJu3YGFw3O32Hr9IE=; b=0+1m3dd0bfdONJYzAaFiC XWVJ2q4XefYsf22nNT7JSKkNZqJEldY/SCLTGrqqQNGhZp7U42n1MfwTSX0W2a3n PjfsqfkKbPO7RdAug+5KWVSZU3M4TVqckSVNMJO0Ro3/nDje0l7VQtJIr47RdVg+ s1Qv8B12C277IkETd8dNXIKZjgROnlVqCgvOivyuvJjPCOiVpIHDOmF7N/7n7VOB vd/Q7k8Czu6E9Mzo4lneX3z5a4NaZ7cep+UmfxLWDvVXHOO53gvBZi1r8WdAk53g 7qwzz0wMQeSES4tlsFHFRpVKpP4BhzukLmYTCJz6cLUoxny4A2WDqMeTpFEVYh6t g== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 49myhq8qfp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Oct 2025 07:16:08 -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 597BG7LS058233 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2025 07:16:07 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) 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; Tue, 7 Oct 2025 07:16:07 -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; Tue, 7 Oct 2025 07:16:07 -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 597BFftX006224; Tue, 7 Oct 2025 07:15:59 -0400 From: Antoniu Miclaus To: , , , , , CC: Antoniu Miclaus , =?UTF-8?q?Nuno=20S=C3=A1?= Subject: [PATCH v3 6/6] iio: adc: ad4080: add support for AD4081 Date: Tue, 7 Oct 2025 11:15:25 +0000 Message-ID: <20251007111525.25711-7-antoniu.miclaus@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251007111525.25711-1-antoniu.miclaus@analog.com> References: <20251007111525.25711-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDA3MDA2OCBTYWx0ZWRfXzg2gSRDUbcTK ge7FGYkeHjfFqBGetRBMalM6q8rTY7432jCPdy87+qE+4lYY6L1kfuhjwW54m9hQPXcyeLeyYSC gsvCdClZFgyNV+39TXF1CzEKNnZYBaPjrhra5xbq22F5kGXpcxnBS0FoBSdObzASSAKzb8nY7x4 HjbLG/Z1kn43A/f6vzaW2yK2S1v/74NVMRnLX55paq4hK22iWv6mRE+vDo8v73XPxWnNeqRYQ1c u5XP90ZsZk8hMTb5OYANi/6oyBw1/v9TItDFkwYyejMxkd/xbsID3YJ1aM5FcYq2LUH7SYy5oao r8O3uO0D2FdCeILHbpcsCgzd045POQuCS1T6B69ZacGxaTEyQHboa/SPjapLnVmXxwh3hXWQwTW 6ClN63IuURuYcD6cj+pFTuKAFDAtNw== X-Authority-Analysis: v=2.4 cv=IdOKmGqa c=1 sm=1 tr=0 ts=68e4f678 cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=IkcTkHD0fZMA:10 a=x6icFKpwvdMA:10 a=gAnH3GRIAAAA:8 a=YQQmArLDnSoWccgIpQ4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-GUID: WnKXJ_rrwa5jc3G4sJdSzSR0dWkQLvwp X-Proofpoint-ORIG-GUID: WnKXJ_rrwa5jc3G4sJdSzSR0dWkQLvwp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-06_07,2025-10-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 clxscore=1015 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2510070068 Add support for AD4081 20-bit SAR ADC. The AD4081 has the same resolution as AD4080 (20-bit) but differs in LVDS CNV clock count maximum (2 vs 7). Changes: - Add AD4081_CHIP_ID definition (0x0051) - Create ad4081_channel with 20-bit resolution and 32-bit storage - Add ad4081_chip_info with lvds_cnv_clk_cnt_max =3D 2 - Register AD4081 in device ID and OF match tables Reviewed-by: Nuno S=C3=A1 Signed-off-by: Antoniu Miclaus --- drivers/iio/adc/ad4080.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c index 740176e86657..6398106da335 100644 --- a/drivers/iio/adc/ad4080.c +++ b/drivers/iio/adc/ad4080.c @@ -126,6 +126,7 @@ /* Miscellaneous Definitions */ #define AD4080_SPI_READ BIT(7) #define AD4080_CHIP_ID 0x0050 +#define AD4081_CHIP_ID 0x0051 #define AD4084_CHIP_ID 0x0054 =20 #define AD4080_LVDS_CNV_CLK_CNT_MAX 7 @@ -436,6 +437,8 @@ static struct iio_chan_spec_ext_info ad4080_ext_info[] = =3D { =20 static const struct iio_chan_spec ad4080_channel =3D AD4080_CHANNEL_DEFINE= (20, 32); =20 +static const struct iio_chan_spec ad4081_channel =3D AD4080_CHANNEL_DEFINE= (20, 32); + static const struct iio_chan_spec ad4084_channel =3D AD4080_CHANNEL_DEFINE= (16, 16); =20 static const struct ad4080_chip_info ad4080_chip_info =3D { @@ -448,6 +451,16 @@ static const struct ad4080_chip_info ad4080_chip_info = =3D { .lvds_cnv_clk_cnt_max =3D AD4080_LVDS_CNV_CLK_CNT_MAX, }; =20 +static const struct ad4080_chip_info ad4081_chip_info =3D { + .name =3D "ad4081", + .product_id =3D AD4081_CHIP_ID, + .scale_table =3D ad4080_scale_table, + .num_scales =3D ARRAY_SIZE(ad4080_scale_table), + .num_channels =3D 1, + .channels =3D &ad4081_channel, + .lvds_cnv_clk_cnt_max =3D 2, +}; + static const struct ad4080_chip_info ad4084_chip_info =3D { .name =3D "ad4084", .product_id =3D AD4084_CHIP_ID, @@ -612,6 +625,7 @@ static int ad4080_probe(struct spi_device *spi) =20 static const struct spi_device_id ad4080_id[] =3D { { "ad4080", (kernel_ulong_t)&ad4080_chip_info }, + { "ad4081", (kernel_ulong_t)&ad4081_chip_info }, { "ad4084", (kernel_ulong_t)&ad4084_chip_info }, { } }; @@ -619,6 +633,7 @@ MODULE_DEVICE_TABLE(spi, ad4080_id); =20 static const struct of_device_id ad4080_of_match[] =3D { { .compatible =3D "adi,ad4080", &ad4080_chip_info }, + { .compatible =3D "adi,ad4081", &ad4081_chip_info }, { .compatible =3D "adi,ad4084", &ad4084_chip_info }, { } }; --=20 2.43.0