From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F50C182D2 for ; Sat, 22 Nov 2025 00:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763769748; cv=none; b=XmvBtIjkHngN+WXrcihbUKyYSUgYoJGiSoSVPlxTdSDtqhp+Mx7lvybNHpbYjbn2VFb/gb2RQTt5YW5/thxBfkxqgPRzLAmjpM1Ee7M3H19ZX/wSbkmPI8zRac3dO1AFtXl9qfaAHrbrAlT75pKX+ln2fuE7rf8YfisDsrC+DyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763769748; c=relaxed/simple; bh=5vU7V0qkV7PYCF8w381451NvEsq2oDT+U7h9SYJ20ho=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CyNiF9aCtiNouoi5hwa7dg/sJ9T6OZ0FEJGLa/LR9imsuYI1OiU2jdOITmgJ2rE8GZdWVZ0FdYHf9V83EQuy6ttWEkmhhzz+nFR1QoZ6NxB9w2CAf/8qUxGg9dKRvPJ9c7bKfPcqwCUAYJA7yCvk/K+5dp9jGNyOffjXYUOfdr8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=SOuvgd0d; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="SOuvgd0d" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-7c765f41346so996215a34.3 for ; Fri, 21 Nov 2025 16:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1763769744; x=1764374544; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mSMsM4wD+eNEn0K9vsPH/4otzNTJFdNd3NAiviSltNg=; b=SOuvgd0dvXqw/cOlwn56g0plfbXTJ9V0yfXitwPAcmM7aZ+FKE4Qpqc1A84oxAuiq4 UkJeXXpxoS85CbP6FQ0x3FBEj9imu8MdqayuTEVpDZ9k1iXMqZbUP2ImtrGVY0mkzE5z fQn3aUglG9FZoKBd+PEaehgbA/GSxkDi/ops18poREc3d9gT0JwMchMlNeikSe04Uvc4 kthcH/ETCv+nkfPPkjjEnDWeyvUAoR21M1ytGYHzMiHYH9dCfPt3tPU1QLG5cer/5xx/ L1fwwiz8VpieulgNVrfU+Upm5yotoqMfeZaTy1Cz+ZYu+O75+PAEPe/jrNnelCHfbkUW S6Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763769744; x=1764374544; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mSMsM4wD+eNEn0K9vsPH/4otzNTJFdNd3NAiviSltNg=; b=uSbm2Q5TWH/i5lYNwRiqhe4SG8ojCu6p/4n7MkIfwiJzULo7z1TV9uWw10YZdXL2gS yHdZb+6CzjoUAdXNd7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XHXNcD4yt6ZyVzUxTAn4REi1Ka9mpoOr0PorXQOzuvjp9nALLHrKdDLmJjWXEQ== X-Received: by 2002:a05:6830:2707:b0:7c7:63b6:89d3 with SMTP id 46e09a7af769-7c798c4e5cdmr2058906a34.19.1763769744080; Fri, 21 Nov 2025 16:02:24 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:e782:93d8:7c2f:f9df? ([2600:8803:e7e4:500:e782:93d8:7c2f:f9df]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7c78d3e2e59sm2854198a34.17.2025.11.21.16.02.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Nov 2025 16:02:23 -0800 (PST) Message-ID: <986c47b4-6093-4e6d-aa4b-8d789e497dbc@baylibre.com> Date: Fri, 21 Nov 2025 18:02:22 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] iio: Add support for TI ADS1X18 ADCs To: Kurt Borja , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Tobias Sperling Cc: =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron References: <20251121-ads1x18-v1-0-86db080fc9a4@gmail.com> <05fae891-a4e6-439d-97da-6259370f68b5@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/21/25 5:28 PM, Kurt Borja wrote: > Hi David, > > On Fri Nov 21, 2025 at 5:32 PM -05, David Lechner wrote: >> On 11/21/25 11:16 AM, Kurt Borja wrote: >>> Hi, >>> >>> This series adds a new driver for TI ADS1X18 SPI devices. >>> >>> This is my first time contributing to the IIO subsystem and making >>> dt-bindings documentation, so (don't) go easy on me :p. >> >> I actually had these parts on my radar, so happy to help you out. >> Unfortunately, I don't have the hardware for testing though. >> >> The first thing I was going to do was check the existing drivers >> to make sure that there isn't one already that has a compatible >> register layout. I have a feeling we won't find one, but would be >> good to mention that in the cover to justify adding a new driver. > > The closest driver I could find was the ti-ads1015 I2C driver. It has > the same register map and similar specs. Although I think we can adapt > it to be "compatible", I chose to do a different driver for a few > reasons: > > - ads1015 and compatible devices have a separate DRDY interrupt line. > > - The ti-ads1015 driver doesn't support the DRDY interrupt (sleeps > until data is ready and it doesn't have an iio_trigger). I don't think this one is a big deal. Ideally, eventually both drivers would support operating both with and without interrupts. > > - To correctly handle the DOUT/DRDY line we need to manually control > the spi_bus_lock. And we do it differently based on which IIO device > mode we are operating on, so it would be difficult to stuff this > logic into regmap_bus callbacks alone. > > - IMO the end result of merging these drivers would be too messy. This one I agree with 100%, but for different reasons. ads1015 is I2C and ads1018 is SPI _and_ regmap is not a good fit for either of these. Mostly because when reading sample data, we need a custom SPI message to read the data and write the setup for the next conversion at the same time. And ads1018 only has 1 register anyway that isn't 100% identical to the same register in ads1015. > > This is just my opinion though, so let me know what you think. If do > agree I will add some of this points in the patch changelog! > In the end, we both have the same conclusion.