From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179]) (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 26DA8157487 for ; Sun, 18 Jan 2026 18:16:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768760209; cv=none; b=laDQZP6SNU/Lf8Nsfw0+bpZ5jTMJV/TccjG72J3yAhtH4EG0noI/Y59BjVqLuZaPqtAqmO2QTWWmGwcAdaDIZhnd3z+yUQI8DL9QDwZGHRY0NjWOT+3bET+pLwLoLz4/reUZlYGIpOCxiuxPcXyJ7iYWt8itpPrrQPqTbueMqr0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768760209; c=relaxed/simple; bh=iB0/4hF5veoSF+PlSaugXG6VudDoIwCeU5fV15WMNQs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=kpT5+H25TG5C/y99s8hmfmIhEX59h9lMQ/FwtiTrovqO67MQiKCrKpVJnHWNBZ/8Bb4Acba/kHNqcvmI+GnM0wNAvJ374EdRYhV7imPIKNyAeno+lPa9AeIoCrweGbs7hqFPMuTZvS6QOsVBhCvft3T7T1146ikRIAHUG/Fsm38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bnDUeSD2; arc=none smtp.client-ip=74.125.82.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bnDUeSD2" Received: by mail-dy1-f179.google.com with SMTP id 5a478bee46e88-2b04fcfc0daso4233045eec.0 for ; Sun, 18 Jan 2026 10:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768760207; x=1769365007; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=dVYBBkubRi7EdkLJ1LoOm8/Bg0yODBTjsMSrjuUr85U=; b=bnDUeSD2cLOxjuE1KwABx8Zq51+zAt/yH5YJ+hQbdXqGtxS5VrgnpNIERNfwh7t2mE S7VtdvUFiwPrBqyvPiVIsFk1CQu4++YCrIJh8tgfvhuRSQ698eJ6lD33vnStmiE2msUt iTTTIEu1yq+cVFL8vewuK+Q0EOPO8ImpzmoVGK36YAyCVpAdDTg8WCQ+vNVvZnEcjqkI HUC8A1Z/QS/Solc+LvxYJycgZ23Q+50gHttfY5FUHa+kyGG7h5HB3otLdp+ZnQKngISa R2JJnflt4GK1Wzp/Wv0kXEDYAsXjiKU4M01TOYIZqSpzPA6Jcq8w3xg+NQqqUM+yhV1l zbkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768760207; x=1769365007; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dVYBBkubRi7EdkLJ1LoOm8/Bg0yODBTjsMSrjuUr85U=; b=xC9SRy6Uo5CZN2ZNPde4+CJgU3JE9zvTFxu/Q7OSxJAUXlD7ywW0cDVYGhNNyoIiVO hdOkEQ2RHVzZJ1S+Q8UkEUTbSbQS0FZUmt66EYLgPXsb8sQ1xqxRUPcbMTErSESFNSP7 +Q1I2wAl6HRfzsw/Zj/uRnVHluVw8noyH8UGs7NwnXBpNn/eVC7MSo/5xJTgbgD7QyBI a+sQt7XXOrG51Nxe+zNEhtmHMqjOSLrVr29J/L/+jeEzVUa0ls2yieCuEAlXFVfnGb6t YGy79soWEu4Z/eeR5A5jr/Mk5IDNkmB928vGPy8SR0MqPWZ2Q7IuUNXGiPsUtxVcgCa3 0NHg== X-Forwarded-Encrypted: i=1; AJvYcCVHgavEI7i2intYLmJsOlcrGdN7waCVsQU2aPOfD40KFjcM7zi8NrFUQPiODLpXd4tr3LO8ACktqcYdvm4=@vger.kernel.org X-Gm-Message-State: AOJu0YypMiRPdgvuG3kmg5joGl1+NVm0amuhMIf+EYpAex6G1AsOxa2R DS3AtLgH4CPmgTx9yqw55z+vp5rv+QYYbvjJYBockiJZ4t3fWpe2YN3x X-Gm-Gg: AY/fxX67r6b3m8zJh0YDGauGHF2h7/3ApIogmklxvpZLb/Oyvbst9YIJe5qp2pzcNCQ bGmymsGbWn1dqb82GIMS3NLYrxw4V+GLDCNaeMn8/suOFjMEtbvId5ClIyvkHPbpMCLnERHNZYA yg5vV2zleohJtTEMBlM8p+iDLxJtX7s0MnyffeFuomKjYMWdyb3hsUtWZmGvBLDyFqB30Wnvhha CdPzDTaHcKkUc32KhfQzFDl+aPjtbHGQzFzGrGho4We546dfMsZ84k5Sq60VMgJnMgK94CRYKxt yssGvilXnDuZ5QeCMLTaSZ0CLj6xPIc8bDoCUN4diiHj0iIRq057Bdq/0HcMIB/qycaUMSpyKW6 8Jrvv5PFHrphNOmztuaoj4M1sW240L9HLvK3yyMwz7n4XyT/n4R1Upx4IcrO8S964w7edvVaMwJ pd7hFyC/FOWe5USSbjRn4= X-Received: by 2002:a05:7300:690a:b0:2ae:59d3:46d3 with SMTP id 5a478bee46e88-2b6b40f3892mr8462070eec.25.1768760206992; Sun, 18 Jan 2026 10:16:46 -0800 (PST) Received: from localhost ([2804:30c:2766:a500:b70:8c42:f792:bef6]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b6b361df88sm9825267eec.18.2026.01.18.10.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jan 2026 10:16:45 -0800 (PST) Date: Sun, 18 Jan 2026 15:18:36 -0300 From: Marcelo Schmitt To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jic23@kernel.org, Jonathan.Cameron@huawei.com, nuno.sa@analog.com, andy@kernel.org, dlechner@baylibre.com, marcelo.schmitt1@gmail.com Subject: [RFC PATCH v1 0/9] iio: Expand IIO event interface for real-world unit handling Message-ID: 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=us-ascii Content-Disposition: inline This patch set adjusts and complements the IIO event ABI docs making them coherent with the fact that not all threshold value attributes had a _raw/_input indicator set in their names. In addition that, the latter patches on this series update the IIO event infrastructure to actually enable drivers to provide _input threshold value attributes. I'm actually proposing this set just for the sake of solving the event ABI naming inconsistency. I recall the event ABI was a bit puzzling to understand when I was having a closer look at that a while ago [1]. [1]: https://lore.kernel.org/linux-iio/cover.1703013352.git.marcelo.schmitt1@gmail.com/ Also, I'm doing this set entirely on my spare time and just because I wanted to have the ABI naming inconsistency fixed. This is also a late reply to [2]. [2]: https://lore.kernel.org/linux-iio/20251109164312.781de64c@jic23-huawei/ I've tested this with ad7091r8 driver and result is: Before event extension (current IIO teting branch): root@localhost:~# ls /sys/bus/iio/devices/iio:device0/events in_voltage0_thresh_either_hysteresis in_voltage4_thresh_either_hysteresis in_voltage0_thresh_falling_en in_voltage4_thresh_falling_en in_voltage0_thresh_falling_value in_voltage4_thresh_falling_value in_voltage0_thresh_rising_en in_voltage4_thresh_rising_en in_voltage0_thresh_rising_value in_voltage4_thresh_rising_value in_voltage1_thresh_either_hysteresis in_voltage5_thresh_either_hysteresis in_voltage1_thresh_falling_en in_voltage5_thresh_falling_en in_voltage1_thresh_falling_value in_voltage5_thresh_falling_value in_voltage1_thresh_rising_en in_voltage5_thresh_rising_en in_voltage1_thresh_rising_value in_voltage5_thresh_rising_value in_voltage2_thresh_either_hysteresis in_voltage6_thresh_either_hysteresis in_voltage2_thresh_falling_en in_voltage6_thresh_falling_en in_voltage2_thresh_falling_value in_voltage6_thresh_falling_value in_voltage2_thresh_rising_en in_voltage6_thresh_rising_en in_voltage2_thresh_rising_value in_voltage6_thresh_rising_value in_voltage3_thresh_either_hysteresis in_voltage7_thresh_either_hysteresis in_voltage3_thresh_falling_en in_voltage7_thresh_falling_en in_voltage3_thresh_falling_value in_voltage7_thresh_falling_value in_voltage3_thresh_rising_en in_voltage7_thresh_rising_en in_voltage3_thresh_rising_value in_voltage7_thresh_rising_value After event extension: root@localhost:~# ls /sys/bus/iio/devices/iio:device0/events in_voltage0_raw_thresh_either_hysteresis in_voltage4_raw_thresh_either_hysteresis in_voltage0_raw_thresh_falling_value in_voltage4_raw_thresh_falling_value in_voltage0_raw_thresh_rising_value in_voltage4_raw_thresh_rising_value in_voltage0_thresh_falling_en in_voltage4_thresh_falling_en in_voltage0_thresh_rising_en in_voltage4_thresh_rising_en in_voltage1_raw_thresh_either_hysteresis in_voltage5_raw_thresh_either_hysteresis in_voltage1_raw_thresh_falling_value in_voltage5_raw_thresh_falling_value in_voltage1_raw_thresh_rising_value in_voltage5_raw_thresh_rising_value in_voltage1_thresh_falling_en in_voltage5_thresh_falling_en in_voltage1_thresh_rising_en in_voltage5_thresh_rising_en in_voltage2_raw_thresh_either_hysteresis in_voltage6_raw_thresh_either_hysteresis in_voltage2_raw_thresh_falling_value in_voltage6_raw_thresh_falling_value in_voltage2_raw_thresh_rising_value in_voltage6_raw_thresh_rising_value in_voltage2_thresh_falling_en in_voltage6_thresh_falling_en in_voltage2_thresh_rising_en in_voltage6_thresh_rising_en in_voltage3_raw_thresh_either_hysteresis in_voltage7_raw_thresh_either_hysteresis in_voltage3_raw_thresh_falling_value in_voltage7_raw_thresh_falling_value in_voltage3_raw_thresh_rising_value in_voltage7_raw_thresh_rising_value in_voltage3_thresh_falling_en in_voltage7_thresh_falling_en in_voltage3_thresh_rising_en in_voltage7_thresh_rising_en The difference is the '_raw' element in thresh_(rising|falling|either) attributes. Why posting it as an RFC? 1) ABI changes a sensitive topic. 2) There are 77 drivers that will go through collateral evolution with the event interface update. A 77+ patch set is probably not a good idea? I recall the claim_direct stuff was split into 2 or more patch sets. This might need a similar approach (if accepted). 3) My coccinelle semantic patch does a nice job in updating the vast majority of the drivers but, it produces diffs longer than needed. E.g. @@ -844,7 +844,8 @@ static int adxl313_read_event_value(stru enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, - int *val, int *val2) + enum iio_event_unit unit, int *val, + int *val2) could be @@ -844,6 +844,7 @@ static int adxl313_read_event_value(struct iio_dev *indio_dev, enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, + enum iio_event_unit unit, int *val, int *val2) I'll try to figure out how to make it generate smaller diffs, or do the changes by hand if needed. One more thing is this doesn't need to take test bot time as this breaks kernel build without the patches to the individual drivers. With best regards, Marcelo Marcelo Schmitt (9): iio: ABI: Drop unused in_energy_input iio: ABI: Accurately describe in_distance_input iio: ABI: Accurately describe in_illuminance[Y]_input iio: ABI: Slight readability improve for event threshold value doc iio: ABI: Update event threshold value documentation iio: ABI: Adjust event threshold enable desc to unitless thresh values iio: Expand IIO event interface for real-world unit handling iio: dummy: iio_simple_dummy: Update to event unit expanded interface iio: adc: ad7091r-base: Update to event unit expanded interface Documentation/ABI/testing/sysfs-bus-iio | 29 +++++++++---- drivers/iio/adc/ad7091r-base.c | 7 ++- drivers/iio/dummy/iio_simple_dummy.h | 6 ++- drivers/iio/dummy/iio_simple_dummy_events.c | 2 + drivers/iio/industrialio-event.c | 47 +++++++++++++++------ include/linux/iio/iio.h | 8 +++- include/uapi/linux/iio/types.h | 5 +++ 7 files changed, 77 insertions(+), 27 deletions(-) base-commit: c30e80d68a7afb334fde7147ee0106f25dd58d3a -- 2.51.0