From nobody Sun Apr 5 13:06:20 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 07E8C3BA225; Tue, 24 Mar 2026 07:14:33 +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=1774336482; cv=none; b=XYyMrjgH6R8xuc4JUDDNu0UiUWGyQUvgJa1VoAF6ta0WvuAqw6DPt6L2v1ZmFtsShgMQRrhw6VumB679tEb7USfBHzfxBfufiDjfPYnMknWe/foSRXy4YG6ZKMsbTZIQmtGvAa3ZF0A0Pf4oCEznymCOSyNrma/KodJN4Yg8g4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774336482; c=relaxed/simple; bh=wN9HE5O+IPyUmehFY9bXGf8km+mj/XuYyBsRnP1EBgI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hm5CLFdafBe9YUPXIhRgwYSsHtkSgeHf1KbkNNZA9fgBMpJCnzwRNvHpkuFTp3Sx4uAOxKwztQMB+62Y18LpZeWvD5Npsn9KvGiTDU9MsRbnhlYSFJyooXXILARr7e13llPeiWtF+MI0S8HBusjMO/qVCmC73U8QMvLCYtB3GrI= 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=q+4rZ3DW; 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="q+4rZ3DW" 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 62O40mw2662592; Tue, 24 Mar 2026 03:14:08 -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=tY6YM xJ4WjG+clpVVwul7m5JoaLSzMSyfjlx4I9sgIM=; b=q+4rZ3DWboYXJia9NJMbU cLQb3N4xP0Z71gQ87YPNYJNark1DTWM/5vdflBFvh8xFGXT5hFsgAShNvrIIgW8d FyzUZqInHZrSb+6s/Ty9Zyp4wudBJyH6hf7c0NqFRKZ19GK+m+09eSyHJUq2pNJr lNqE6LqZCiNXD7kYz6D9v/t6bfKT9MUxf1PWl0gJYjRrTe1l69e8JGA5SmfLWR7A HkTgzdAWpz0of0B6rvqp/UHh4OMVDKSeIx0ThigvGcgDQ4Jl+kGqowkm8DOCBcLE 41CEycPYgEiAxUYwd5B0Hmb+yLYX8BLB7VhByI9S6UjjY1NclnS1cLCUZiYl7qJV A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4d1n62399w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Mar 2026 03:14:08 -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 62O7E7K3020237 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Mar 2026 03:14:07 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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; Tue, 24 Mar 2026 03:14:07 -0400 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; Tue, 24 Mar 2026 03:14:06 -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, 24 Mar 2026 03:14:06 -0400 Received: from CJONES7-T01.ad.analog.com (HYB-jCCu8MOWEgi.ad.analog.com [10.116.223.230] (may be forged)) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62O7Dg0c003654; Tue, 24 Mar 2026 03:13:57 -0400 From: Carlos Jones Jr To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Michael Hennerich , Liam Beguin , =?UTF-8?q?Nuno=20S=C3=A1?= , "Andy Shevchenko" , Tobias Sperling , Jorge Marques CC: , , Subject: [PATCH v2 1/4] iio: adc: ltc2309: Introduce chip_info structure Date: Tue, 24 Mar 2026 15:13:28 +0800 Message-ID: <20260324071331.842-2-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260324071331.842-1-carlosjr.jones@analog.com> References: <20260324071331.842-1-carlosjr.jones@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: AW1haW4tMjYwMzI0MDA1NyBTYWx0ZWRfX3f41DVeIZC3r U+/BHCRJVgDvPTVBWYvC314LjwC3p8GsNAm4rG6yDCgIEqbkDkHMJlPu0WyJ+2+pMHCWgZ8nwa9 JlYoRznQGCe3IuVyeKiMs+8MK7sFeuBlFpHF3+PbM7zvTdDFu4cJ1GBZWyqPgE77EEbZ0JB8j0S RR1aFrcDPTCpRgd8cV2mw1SpyYFRxHsp0YAc8fsCL6zlE47Zr4Sf9OtfChjjXNZ2DPXaK6G2Nu9 47+IqQyU44zs6soTz5KBobl4cH8JjpRcSiWkUuu4unEPO9RasPWKe2fBKUZqs4PLMmqh/cXtVPU Ki+iuUQqfqZAXvR12wdNVFcA0RWVOpdoLIGwJgo43IN17C/Eku8e/MCoFOv4Z8qv26KBL26wauX 1yBjOjp8FCVCoz0yyrgfvo4jIzzIxyqMystEnZSjTVOZjvHZgIw3sex7Q8nAUfwpRBFG5JRB2RZ qpotWEAwLk904/HFSBg== X-Proofpoint-ORIG-GUID: juYBNpryKw1xcwZfj62WEpe10yTlWbE0 X-Proofpoint-GUID: juYBNpryKw1xcwZfj62WEpe10yTlWbE0 X-Authority-Analysis: v=2.4 cv=D59K6/Rj c=1 sm=1 tr=0 ts=69c239c0 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=uXIjobp8t2wMuQ0fPvqm:22 a=gAnH3GRIAAAA:8 a=pGLkceISAAAA:8 a=ZorkHgBYlZiqIV_WkfAA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-24_02,2026-03-23_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 adultscore=0 impostorscore=0 clxscore=1015 spamscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603240057 Content-Type: text/plain; charset="utf-8" Introduce a chip_info structure to facilitate adding support for chip variants with different channel configurations and timing requirements. The chip_info structure contains: - Device name for proper sysfs identification - Channel specifications and count - Read delay timing for variants requiring settling time The ltc2309 struct is modified to store only the read_delay_us value rather than a pointer to the full chip_info, as this is the only runtime-accessed field after probe. This preparatory refactoring does not modify existing LTC2309 functionality. Signed-off-by: Carlos Jones Jr --- drivers/iio/adc/ltc2309.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ltc2309.c b/drivers/iio/adc/ltc2309.c index 5f0d947d0615..0644b1f02568 100644 --- a/drivers/iio/adc/ltc2309.c +++ b/drivers/iio/adc/ltc2309.c @@ -8,12 +8,14 @@ * Copyright (c) 2023, Liam Beguin */ #include +#include #include #include #include #include #include #include +#include =20 #define LTC2309_ADC_RESOLUTION 12 #define LTC2309_INTERNAL_REF_MV 4096 @@ -26,18 +28,27 @@ #define LTC2309_DIN_UNI BIT(3) #define LTC2309_DIN_SLEEP BIT(2) =20 +struct ltc2309_chip_info { + const char *name; + unsigned int num_channels; + const struct iio_chan_spec *channels __counted_by_ptr(num_channels); + unsigned int read_delay_us; +}; + /** * struct ltc2309 - internal device data structure * @dev: Device reference * @client: I2C reference * @lock: Lock to serialize data access * @vref_mv: Internal voltage reference + * @read_delay_us: Chip-specific read delay in microseconds */ struct ltc2309 { struct device *dev; struct i2c_client *client; struct mutex lock; /* serialize data access */ int vref_mv; + unsigned int read_delay_us; }; =20 /* Order matches expected channel address, See datasheet Table 1. */ @@ -117,6 +128,9 @@ static int ltc2309_read_raw_channel(struct ltc2309 *ltc= 2309, return ret; } =20 + if (ltc2309->read_delay_us) + fsleep(ltc2309->read_delay_us); + ret =3D i2c_master_recv(ltc2309->client, (char *)&buf, 2); if (ret < 0) { dev_err(ltc2309->dev, "i2c read failed: %pe\n", ERR_PTR(ret)); @@ -156,10 +170,18 @@ static const struct iio_info ltc2309_info =3D { .read_raw =3D ltc2309_read_raw, }; =20 +static const struct ltc2309_chip_info ltc2309_chip_info =3D { + .name =3D "ltc2309", + .num_channels =3D ARRAY_SIZE(ltc2309_channels), + .channels =3D ltc2309_channels, +}; + + static int ltc2309_probe(struct i2c_client *client) { struct iio_dev *indio_dev; struct ltc2309 *ltc2309; + const struct ltc2309_chip_info *chip_info; int ret; =20 indio_dev =3D devm_iio_device_alloc(&client->dev, sizeof(*ltc2309)); @@ -169,11 +191,13 @@ static int ltc2309_probe(struct i2c_client *client) ltc2309 =3D iio_priv(indio_dev); ltc2309->dev =3D &indio_dev->dev; ltc2309->client =3D client; + chip_info =3D <c2309_chip_info; + ltc2309->read_delay_us =3D chip_info->read_delay_us; =20 - indio_dev->name =3D "ltc2309"; + indio_dev->name =3D chip_info->name; indio_dev->modes =3D INDIO_DIRECT_MODE; - indio_dev->channels =3D ltc2309_channels; - indio_dev->num_channels =3D ARRAY_SIZE(ltc2309_channels); + indio_dev->channels =3D chip_info->channels; + indio_dev->num_channels =3D chip_info->num_channels; indio_dev->info =3D <c2309_info; =20 ret =3D devm_regulator_get_enable_read_voltage(&client->dev, "vref"); --=20 2.43.0 From nobody Sun Apr 5 13:06:20 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 8A2FF3C5DB6; Tue, 24 Mar 2026 07:14: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=1774336485; cv=none; b=XKWOErindNqyQfae9nkjdkWMmQ2XPwK2I18Uxpw0zvLGisgSpZSdfXiojoT9BmFbgYd9394AJY38J76CYKM/eIIw0FXi1DMMO2eziUY8Q3erdyEVAGYeMv/+b7lPjINK4umhrw92RLPxWGbgsD93Q8bub/Qu/GzcOZ3gf3amWuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774336485; c=relaxed/simple; bh=+e6nOmqNX4Ruksbj+JmHXm1wd/Ny88rYcyaabwPylG4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FBIhBY1PXUihZrX/d0BYVnN9tr1K/cT/6mbR9Mzk6hEKnqUIzw2naSbZuiPV7WU2+r7TjpI/LosdGDaFbW1g+78zpk9o7L+rLh/YYfOo4Lv2tD9oLolMBMTkxUgNK97bhZVV55QOmyyEnlrYCKBf/0dJx0eO8cs8vQTFEv/DXWM= 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=oM/yhCXC; 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="oM/yhCXC" 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 62O39MpO662586; Tue, 24 Mar 2026 03:14:11 -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=MusJI pNrc4l1O98qv/J+ypUbbx0xIbFFtj8uaAlNxgA=; b=oM/yhCXCbfdOdVG36xGR3 j5i3qmsIGWvLbvD3ekKyrTPdonkqwVDO25efMOfqoCQIBvp6TK3FBYkVoj6WKlMG rs6qTvvpyIrVZEULWoNTLEeQwbxL4GWgKQjcvHXvlrZHuSa2JT+IjdY6j39caBrD qMjBHWYL42G26orCMHcQjwWz0/lgg/YDSWHKiIxNSH4HrG2+TCqVG7c6pBa5Qbcy QazqztzS4qxB9fZj741ezw9mnCeS7ZqeOAIg3+3oWEKEFCCX7XYMmsfLQuxXD1O+ PR+w69ziKqlwPU2zsAuI9OyW0RONZT9I0K9DbARMkYo5Sl++xGXRkacN93hXrDCn w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4d1n6239a0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Mar 2026 03:14:11 -0400 (EDT) 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 62O7EAlJ020241 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Mar 2026 03:14:10 -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, 24 Mar 2026 03:14:10 -0400 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; Tue, 24 Mar 2026 03:14:10 -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, 24 Mar 2026 03:14:10 -0400 Received: from CJONES7-T01.ad.analog.com (HYB-jCCu8MOWEgi.ad.analog.com [10.116.223.230] (may be forged)) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62O7Dg0d003654; Tue, 24 Mar 2026 03:14:03 -0400 From: Carlos Jones Jr To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Michael Hennerich , Liam Beguin , =?UTF-8?q?Nuno=20S=C3=A1?= , "Andy Shevchenko" , Tobias Sperling , Jorge Marques CC: , , Subject: [PATCH v2 2/4] iio: adc: ltc2309: Use i2c_get_match_data() helper Date: Tue, 24 Mar 2026 15:13:29 +0800 Message-ID: <20260324071331.842-3-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260324071331.842-1-carlosjr.jones@analog.com> References: <20260324071331.842-1-carlosjr.jones@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: AW1haW4tMjYwMzI0MDA1NyBTYWx0ZWRfXy681p2lCrdto KLRouNpoIjPPn7GueGHlXxQq+Adk611F/eqP9zTqCt+HIxISx1HTD8AVighXETj2wSRt8FBR2yW e7d9U4gBb6uhdcYrmhcAn4Y9cSR6A+mtRc+qAA6lFLz5UtWz/PDIt5ONDrQpgxn9r94SPxtg/B3 GKZ5aYsfqroI7lfDYqcSm7oAhT7lfKhGnj0ZaDr7ENsJxMvC6daRlSL1TR/fgdpUwtOyMuSdiKI uX5uRgLjD1p0YEpTNEmvuJGudPuXM8wtI+PnM9gybDMBqwivR72zwfVmJrm7aPvqHzEetJui5td sJAVx2ur88evA7dVRf8hc9M1YSxS9WCUDVE5DPyol9PFJdzonT2ClXJnc6Iln7q9tykXwB5zayR YicV6QBp2jUtHUJ2ZHD6iW6NtaWkhywbrSP5rro3DHsud9qsiwOXNwEJ0KMXXUAMvFuFRCv32wv e05N/Nrim3cif0v3S/Q== X-Proofpoint-ORIG-GUID: 7dY5LN3GHV6mAJmf4aG-jjkJj9TmXOIz X-Proofpoint-GUID: 7dY5LN3GHV6mAJmf4aG-jjkJj9TmXOIz X-Authority-Analysis: v=2.4 cv=D59K6/Rj c=1 sm=1 tr=0 ts=69c239c3 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=uXIjobp8t2wMuQ0fPvqm:22 a=gAnH3GRIAAAA:8 a=QrCu5fVgqlF5A00fM60A:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-24_02,2026-03-23_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 adultscore=0 impostorscore=0 clxscore=1015 spamscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603240057 Content-Type: text/plain; charset="utf-8" Convert the driver to use the i2c_get_match_data() helper function for retrieving chip-specific information. This simplifies device identification and aligns with modern kernel practices. Update both of_device_id and i2c_device_id tables to include chip_info data pointers. The device name is now sourced from chip_info to ensure proper identification in sysfs. No functional changes to existing LTC2309 behavior. Signed-off-by: Carlos Jones Jr Reviewed-by: Andy Shevchenko --- drivers/iio/adc/ltc2309.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/ltc2309.c b/drivers/iio/adc/ltc2309.c index 0644b1f02568..475ecc21ebe9 100644 --- a/drivers/iio/adc/ltc2309.c +++ b/drivers/iio/adc/ltc2309.c @@ -191,7 +191,7 @@ static int ltc2309_probe(struct i2c_client *client) ltc2309 =3D iio_priv(indio_dev); ltc2309->dev =3D &indio_dev->dev; ltc2309->client =3D client; - chip_info =3D <c2309_chip_info; + chip_info =3D i2c_get_match_data(client); ltc2309->read_delay_us =3D chip_info->read_delay_us; =20 indio_dev->name =3D chip_info->name; @@ -213,13 +213,13 @@ static int ltc2309_probe(struct i2c_client *client) } =20 static const struct of_device_id ltc2309_of_match[] =3D { - { .compatible =3D "lltc,ltc2309" }, + { .compatible =3D "lltc,ltc2309", .data =3D <c2309_chip_info }, { } }; MODULE_DEVICE_TABLE(of, ltc2309_of_match); =20 static const struct i2c_device_id ltc2309_id[] =3D { - { "ltc2309" }, + { "ltc2309", (kernel_ulong_t)<c2309_chip_info }, { } }; MODULE_DEVICE_TABLE(i2c, ltc2309_id); --=20 2.43.0 From nobody Sun Apr 5 13:06:20 2026 Received: from mx0b-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 95BEA30F95A; Tue, 24 Mar 2026 07:14:41 +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=1774336490; cv=none; b=dQBtV0JJY4hvFVQwNASF6NYapwwmTll7Er5AdXlFXvQqEtaIUkEOj8+PyCD2EzmrwS+nKgdZC0ryrKwXdGf15qGsu9XSX8sA/CgAUfvvMpc02s8SDO3xlAvbgKNmx118qUdtbUku6laEOB6TzyxFVeKLRbNVramzoxb8KBZMlqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774336490; c=relaxed/simple; bh=pWGK3a47a5IE/6Xf5CqdCM7wCKfJgdgrrA8/V3iAAgU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PMNyN7VObE9KAJT+NzXtL7OHbCSxJ/BR7eABhlnrDohao5Olt+H+Ih/4XaSAkrwNJ86940JczOXqeBxhlzjIHGb7YgJroihzHBU+NjEveE1mfY2QronornBZnRjBy2oHm+reyAmoA9wkL5cnp29xQxrrTWrIp6pZFRgR2bTASHk= 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=o0kOKiUw; 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="o0kOKiUw" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62O1Uuh34072652; Tue, 24 Mar 2026 03:14:17 -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=VKA1T 25ql99Aa5rgzcZx9zZz3v36OhoKJMSNYizP1Zc=; b=o0kOKiUwfz6WTe3frOS8A C8oHl/qWowLTKMGdvQWFK1yKXQebUGaJ67XsT2xrY2Jw6fv5Z5CqKkJFGV5nLI+/ kGtbGpzt/70kAjXVo4x+PXKk2ak8FqMIfm/UcZGslq5cBFeB8fhYOrs11KX+2wpV h18AkwvT2N24SA+njABEKeIWvLVTEFO9V4Bl0gEZZbCQxSAuY9K7YCIb14D6TbRP 97/b/DXnOqezKSWnHM7humDTrMGRq78SmL9ZCs/UPwz4qBPdNXOgJsooOYYXKO1c rHB/SnHqWQ0VDVHyJael3R+UrWKll2cqAnJE/x38FSNab7/OF95G1a+0KkLwPvZA g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 4d2pxqerfj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Mar 2026 03:14:17 -0400 (EDT) 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 62O7EG10020257 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Mar 2026 03:14:16 -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, 24 Mar 2026 03:14:16 -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, 24 Mar 2026 03:14:16 -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, 24 Mar 2026 03:14:15 -0400 Received: from CJONES7-T01.ad.analog.com (HYB-jCCu8MOWEgi.ad.analog.com [10.116.223.230] (may be forged)) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62O7Dg0e003654; Tue, 24 Mar 2026 03:14:08 -0400 From: Carlos Jones Jr To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Michael Hennerich , Liam Beguin , =?UTF-8?q?Nuno=20S=C3=A1?= , "Andy Shevchenko" , Tobias Sperling , Jorge Marques CC: , , Subject: [PATCH v2 3/4] dt-bindings: iio: adc: ltc2497: Add LTC2305 compatible Date: Tue, 24 Mar 2026 15:13:30 +0800 Message-ID: <20260324071331.842-4-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260324071331.842-1-carlosjr.jones@analog.com> References: <20260324071331.842-1-carlosjr.jones@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=ALPFdfBd c=1 sm=1 tr=0 ts=69c239c9 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=N--XFCr6TIEc_64PeIT2:22 a=gEfo2CItAAAA:8 a=gAnH3GRIAAAA:8 a=pGLkceISAAAA:8 a=TAVYlzFYoiTtzGGjz50A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-ORIG-GUID: oW9W6uqQXOuImUg_wleVtH_7GIj_f5co X-Proofpoint-GUID: oW9W6uqQXOuImUg_wleVtH_7GIj_f5co X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI0MDA1NyBTYWx0ZWRfX010R0u71iIrQ cXsxAtmzAAkR5o2wPJi3VYeQNzwvbHneJltj1Q9N1BtLWLFCPw+sBVt+kmLNDvUwq7mIZt6WKLw SCPVovMUbgDpPYg2ipHJo7kApYx5sZmmWmS7lhWOVWhNO522ZMleOdSir5A3gdXt6UY/LEMTRX2 R1dXpHSeCDMRp5t0wrlU3/OSmUrWTUzfkROrfKtsVElhxTt7uGo6loxDzLDgTVAafG7lbeOkLYr kl5Vp9A87L+1V05hVd2qX9wU3slnSc7ALY9BHxD/E3NWD3qWuJSpHRNv+I33KOaBPYrz9zLbPrY rZej/9lYNqhr1RVNwPdCrT/YNh+jwyJwjXKbE3cDOqhQDCLFtjayB7GcOweyjjanQlfEeRaBG6F YgTD8EfSXdiB48mNpWYiuMbTQCEnPx7ibNFZoKmWhIqv8NefQs1ylw+dPNOeUklJGpjxr4LxV/d fb7chZzGeeXi9jx2n4g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-24_02,2026-03-23_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 clxscore=1015 spamscore=0 impostorscore=0 bulkscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603240057 Add device tree binding for the LTC2305, a 2-channel, 12-bit SAR ADC from Linear Technology (now part of Analog Devices). The LTC2305 uses the same I2C register interface as the LTC2309 but differs in: - Channel count: 2 channels vs 8 channels (LTC2309) - Conversion timing: Requires 1.6=CE=BCs settling time vs negligible for LTC2309 Signed-off-by: Carlos Jones Jr Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/iio/adc/lltc,ltc2497.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/adc/lltc,ltc2497.yaml b/= Documentation/devicetree/bindings/iio/adc/lltc,ltc2497.yaml index 5cc6a9684077..b246d492950e 100644 --- a/Documentation/devicetree/bindings/iio/adc/lltc,ltc2497.yaml +++ b/Documentation/devicetree/bindings/iio/adc/lltc,ltc2497.yaml @@ -4,13 +4,19 @@ $id: http://devicetree.org/schemas/iio/adc/lltc,ltc2497.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: Linear Technology / Analog Devices LTC2497 and LTC2309 ADC +title: Linear Technology / Analog Devices LTC2497 and similar ADCs =20 maintainers: - Michael Hennerich - Liam Beguin =20 description: | + LTC2305: + low noise, low power, 2-channel, 12-bit successive approximation ADC w= ith an + I2C compatible serial interface. + + https://www.analog.com/media/en/technical-documentation/data-sheets/23= 05fa.pdf + LTC2309: low noise, low power, 8-channel, 12-bit successive approximation ADC w= ith an I2C compatible serial interface. @@ -28,6 +34,7 @@ description: | properties: compatible: enum: + - lltc,ltc2305 - lltc,ltc2309 - lltc,ltc2497 - lltc,ltc2499 --=20 2.43.0 From nobody Sun Apr 5 13:06:20 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 8595226ED4F; Tue, 24 Mar 2026 07:14:48 +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=1774336498; cv=none; b=KSTegHy7Rdjc5FaiBw8Yq+FAgh/r2MDMQPb5ucb9kgJ7dP/04uxrfOiaOMCPDITr38UHHiwfXoL3UOmix7ei61t76plV0y5JXZGTpNrPmYzufc+8BgndR6yUAlCNkKIsghVnu3p7zXaVtUD/KZxmorML/a5+OxFuVZ1d3J+KLjU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774336498; c=relaxed/simple; bh=QI+7OwK/6gfmL5qJ6Q/FweMXtMqrsPBgbjixqh0ZHqw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SR8CwZkMt//rrnngFFaZklDLIkr0GhhOagckEmaXMNasgUor7d5RKJUtBygMOB3umnS5cd4jD0V320J9AP7czjZKarXlHD42zMu0CRI26NOtnNzRJg/i5xLmJgq92cwBQFLTb42ssbcBPpDcjjd0w2Kdsd2o6Jpj2E73ShirtAY= 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=J2u6tgQZ; 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="J2u6tgQZ" 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 62O6JcN7662684; Tue, 24 Mar 2026 03:14:24 -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=9SMk4 v6lawPJ8GlytxKAe+R6/fXHgfP0fQYq4r9ro00=; b=J2u6tgQZ0dW3z1ZzJGm12 FZurbPP0aHUR/wFFiT+Q9fnFkWSZ16GSVNDmEnvEcdpfEYAQtl3+zdaSCrUsNs0/ yG/HDqIG3RCWzSgj9gOBLh0Q1M4laDyQwikGJWIP65Rf5/mQiDIKR90c/8FrAkkp 3JgCh20oLA9B7urpfaSsPC9U/CkS2XcdCUVuhfLSVvyiOuWd1dF1+/aHC0EUfuVx hSpRyaIC8tlpoXGVIrNyEh65mvVtJgW5zDW9eKPU/hq1WHgQWGx0BtQJDHa/d+Fz UByV8jUtSedYvcmZrpa42rNpSK44zMDI39pf69mXHC2uGGhGYkZG4l8nY3kVx321 g== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4d1n6239af-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Mar 2026 03:14:24 -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 62O7EN5u020263 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Mar 2026 03:14:23 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) 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; Tue, 24 Mar 2026 03:14:23 -0400 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; Tue, 24 Mar 2026 03:14:23 -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, 24 Mar 2026 03:14:23 -0400 Received: from CJONES7-T01.ad.analog.com (HYB-jCCu8MOWEgi.ad.analog.com [10.116.223.230] (may be forged)) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62O7Dg0f003654; Tue, 24 Mar 2026 03:14:13 -0400 From: Carlos Jones Jr To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Michael Hennerich , Liam Beguin , =?UTF-8?q?Nuno=20S=C3=A1?= , "Andy Shevchenko" , Tobias Sperling , Jorge Marques CC: , , Subject: [PATCH v2 4/4] iio: adc: ltc2309: Add LTC2305 support Date: Tue, 24 Mar 2026 15:13:31 +0800 Message-ID: <20260324071331.842-5-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260324071331.842-1-carlosjr.jones@analog.com> References: <20260324071331.842-1-carlosjr.jones@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: AW1haW4tMjYwMzI0MDA1NyBTYWx0ZWRfX1mTazD52ASzV E1Wr6vjj8W/70PJiMWDcf4hMTE+ONYBLyweam4GQSwu2neVSMkYIgGweLHGzdOMf+jOMJm2oUv2 JAa/nh86hO9LD8iDIMD/xvFKcb3GfWpCtDwBhJSt+JfyBcXyC9oTXS+QGOpdbLcg3LKJaObDzSS yBdUVc8dOalmFTQDmeDc1Y8UvR+pe8nOL794HI3/WmmpRhsuH4UUpbdc/TR6QI0MA/icxixbxah vgesJZB33cwWebGOV92Alb3kcTsfmsJUYLh06tazrMChCBkr21gTRGwBjnJgG/mobyWUr8f7XQc ha8b0cDuasUxzWbXMBMf3I/DQoHLEMUr9CoR6xGcJ+5SgtoqroZPqiCVOT89Rru/L/4yQfNS97z cJ0k9HpzqQpD3m0+DLiPZe1gUG74nPrOjzu7L8OFfEc7OQts3y5nkGfVmNwiv6AaHl6meY+XD1e GsdAbs6HBBNPQIdKKKw== X-Proofpoint-ORIG-GUID: t90mSKuwfX-O7O07uQDE82CnPk5mihv9 X-Proofpoint-GUID: t90mSKuwfX-O7O07uQDE82CnPk5mihv9 X-Authority-Analysis: v=2.4 cv=D59K6/Rj c=1 sm=1 tr=0 ts=69c239d0 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=uXIjobp8t2wMuQ0fPvqm:22 a=gAnH3GRIAAAA:8 a=pGLkceISAAAA:8 a=6VD43Srf4_-BMiEuy00A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-24_02,2026-03-23_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 adultscore=0 impostorscore=0 clxscore=1015 spamscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603240057 Add support for the LTC2305, a 2-channel, 12-bit SAR ADC that shares the same I2C interface as the LTC2309. The LTC2305 differs from the LTC2309 in: - Channel configuration: 2 single-ended + 2 differential vs 8 single-ended + 8 differential - Read timing: Requires 2=CE=BCs delay (1.6=CE=BCs rounded up) between I2C write and read operations Device tree binding added in previous commit. Signed-off-by: Carlos Jones Jr Reviewed-by: Andy Shevchenko --- drivers/iio/adc/Kconfig | 8 +++++--- drivers/iio/adc/ltc2309.c | 25 +++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index a9dedbb8eb46..860c0909dbbb 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -915,11 +915,13 @@ config LPC32XX_ADC via sysfs. =20 config LTC2309 - tristate "Linear Technology LTC2309 ADC driver" + tristate "Linear Technology LTC2309 and similar ADC driver" depends on I2C help - Say yes here to build support for Linear Technology LTC2309, a low - noise, low power, 8-channel, 12-bit SAR ADC + Say yes here to build support for Linear Technology low noise, + low power 12-bit SAR ADCs: + - LTC2305 - 2-channel + - LTC2309 - 8-channel =20 This driver can also be built as a module. If so, the module will be called ltc2309. diff --git a/drivers/iio/adc/ltc2309.c b/drivers/iio/adc/ltc2309.c index 475ecc21ebe9..d7ec4d92a96c 100644 --- a/drivers/iio/adc/ltc2309.c +++ b/drivers/iio/adc/ltc2309.c @@ -1,9 +1,14 @@ // SPDX-License-Identifier: GPL-2.0 /* - * The LTC2309 is an 8-Channel, 12-Bit SAR ADC with an I2C Interface. + * Low noise, low power 12-Bit SAR ADC with an I2C Interface. + * + * Supported devices: + * LTC2305 - 2-channel + * LTC2309 - 8-channel * * Datasheet: * https://www.analog.com/media/en/technical-documentation/data-sheets/230= 9fd.pdf + * https://www.analog.com/media/en/technical-documentation/data-sheets/230= 15fb.pdf * * Copyright (c) 2023, Liam Beguin */ @@ -110,6 +115,13 @@ static const struct iio_chan_spec ltc2309_channels[] = =3D { LTC2309_DIFF_CHAN(7, 6, LTC2309_CH7_CH6), }; =20 +static const struct iio_chan_spec ltc2305_channels[] =3D { + LTC2309_CHAN(0, LTC2309_CH0), + LTC2309_CHAN(1, LTC2309_CH1), + LTC2309_DIFF_CHAN(0, 1, LTC2309_CH0_CH1), + LTC2309_DIFF_CHAN(1, 0, LTC2309_CH1_CH0), +}; + static int ltc2309_read_raw_channel(struct ltc2309 *ltc2309, unsigned long address, int *val) { @@ -170,6 +182,13 @@ static const struct iio_info ltc2309_info =3D { .read_raw =3D ltc2309_read_raw, }; =20 +static const struct ltc2309_chip_info ltc2305_chip_info =3D { + .name =3D "ltc2305", + .num_channels =3D ARRAY_SIZE(ltc2305_channels), + .channels =3D ltc2305_channels, + .read_delay_us =3D 2, +}; + static const struct ltc2309_chip_info ltc2309_chip_info =3D { .name =3D "ltc2309", .num_channels =3D ARRAY_SIZE(ltc2309_channels), @@ -213,12 +232,14 @@ static int ltc2309_probe(struct i2c_client *client) } =20 static const struct of_device_id ltc2309_of_match[] =3D { + { .compatible =3D "lltc,ltc2305", .data =3D <c2305_chip_info }, { .compatible =3D "lltc,ltc2309", .data =3D <c2309_chip_info }, { } }; MODULE_DEVICE_TABLE(of, ltc2309_of_match); =20 static const struct i2c_device_id ltc2309_id[] =3D { + { "ltc2305", (kernel_ulong_t)<c2305_chip_info }, { "ltc2309", (kernel_ulong_t)<c2309_chip_info }, { } }; @@ -235,5 +256,5 @@ static struct i2c_driver ltc2309_driver =3D { module_i2c_driver(ltc2309_driver); =20 MODULE_AUTHOR("Liam Beguin "); -MODULE_DESCRIPTION("Linear Technology LTC2309 ADC"); +MODULE_DESCRIPTION("Linear Technology LTC2305/LTC2309 ADC driver"); MODULE_LICENSE("GPL v2"); --=20 2.43.0