From nobody Sat Apr 4 07:51:22 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 7BAF93AA503; Fri, 20 Mar 2026 14:09:26 +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=1774015767; cv=none; b=qlE3NMC6FLU2pFgQLrDErWjoTq/5GxWcXqo9RySzOnzVyy/HcMw44svHLN1sZ6qKfobvcUN5pJJjjxrTmPMPz1SBv0VzBiE4VrYO3tL7fPzpshjA0VtZbxk0NFO0J7t1QqX/Y09Cte7oOzNR0uS9LpBnQPzU9jC39pzx+of4fsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774015767; c=relaxed/simple; bh=W8gPvAuWcxBnjfCdcxSLHN8rzWLn20W4iK27zCmdb1E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pR3v6m1skiPUbfpGsWLS6aFg6UMxlhXwPfQgPKjLow2wbbvCllJnI6RA/8a2WJzul/ASySWgDLZ6Mx04AjfqnzIMNogUn61uyDl67RHXArN9NlMOu9FilJXk3S38g9TJt/O/Awhuo3huqkNyjNq+6yrurTRzYrw578SKkUEWoXA= 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=P36El2NE; 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="P36El2NE" 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 62K844Da1782791; Fri, 20 Mar 2026 10:08:55 -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=zJeyf lNdnnZVKG0R4BssY+0T8vmN4J2SAHJx1l5Mv8Q=; b=P36El2NEoJR+CBdrukKi7 1Q1+uyt8JAfhe73enZ+ar4BmLrSKLKZ7iW0niUtKplGNzGOQ73kL6SM6fyfPnNyv RL89XgjLT6aojNJGazV+iAsCz9vzAU94wH7WdvRmyadQRA8mjfZ8ziIKgmPFEx7c xKW2mgXeUpTuaY27tNGj3+WtnmonK1lImF+hn8NGum2CygaIqN9xtdNkRRn/mXKz CGU6yyceG03yY1AEoegBHloT8sUhCKwQvdtb9E0GngE3P+Pq3WWdy38cQfTbaI65 WJs03XdKAoJIvgmhzl+Ro/YwXHuMZnEVZUY37agpay5pmNa9oWrwJREzO9SUF2U0 A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4cyjf8cvys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Mar 2026 10:08:55 -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 62KE8s8E055452 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Mar 2026 10:08:54 -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; Fri, 20 Mar 2026 10:08:53 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 20 Mar 2026 10:08:53 -0400 Received: from CJONES7-T01.ad.analog.com (CJONES7-T01.ad.analog.com [10.116.223.230]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62KE8V9K014859; Fri, 20 Mar 2026 10:08:45 -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 1/3] iio: adc: ltc2309: introduce chip_info structure Date: Fri, 20 Mar 2026 22:08:17 +0800 Message-ID: <20260320140819.191700-2-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260320140819.191700-1-carlosjr.jones@analog.com> References: <20260320140819.191700-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-Authority-Analysis: v=2.4 cv=Rcidyltv c=1 sm=1 tr=0 ts=69bd54f7 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=Z0pTeXoby7EwIRygza74:22 a=gAnH3GRIAAAA:8 a=pGLkceISAAAA:8 a=xt1Mke5GkH6e2Q2BLK4A:9 X-Proofpoint-ORIG-GUID: 1ECSoVKQzX5TzqqpHQymVXZV3m73yLn1 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzIwMDExMiBTYWx0ZWRfXziiNhpbkRmKn ZH/DgQjxrmMY79CZQfCN+NWQTnSCwyjtpTquj3dHZZwlSCkOAHUP2JPJWu5nwnV0SjoU4fEs8Qz DtWBMAavSslKP6lrnZ1i8m9BCKJN9j8z57k5bA8ATUS187j+/3Wpjodi92PJ0dHaJ1iDmmNbRGN 8vch04VBk7aBzUq7xA2J8gozs76uTjh2mzZNDX0Sgoq8ZfPEi/HzPzynxIMdbykuA0zDRYmGQx1 Q2/MnUOzv4xFukoGy/oLFum5d+Twx99OATK3rZV/nPmDAA/Atrc+HQ1Kt1ya3rvxehGsU/YnV5s AU/PZTBUnV8BvZmFBe6S23vH1j4DsWpcuarhxnfDfhTov0khvZHZ5i+GVqYVrXCw8JxjrOxB7UA yZRdDhzM4p2KF38O7kWs7/ij2h550w5LVqK66/Bu1Pux2lwZStiR+7L9/YxugGJBVsjAkFEQ7X6 sRMzWHPZXVrUTxBUJqQ== X-Proofpoint-GUID: 1ECSoVKQzX5TzqqpHQymVXZV3m73yLn1 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-20_02,2026-03-19_05,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603200112 Content-Type: text/plain; charset="utf-8" This is a preparatory patch that introduces a chip_info structure to the LTC2309 driver to facilitate adding support for additional chip variants with different channel configurations and timing requirements. The chip_info structure contains chip-specific data including the channel specifications, number of channels, and read delay timing. This change does not modify the existing LTC2309 functionality. Signed-off-by: Carlos Jones Jr --- drivers/iio/adc/ltc2309.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ltc2309.c b/drivers/iio/adc/ltc2309.c index 5f0d947d0615..4ea25873398c 100644 --- a/drivers/iio/adc/ltc2309.c +++ b/drivers/iio/adc/ltc2309.c @@ -8,6 +8,7 @@ * Copyright (c) 2023, Liam Beguin */ #include +#include #include #include #include @@ -26,18 +27,26 @@ #define LTC2309_DIN_UNI BIT(3) #define LTC2309_DIN_SLEEP BIT(2) =20 +struct ltc2309_chip_info { + const struct iio_chan_spec *channels; + unsigned int 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 + * @chip_info: Chip-specific configuration data */ struct ltc2309 { struct device *dev; struct i2c_client *client; struct mutex lock; /* serialize data access */ int vref_mv; + const struct ltc2309_chip_info *chip_info; }; =20 /* Order matches expected channel address, See datasheet Table 1. */ @@ -117,6 +126,10 @@ static int ltc2309_read_raw_channel(struct ltc2309 *lt= c2309, return ret; } =20 + if (ltc2309->chip_info->read_delay_us) + usleep_range(ltc2309->chip_info->read_delay_us, + ltc2309->chip_info->read_delay_us * 2); + 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,6 +169,12 @@ 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 { + .channels =3D ltc2309_channels, + .num_channels =3D ARRAY_SIZE(ltc2309_channels), + .read_delay_us =3D 0, +}; + static int ltc2309_probe(struct i2c_client *client) { struct iio_dev *indio_dev; @@ -169,11 +188,12 @@ static int ltc2309_probe(struct i2c_client *client) ltc2309 =3D iio_priv(indio_dev); ltc2309->dev =3D &indio_dev->dev; ltc2309->client =3D client; + ltc2309->chip_info =3D <c2309_chip_info; =20 indio_dev->name =3D "ltc2309"; 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 ltc2309->chip_info->channels; + indio_dev->num_channels =3D ltc2309->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 Sat Apr 4 07:51:22 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 7DD473A0B11; Fri, 20 Mar 2026 14:09:25 +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=1774015767; cv=none; b=JvhKsw/v8eLULRbC/ulP24Sw6tMjNK/AcWkb5R86ud0wk9D5NP9042ZL+OdQpMPNMUH1lJKTh1fjcFrE5CO/13lkxCxqhjTROpK6jZtXIGNBtH+MGF+ozw/g7Pby1jOTatUJRF6iXxutVPoKqbm0vgqjlLdquYz600LxjdZxSVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774015767; c=relaxed/simple; bh=jOyEMeGG8W4nfIX/w9V4QO3XOyng7QpZxderLQQFMu0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H90SL8dyPLuXL8yi32Cdqu7+ZbxQx1BZCZLM4ylNILmrBqo6xstsPc4YVc+ZvUfTOno/BJ6XySZcz48Db6kWOpK/7xgJpALOl1RfKXi9TmP/6PZRewDPeSLtP5TwZXmvHbB5P4MFcMaqgMIYRbTEt9ytvPdTQFJWWShJrlGHfy8= 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=begJwiLF; 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="begJwiLF" Received: from pps.filterd (m0516787.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62KCfWh7634493; Fri, 20 Mar 2026 10:08:58 -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=qJ3MQ d6Y/zeX6JtpzFNsZfcp1W5Ac5b1CSVxchvzoN4=; b=begJwiLFjwgmVyo6IHcJ6 KdoZS7wW32X2PtL/lNrWB8ZBCxZwPrQy2PgphRfeXg+uVjAcSHBk9V3jNw210hUa HSlhu1cbK4zZDCw3H17hnYOgDVoFtNcka++r0ueYTXeZjlpntoyqlvHKp0k2dEBN wr5Nx2YareiNiQ3fYzZ5yU1vkHsE2nkKs+KRN6keBlVob3Ub+Wal1L0SdfLX738C vI+8Tr/wYrsWSyZNoWrjkX1Qnhxm8Mu4qRZzsr7JNC0zssoOC1ug3TJDCIsQVf1B e8H4hp+Z3xf9vmkVXze9E+EFfek4GvU1/uk3CYEknQMP/JAzKv6TxDhkM+iTJ59r Q== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4cyx8m1dym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Mar 2026 10:08:58 -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 62KE8v3G055457 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Mar 2026 10:08:57 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 20 Mar 2026 10:08:57 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 20 Mar 2026 10:08: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; Fri, 20 Mar 2026 10:08:56 -0400 Received: from CJONES7-T01.ad.analog.com (CJONES7-T01.ad.analog.com [10.116.223.230]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62KE8V9L014859; Fri, 20 Mar 2026 10:08:50 -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 2/3] dt-bindings: iio: adc: lltc,ltc2497: add LTC2305 support Date: Fri, 20 Mar 2026 22:08:18 +0800 Message-ID: <20260320140819.191700-3-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260320140819.191700-1-carlosjr.jones@analog.com> References: <20260320140819.191700-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-ORIG-GUID: 5aM47TiPdZb0NfjiKUH5fj9hyX-Dvr3R X-Proofpoint-GUID: 5aM47TiPdZb0NfjiKUH5fj9hyX-Dvr3R X-Authority-Analysis: v=2.4 cv=WfoBqkhX c=1 sm=1 tr=0 ts=69bd54fa cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=OmVn7CZJonkx5R5zMQLL:22 a=gEfo2CItAAAA:8 a=gAnH3GRIAAAA:8 a=pGLkceISAAAA:8 a=7uckrkT8fFrKzxKFu3wA:9 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzIwMDExMiBTYWx0ZWRfX8BhcRCiBSk0t x6f6FHDc8d2IwWImDsBgGNG4Xc2WmPSREesC/v+9TkLg9qdomhcEMKwvr4DqwmpgiYeMaFwFtHa AQJxugOGO1r0RSn6abOuhtyxnOH+AtFYbd4LO2TQ+8LxqezLPAEWpUh445kko4pKBSixOVyfM52 NhIIsw22s3nt3bQv+a420f97+zvE3/5iKVdPGmIn7NLEI8PILois7Qrs+8goHCKwmtygmLy0IjY TxVlAdOKfhEc3WDnOyTd3liNoXq/knF5Tg0E10jYQnD/HnDQgcVTA0+whr2sISFLVOp+DT8IB2m MwGWdU70XdaJFstmq92ygAQIWU+OYEVvG8306O2P89lT6P03Ki2Duv27uMnMU6u8vtuGQ29O3qW HRfWOonni0z0Os0dqrwXhHWCSCsr48cXjnLySEseU1vFcBe0KHX3LHnK/YE87JP+PKdHdL9QCTp c8/0602N19nKE2SGTlA== 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-20_02,2026-03-19_05,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 phishscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1011 bulkscore=0 adultscore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603200112 Content-Type: text/plain; charset="utf-8" Add support for the LTC2305 2-channel, 12-bit ADC to the existing LTC2497 device tree bindings. The LTC2305 is compatible with the LTC2309 driver implementation. Signed-off-by: Carlos Jones Jr --- .../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 Sat Apr 4 07:51:22 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 42A333C2776; Fri, 20 Mar 2026 14:09:29 +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=1774015772; cv=none; b=RwsuccJmo67/UbuJDlbK7caSe/rZvp5/m5nlICkBOk3QZ/2eP6d74mat+qwh9fC5Z8uXdb7ZVT3IkgbdzBsQM4GcVbjGnf3u5EHZV5xuHsQkd60LSPtjyOfJBnLHxFJMpc4IB55x2zyUqB4BPVHkbufDUEsKXL3RzzUCBHwLKIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774015772; c=relaxed/simple; bh=KFHKTQgjgYF2cQb1HO4PI62ip6RiaELqwOD+KKIDk1Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p3iQRS/4raAOm4nqfAIBKfUaTGDm9sIB4gVSP1mK2VRp02t4TuJpKek+zoNvA/po0C/Rdnr3omEVhSRnSPMWvveQEtKWaagzUPuV0yvbJzskFyuQXgkUgg11U37s2f2GIGnrMcnDNTLcsf92YP3sboUNbbDQissPNkHLTUYTi4E= 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=hO41mFaB; 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="hO41mFaB" 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 62K9L5Iq1782538; Fri, 20 Mar 2026 10:09: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=OZLAW EE/g5mshGaD6k2fdrtdnPQAnwohtcyh7mrnqz8=; b=hO41mFaB6BEjc5ujdaLbR dHX2LqX0f1VXmqDXsFGt7UvBnO19yclMBp3+MteIVd0qjOVTIMt9WEbuko8u7ZXb hrpaxeyLAgxDlNhk0DbhXCbovcqq2XlNyfj6ChXItc9yHV4KEZiq78zciJVVvh2o zbAKYUuLRYCGZ6/op70mHifRdPjGiiVh+lpKfsNFLWjF2cNHthD6y8lATYh39fwS WTp/oJCU4M5/rQ573e9dYOpNxY4lIG49YH/YlRbEkf10y94IQ3nJ8I0e6J/Fg6RO a9mVmv/mpKwuGCb98v+cJk1NxbjpJ82hzWxUTmNRbjTSH4KjK6WeqcQl5rnO/IMR A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4cyjf8cw04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Mar 2026 10:09:03 -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 62KE92Wm055460 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Mar 2026 10:09:02 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Fri, 20 Mar 2026 10:09:02 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Fri, 20 Mar 2026 10:09:02 -0400 Received: from CJONES7-T01.ad.analog.com (CJONES7-T01.ad.analog.com [10.116.223.230]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 62KE8V9M014859; Fri, 20 Mar 2026 10:08:55 -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 3/3] iio: adc: ltc2309: add support for LTC2305 Date: Fri, 20 Mar 2026 22:08:19 +0800 Message-ID: <20260320140819.191700-4-carlosjr.jones@analog.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260320140819.191700-1-carlosjr.jones@analog.com> References: <20260320140819.191700-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=Rcidyltv c=1 sm=1 tr=0 ts=69bd54ff cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=Z0pTeXoby7EwIRygza74:22 a=gAnH3GRIAAAA:8 a=pGLkceISAAAA:8 a=as-L6sGpZdkJDf6W14AA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: s-IjA5MlboPapMMA4UiJmAB_wepk6A68 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzIwMDExMiBTYWx0ZWRfX3Wr3B1AZnpiI i5ogggx9BvC1zMUiz7QMFNvaqzOXo38O/ejgv7VUY+EF+oq1gHWdG+C4kVCrU1Tb/IgsE4uwizB 9kP85f7luik9xXhVB+zfp71ucPVHEyoHMk8EFQO1J1d2/teqqJp5Ze9vtUPLzCBbgM69IgZtjnC zkwgQ0EFMMX9BRkKWLAssCZsntniXKfaQbbr+KZKlSEUSpmt7J2VCA1kLlMxECutt98DKtslKSM u3ii0W+2vxnNYAcVZ0o/VAmrqkzR+Paf8DchvckZsXNDEdsGlPk6JUTvzd4z2KTkw1/72sPV1yQ +6TkKTHqwpmZvAC0JsFKRIYp9Q/d5cq9PP0oGP5j0TcVWxUgXmo++H/xpR+cnpHCcOFG0orLIUR j1Ofq8dIm+lrGPK3mi4GoVpXNTLKC9Ls7Z6bPlG9gYxLtA5OPO16ncdwN7bcYQLYXUd0NH0ap4s P3/H1XgnfSUN2QR7zzw== X-Proofpoint-GUID: s-IjA5MlboPapMMA4UiJmAB_wepk6A68 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-20_02,2026-03-19_05,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603200112 The LTC2305 is a 2-channel, 12-bit, fast ADC with an I2C interface, compatible with the LTC2309 (which has 8 channels). This patch adds support for the LTC2305 by using the chip_info structure to handle the different channel configurations between the two variants. The LTC2305 exposes 2 single-ended channels and 2 differential combinations. The LTC2305 requires a 1.6=CE=BCs delay between I2C write and read operations, which is implemented using chip-specific timing to avoid affecting existing LTC2309 functionality. Signed-off-by: Carlos Jones Jr --- drivers/iio/adc/Kconfig | 6 +++--- drivers/iio/adc/ltc2309.c | 23 +++++++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index a9dedbb8eb46..791a1ac594c2 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -915,11 +915,11 @@ 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 LTC2309 and + similar low noise, low power SAR ADCs. =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 4ea25873398c..179ccc780219 100644 --- a/drivers/iio/adc/ltc2309.c +++ b/drivers/iio/adc/ltc2309.c @@ -108,6 +108,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) { @@ -175,6 +182,12 @@ static const struct ltc2309_chip_info ltc2309_chip_inf= o =3D { .read_delay_us =3D 0, }; =20 +static const struct ltc2309_chip_info ltc2305_chip_info =3D { + .channels =3D ltc2305_channels, + .num_channels =3D ARRAY_SIZE(ltc2305_channels), + .read_delay_us =3D 2, +}; + static int ltc2309_probe(struct i2c_client *client) { struct iio_dev *indio_dev; @@ -188,7 +201,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; - ltc2309->chip_info =3D <c2309_chip_info; + ltc2309->chip_info =3D i2c_get_match_data(client); =20 indio_dev->name =3D "ltc2309"; indio_dev->modes =3D INDIO_DIRECT_MODE; @@ -209,13 +222,15 @@ 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 }, + { .compatible =3D "lltc,ltc2305", .data =3D <c2305_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 }, + { "ltc2305", (kernel_ulong_t)<c2305_chip_info }, { } }; MODULE_DEVICE_TABLE(i2c, ltc2309_id); @@ -231,5 +246,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 LTC2309 and similar ADC driver"); MODULE_LICENSE("GPL v2"); --=20 2.43.0