From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 D40C23FE4 for ; Mon, 20 Jan 2025 14:15:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737382538; cv=none; b=ImFIrOfVfF7WCtiNJTI9Mi4JGsK0XhRSdxYSiVYRyFmwJub9jfQOT341HqgSg6HeW21xoh6A7EmwstqZk1poK8Sm1e6ESJ+AVpi1G4mKW7yeQzq2hVIHWwAEhrJL5UmBSdFecULpp3sKWuY/ZBPlxRtsvoEz7DQ4LbSVhF91LeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737382538; c=relaxed/simple; bh=Zsp71q6Rc0/Nhkg1Zve+/HiaQ5Vh0kbI2OZpw7dmjdg=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=bzPbwULYMyqYmldIXdwxZC3rnwpfh030PgInViURp521mopGlnfk9Ss1yZChPnoqYaWrqfVbbo8CUdR8kZ4RJLV9VJeJLRiJowkPempXulwN7W+T8AUEvLW18EZL9NVxXzrtDzSz084UBb76mT1Nl1RKr4ZLWLqUpCU3TF3I9Ag= 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=FLqoRtuL; arc=none smtp.client-ip=209.85.128.49 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="FLqoRtuL" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-436202dd730so32253375e9.2 for ; Mon, 20 Jan 2025 06:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1737382534; x=1737987334; 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=D5slyFhFFg4eXgNrFHDN5dqCXylxctmjvDX+b8DDkEU=; b=FLqoRtuLMSMA33g6QhKTKdQlqALcN5kAjA4vM65Y1WnXWNBEUAmCWlfzoTxc7Ykstg Ew9E8zLAq+JrLixGp82Ms+EThaKpMiSedVVhrxES5HyPkXQB3FMlMrh/wzJy+RbMemtE TjMCIZLgmV0B/otWPuekGzJL9r+EGKGEwDjUE9RVjSyPvGR+x9NHA1JeHzQGNpeSVg6m Dy1Tuc/7WL294HZExQvpXfPJaf59TuYWWzqcsL5z6TLbgDbS7SbKmvlve06wbLm88vHM T79++8S0bQO3gTYxrYbTct4hbSNz3ig60suDs59FabjsGfevQoJ+JqLpZmgtw2QfXxx/ 0M6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737382534; x=1737987334; 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=D5slyFhFFg4eXgNrFHDN5dqCXylxctmjvDX+b8DDkEU=; b=KgCEbw6IqEA0qcBOMtuf272CK9T28U5JuSXeiZRBZy0DLBd2YZ6DxWmTtPZnCH8ybG avldB2ccTd4Sy/aK7uTg8ZCGxC8F4bA1w+p+pFrbZmzZHPevC4WRx5GdtmmdjUaFjIMp WBU68uhOgkCTXYfscOJog2KDBrOZs6RsAgEPpTLSHIeVwLfqSk1uL4cwm7WRIACjgYjL 6O4LAV/RmAjqq1No0Bfgyt6u8yWapmMRj0fdm1BhBayz1GfMNhufQ+lc6x5Yz4OFTak2 PIx91GpDkQCyUqDJYM9RtZWRwbCvzn9ANoROtUXhB8HsvcOHCuE41urmh3ud1kmnC1+w p3HA== X-Forwarded-Encrypted: i=1; AJvYcCUWh7iO8LDOk9g7MKMdQvLybEMPsElvW1Pkjd7PTlhkMUZct8NJ9dDQ3i7mVuuZC4IBFrM+HmPmjsMQgdY=@vger.kernel.org X-Gm-Message-State: AOJu0Ywrly9OU5HY+V6JEQHKuLKwSPwbHS3adokD7NFxuK2CfVMd/NUJ udH8JVe2EMJlOQJE37FmksQIm/NI7aVfaScX/UIRUA27ysv1fjzNAg3NNvF6Qbo= X-Gm-Gg: ASbGncvbjgUeDXMXaK5JzHB046abVhNDHuq0YiXd9c6Pfy+TzcFuwELbYRtmYE2EYg/ lk4vwMpfrbIDwGgQb+qT2JCY9JrKecn/alkR9fZaXEbvpO4zoTvr/LX7dSXlG3DxLyw+7OL5aZo 6oq8M/rC57MBk6ChvherXFXXTM/yhd93DnYJZKNoAGOR+PRmiNupo7QewPGXP7aHjQOV27ZyopV RtKpwt0txNcSk0QCRdo/Cq53mP7DKKjypj9dLsJFW8Q9eW4DcGj1hbKw8viBUOx670Tn9xAe3of jrt4Mh01G0/zVgasuRyTV3T9uHneAP0W4CNSU1CC X-Google-Smtp-Source: AGHT+IHFUycdZuUdNNL2CNUC3XjcWOrzCZ8rDoxNz7si90lttH6MVmvHJw+OO2r/Obhpa15FEiwyrQ== X-Received: by 2002:a05:600c:1f86:b0:436:aaf:7eb9 with SMTP id 5b1f17b1804b1-43891439d5fmr111420395e9.20.1737382533794; Mon, 20 Jan 2025 06:15:33 -0800 (PST) Received: from [127.0.0.1] (alille-653-1-300-114.w90-1.abo.wanadoo.fr. [90.1.180.114]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438904621cdsm141233345e9.27.2025.01.20.06.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 06:15:32 -0800 (PST) From: Guillaume Ranquet Subject: [PATCH v4 0/2] iio: adc: ad7173: add ad4111 openwire detection support Date: Mon, 20 Jan 2025 15:10:05 +0100 Message-Id: <20250120-ad4111_openwire-v4-0-e647835dbe62@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=H4sIAD5ZjmcC/3XP7WrDIBQG4FsJ/t4ZauoSwxi9jzGKH8dVWJJOb ZZScu8zlsK6br/kVXzec84kYvAYSVedScDJRz8OOWweKmL2anhH8DZnwinfMMYEKLueu/GAw5c PCCiERa1aLhtH8q9DQOfnIr6+XXLAz2OG0+WS9BijKnBXPd+6886oD6+DSnkMmBgwEK7l1DotT Eu3Wp3WZ3w0Y/+ytmkVEXLofeqqAecEV5Cs5Xsf0xhOZbuJlfZ/FyltVstGmVY7Lm7bCjfxKyE oo/Ke4ECB1g033FqkBv8g6h8Ee7on6kygkphHkNoy+4tYluUbvM4raLQBAAA= X-Change-ID: 20241115-ad4111_openwire-e55deba8297f To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Guillaume Ranquet X-Mailer: b4 0.15-dev Hi. This patch adds the openwire detection support for the ad4111 chip. The openwire detection is done in software and relies on comparing the results of two conversions on different channels. The openwire detection on ad4111 is triggered automatically when a single conversion is requested. Due to the way openwire detection works on ad4111, implementing openwire detection for continuous conversion mode is out of the scope of this series. Following discussion on V2, I have changed the event to be IIO_EV_TYPE_FAULT and added a direction called IIO_EV_DIR_FAULT_OPENWIRE to signal the specific fault. The fault is level triggered (ie: the event will be sent as long as the fault persists). There's no event to signal that the fault has been "fixed", an absence of FAULT event means that the open wire condition is not detected. Thx, Guillaume. Signed-off-by: Guillaume Ranquet --- Changes in v4: - Rename IIO_EV_DIR_OPENWIRE to IIO_EV_DIR_FAULT_OPENWIRE to make it clearer the OPENWIRE direction is in the FAULT "namespace" - Removal of the RFC prefix - Link to v3: https://lore.kernel.org/r/20250116-ad4111_openwire-v3-0-ea9ebf29bd1d@baylibre.com Changes in v3: - Rename IIO_EV_TYPE_OPENWIRE to IIO_EV_TYPE_FAULT and add IIO_EV_DIR_OPENWIRE. - Remove per channel open wire threshold configuration interface. - Link to v2: https://lore.kernel.org/r/20250109-ad4111_openwire-v2-0-0372c2dde0ce@baylibre.com Changes in v2: - Introduce IIO_EV_TYPE_OPENWIRE instead of misusing the IIO_EV_THRESH event. - Link to v1: https://lore.kernel.org/r/20241115-ad4111_openwire-v1-1-db97ac8bf250@baylibre.com --- Guillaume Ranquet (2): iio: introduce the FAULT event type iio: adc: ad7173: add openwire detection support for single conversions drivers/iio/adc/ad7173.c | 166 +++++++++++++++++++++++++++++++++++++++ drivers/iio/industrialio-event.c | 2 + include/uapi/linux/iio/types.h | 2 + tools/iio/iio_event_monitor.c | 4 + 4 files changed, 174 insertions(+) --- base-commit: c849f534b9ea4688304f80f4571af75931dda7c1 change-id: 20241115-ad4111_openwire-e55deba8297f prerequisite-message-id: <20241115-ad411x_calibration-v1-1-5f820dfb5c80@baylibre.com> prerequisite-patch-id: 26241903b8fee8c4243e73d11fb2872cd9f52a15 Best regards, -- Guillaume Ranquet