From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (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 95FF31DF276 for ; Tue, 7 Jan 2025 08:48:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736239711; cv=none; b=B8MBApFxDnYUYu2l6CE5snQ9Mu+AunoZkidcHTNBor/GKChAnjj0AiTbZhjRzkBifDC+MLZUqx5989EjLXcGhfPVcOOiTkRvZ0m/3vMoQh2Zlb3pL/zQIyWlqvZYnnwRexPXYf61MwhpPT9It5Zv5dE00SyPeXZbjz+4j7SLTc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736239711; c=relaxed/simple; bh=JScDeqYbIVgdtvzMG6HJz7Q+oqkApB4u2j+TWaPzgQw=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=UkOQDEa3YaoYOE+ZLDjNnKSyAVgm39cHK9qay9H68kXBCItH+A/auYgWCcSTwfA+KDqcFLbH0YD++gSHLU8NIxtnD1ejOsPLN+rIBSKqKecAMwqGeR4COpbk2ja+d6bvDAicWhMQjDigRgeJ9SflcIYeth0XWhK4sV6GtmDDbjs= 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=Y6vAod/9; arc=none smtp.client-ip=209.85.221.68 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="Y6vAod/9" Received: by mail-wr1-f68.google.com with SMTP id ffacd0b85a97d-385dece873cso5649118f8f.0 for ; Tue, 07 Jan 2025 00:48:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736239706; x=1736844506; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=9ItiK4KQmv9BFEgfm1xUxikYdoeP+k/ONB82cnNZD4I=; b=Y6vAod/9DK8x6lgzZVd8nwPX+mzhIvKx0HF5wLpGwu/HjSc6huWwVGq55nFsE/2L2k bDk27FU1n7Ar7wAd3wsWwwc/ilRbBkD3YDxCGgbJMt5mlIZlFs2MyoctkfV0+VXsORQP QdAldbRfmbzwk4H+WUyI+gL1Dyfk5zEjmcamHMM8IhDxVeEWccXefrY6NVYBf6uh1SFf jQMITWvJEh5DvdkZZxLq6fVfcujM00g9RijNUZBBq2gLZJQyP4PSjqsd7NiZ4AY+lXFH 46AA3ef7IIquz00wmq0YHNCIIuCd+HFJ0IrwddljQnIq/IW7upx7IglOnQnIgdJoFt0W bvuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736239706; x=1736844506; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9ItiK4KQmv9BFEgfm1xUxikYdoeP+k/ONB82cnNZD4I=; b=eFRHVHmlQEHQpRV7IrxX64JaDQh/jtO3iVKd4VhAHrw8oGFmoxcw+42+gHD8VMiws3 Y59vFVOpBo1DWl5DlBkQ7T7c67IUWnfVir79c5E4VQVl1IUufL5v301QhmbudodpaBs7 4VnXtRptIavNCsFuIkrxt+o31hKjOGbZr1vyiCprVFvZM8ufYJm0v6QyN6VCkLDG/6tw E5OKWRxQ6y93E1HaBj874RKucqBYKLWtthU5swrWHxVYIYqLmLuyNEiH7NC9ArSeWopK TakZv2YxvaYmRDswSrX32f58vS8gon6+hsh+vyEgxE85QEt8kS60PO1k/wOVoXVsQl0I 6ahg== X-Forwarded-Encrypted: i=1; AJvYcCX87jw6DTyvFEY3fE99uumUxF3/mckWmCYmuP46A3gAmMBZpC4XgRrIi22BdM8D9rsmE6y/GBLF0TFUzpE=@vger.kernel.org X-Gm-Message-State: AOJu0YzrNBmyO5XtCuo1t2l41pfIcHVNQXHFmSKUerb7+u2/DsRnpVKp K0KtDs1rK4WRYr3eJQsDpieh0kDwlQLVKlFBgugmUkvnO1Nrj41tmWBnLKJJDBo= X-Gm-Gg: ASbGnctzROpc/8JS6/QzUyoRipZv+96znk6FEO52zjXTZD4fckF1QLceS/wwBuKQ3BY /Kj1cGlEjCGifehN8ZfZ7kCbfXGOF0H4WGAJLG4f52zi3x4PrHnop/O7NjhwcSLwn8nEliz3IFZ c+ZQH9JJS1zD2vmbI9RUeR852E4VjM05XZuCjn/BVSBP5gDS5eJk6VGePbygEParz4QZzrBas5k Rc3BZnbeDJtlEIqhhegmVN1ts71K01Ohk4Q3Uq6Zk0JH/KEGKsyLptK6EhyTZdzHUsiYSjhSKby 3Snb7dWVDUJuw8tMnzs/tAz9ooQU0Fd87LDBKJufU6iMNOwY3Q== X-Google-Smtp-Source: AGHT+IEbBLYRYCCKspoyVREKqnRmx9SNp7XWgbWQMLHo9S6x46APPiifoVfwToumEY7p9eUH6PnFnQ== X-Received: by 2002:a5d:47af:0:b0:385:fb66:faee with SMTP id ffacd0b85a97d-38a221fa4b5mr43671082f8f.18.1736239705779; Tue, 07 Jan 2025 00:48:25 -0800 (PST) Received: from [192.168.1.62] (2a02-842a-d52e-6101-6fd0-06c4-5d68-f0a5.rev.sfr.net. [2a02:842a:d52e:6101:6fd0:6c4:5d68:f0a5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c828817sm50722280f8f.1.2025.01.07.00.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 00:48:25 -0800 (PST) From: Julien Stephan Subject: [PATCH v3 0/5] iio: adc: ad7380: add alert support Date: Tue, 07 Jan 2025 09:48:24 +0100 Message-Id: <20250107-ad7380-add-alert-support-v3-0-bce10afd656b@baylibre.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: 7bit X-B4-Tracking: v=1; b=H4sIAFjqfGcC/42NTQ6CMBhEr2K6tqYt1RZX3sO46M+HNEGKLTQSw t0tuCBxYVxN3iTzZkIRgoOIzrsJBUguOt9mKPY7ZGrV3gE7mxkxwjglrMTKikKSHBarBkKP49B 1Pie3xNqTASWNRXneBajca1Vfbx8O8BzyQ7+VtYu9D+N6n+jS/vGUKKbYkuJYckK1kPKi1dg4H eBg/AMt3sQ2F2P8h4thgoWRpWa6EkYXX655nt8tI0KqJAEAAA== X-Change-ID: 20241029-ad7380-add-alert-support-4d0dd6cea8cd To: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , David Lechner , Jonathan Cameron , Jonathan Corbet Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Julien Stephan X-Mailer: b4 0.14.2 Hello, The ad738x family includes a built-in alert mechanism for early detection of out-of-bounds conversion results. This series introduces this functionality to the ad7380 family. This is the first non RFC version of the series (RFC available at [1] and [2]). Given the fact that the main use case is to hardwire the interrupt line and according to discussions in V2 about interrupts, I think the best is to not generate events, at least while we don't have a reasonable way to correctly and efficiently handle interrupts. Events attributes are still populated to allow user to set a threshold and enable alert detection, so alert pin can be hardwired. Userspace event can still be added later if needed. [1]: https://lore.kernel.org/r/20241029-ad7380-add-aleyyrt-support-v1-1-d0359401b788@baylibre.com [2]: https://lore.kernel.org/r/20241224-ad7380-add-alert-support-v2-0-7c89b2bf7cb3@baylibre.com Signed-off-by: Julien Stephan --- Changes in v3: - split regmap cache commit in two - remove interrupt handling completely, updating commit messages, driver, and doc - fix minor comments from v2 review - improve commit message for iio_device_claim_direct_scoped removal - Link to v2: https://lore.kernel.org/r/20241224-ad7380-add-alert-support-v2-0-7c89b2bf7cb3@baylibre.com Changes in v2: - fix read/write high/low thresholds - add reset_timeout mechanism for buffered reads - implement regcache - add cleanup patch to remove iio_device_claim_direct_scoped calls - add alert section in the Documentation page - Link to v1: https://lore.kernel.org/r/20241029-ad7380-add-aleyyrt-support-v1-1-d0359401b788@baylibre.com --- Julien Stephan (5): iio: adc: ad7380: do not use iio_device_claim_direct_scoped anymore iio: adc: ad7380: enable regmap cache iio: adc: ad7380: do not store osr in private data structure iio: adc: ad7380: add alert support docs: iio: ad7380: add alert support Documentation/iio/ad7380.rst | 32 +++- drivers/iio/adc/ad7380.c | 394 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 369 insertions(+), 57 deletions(-) --- base-commit: 5ab39233382c621d3271cc274d1534e1b687f4d3 change-id: 20241029-ad7380-add-alert-support-4d0dd6cea8cd Best regards, -- Julien Stephan