From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (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 68B6B437135 for ; Fri, 24 Jul 2026 14:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784904459; cv=none; b=Yu5SVtmg8cfUKp0Nb2HNagW1hObP0Hrh+eqV7Rh1r0OOi2uT9/yI6q4jXxSdcSHuAFPp5KgSHDEoBhlO7Qx/8J1VbCcekOWB9wtmXquc+qn700ThSyUtBcCH/5+dWA0NiwExccLDrIu9DeFZx/Huuz+ZI6v5N+MIIw12dvhGgaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784904459; c=relaxed/simple; bh=Nx87VYJM0REWWok6Rt3R7OhjA0KYcrlavwA8aaReBlo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EG4Zge9LM87PuS6Z4pgGfZUnnM3d0ZsKGPp89te6yWx2ACASHYDko/LuHY0WLqnHvb9zala/dpwOsPwZsyGutyjwEQixS0Q7rZl0+ZI+0L3cWcqBJyt3K/4zy7ShM+XyTogva1hD9GFRvLZ6ylWsBPd2use3mKEyfU02VEXkNG8= 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 header.i=@baylibre.com header.b=g9UZy27I; arc=none smtp.client-ip=209.85.161.53 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 header.i=@baylibre.com header.b="g9UZy27I" Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-6a116bd18ebso300700eaf.1 for ; Fri, 24 Jul 2026 07:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1784904456; x=1785509256; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=dRlF3IQQlS/Ntedp5kuuB6fxxHvV2JxB/PlK113cVg4=; b=g9UZy27IS3bGwUcfcBSSVlxqa+oj0k+Oh50JuGxEoI8TgqXXkkcrMgNW339Bt1s9o8 u2cDnJrhXEkO3FepUORYO3ekqQCqKc8qxglvH6dUIsX37Ac1tsWT44aBXdsAYwkcU51N WHDAzyQKUjrgHzkXxPCIDGWvHsr3SQf8mDa0/CZXsYfd+FWYrfcF45ZPVRZ3nEe1BERw uPKHMJbmLssc5pPKfFT87ea3GYQyRKOUOneaGkoda45daxgcLpA1DsDpLEHYiQhTqh0m 1+yDKAfmVj4it07BhWosNu1Rf4cs777pBvUfszCXzKk87Ot03OxFvxam93dxjlEP4ZTw DSvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784904456; x=1785509256; h=content-transfer-encoding:content-type: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:content-type; bh=dRlF3IQQlS/Ntedp5kuuB6fxxHvV2JxB/PlK113cVg4=; b=c5cGvhp5S1QocCMcCvrjR/gT/q8gTVdqz6QRPBOId+cvlrox7uVYHtimG9DtuIpThN 18J10fzHuDrRupHp358ALWQC1mgLIhMdK0WGbBBF3IuWaAha7EISSQpE43x6ACnsvRln y8eGcqECeeyD3hUfCun/NR6YoAAiuJa+qesZgmtJ8V1acDckDJJGA65fg4SjFEwzGgBm RYdH3rsCxikYHdd0ugeUKSqleAxKsWPSHkKWbigP4I25YSgxgZekccKCKVva8izw3neS ABB/lph/zkVXHU2N6eo0Hj3wsaFzyvJMCxCSE+uksWFh+SbQQwVFO3nGa20IXVHeZyeF UlKg== X-Forwarded-Encrypted: i=1; AHgh+Rqh32r/v5NpcvcirrYfv2WDXaT79bFkpnUNypKGItto5n0XRoAbUCthF7zkLQbOzTb9riEfkOi66Qzz5o0=@vger.kernel.org X-Gm-Message-State: AOJu0YxFrLbjBtQdscUcVrmwsLbZQiivrfh4j/6zLrNfxo6M8asfCc5M fUZC5I8O/IuTlt9XUNW961NdegMkB2BVP6FGftFipZpiSILtuf0zogocvRzcbDtN294= X-Gm-Gg: AR+sD13ReFQO9jbS2kLLUVi163089RvkwQRYq+T1iuQLmkAQr2gIYcwkcFk7baOuyM1 1LRI+Wn5lck1/q92B8fB+q3OlHRWbOzqvXgYp3HY9GnzcU6/jREWm9pn2ACu8TcQAeEMvgbFKl4 NXUHIxK59N6HGRumkGQt7SyyH5DAjbTpqXB6MPa7YWZx7jgSub8qWPo8DHeQ80WGFccbtCXcKXd ipgh93gXNMxQ02TbT+RhzoJL1DEEDTaXgXCcjw9DOxqXdOv4r9g0v4q/0zhSvDhDDL4ROrLpqq0 9NSSbhPHn9t+84IA2S6P3hHzitR7logFthTY6j71g6GFq//JYVGXJly+/qVhZKRfnNs6tkvIBS3 RMfXvep4rMjOc/ryAv9nqjF/x+kGWugv1KxHt2ED/VR2h1a1EAJKwpskPj5DAGTpuJdVgztFfIs zTdJAkI6vxTSdXHEwdZ8ZvbtTnEcnIBwRddR0vUtuk88UpXWXptVc6QrKNYHnE X-Received: by 2002:a05:6820:1c97:b0:6a1:8b23:d4c8 with SMTP id 006d021491bc7-6aad3f90dd2mr4667159eaf.3.1784904456312; Fri, 24 Jul 2026 07:47:36 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:b635:d463:c98:cc75? ([2600:8803:e7e4:500:b635:d463:c98:cc75]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6aa79301fe8sm5634326eaf.10.2026.07.24.07.47.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jul 2026 07:47:35 -0700 (PDT) Message-ID: Date: Fri, 24 Jul 2026 09:47:34 -0500 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 3/3] iio: adc: ti-ads112c14: add support for buffered read To: Jonathan Cameron Cc: =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Chris Hall , Patrick Edwards , Kurt Borja , Nguyen Minh Tien , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260714-iio-adc-ti-ads112c14-buffered-read-v1-0-fe6e1c971288@baylibre.com> <20260714-iio-adc-ti-ads112c14-buffered-read-v1-3-fe6e1c971288@baylibre.com> <20260720015527.0ccc543d@jic23-huawei> <7a600363-ae61-48db-a0a2-34b9a4919b6d@baylibre.com> <20260724002508.7e176510@jic23-huawei> Content-Language: en-US From: David Lechner In-Reply-To: <20260724002508.7e176510@jic23-huawei> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/23/26 6:25 PM, Jonathan Cameron wrote: > On Tue, 21 Jul 2026 18:23:58 -0500 > David Lechner wrote: > >> On 7/19/26 7:55 PM, Jonathan Cameron wrote: >>> On Tue, 14 Jul 2026 19:19:32 -0500 >>> "David Lechner (TI)" wrote: >>> >>>> Add support for buffered reads using a triggered buffer. >>>> >>>> The device has a continuous conversion mode, but that can only be used >>>> with one channel at a time since there is nothing like a sequencer to >>>> support that in hardware. Instead, we use single-shot reads like we do >>>> for direct reads to be able to read multiple channels. >>>> >>>> Support for continuous conversion mode could be added in the future if >>>> needed via a 2nd buffer. >>> >>> How about enabling that if only one channel is requested? I vaguely recall >>> us doing that for another driver (though I might be dreaming :) I did >>> see your comment in the cover letter about it affecting timing and that >>> making life complex. Fine to leave considering this for another day >>> but maybe don't suggest a particular solution here. >>> >> Actually, my latest thought it to do it by trigger type. This chip has >> a DRDY interrupt that can be used as the trigger for the continuous >> conversion mode but we need some software trigger to the single-shot >> mode. It think this would take care of the timing issues as well. >> >> The logic would be that if the self trigger (DRDY) is selected in >> the trigger/current_trigger attribute, then buffered read will use >> continuous mode and fail if more than one channel is enabled. If >> another (software) trigger is enabled, then use single-shot mode >> and allow multiple channels. > > Hmm. Bit unintuitive but can't really be helped. > >> >> The timing issue is that (or will be since I haven't sent the relevant >> patches yet) there is a settling delay before the first sample. For >> single-shot mode, every sample is considered the first sample (because >> it is "single"), so the chip applies this settling time on every sample. >> So it might be good enough to just document that as a quirk of software >> triggers for this particular chip since they would be using single-shot >> mode? >> > This is where it gets messy if settling time is reported. I guess acceptable > given it doesn't make that much sense for an external trigger anyway. > In theory if the settling time has to happen each single shot, we could > just merge it into sampling frequency (as no longer depends on whether > channel changes or not) but then we have to make that dependent on whether > it is the devices own trigger or not. Messy. I guess one to paper over > as a quirk / corner case and document as you say. Yes, this is the direction I am leaning as well. The input chopping feature that we have been talking about has a similar issue. In addition to doubling the sample period, it also includes the settling time (2x as well) minus a few clock cycles. Even messier.