From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 A702538F947 for ; Wed, 25 Feb 2026 10:06:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772013992; cv=none; b=j4QCjSws9lPg/rkWMwgggvMJz3milmV56uwgCTJx/AN5pwYl6nosbbLPwG0AX4GD8bDzBCiu4L6Uw6Khu/BwSHoYVUw4cdstCjbKEaKNQ8mp0d4L3355144pgYulbIjFnGZ2eNTaj1EEn8+2mrkHiieQoXUVtZtsPDln89ZTRSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772013992; c=relaxed/simple; bh=/+EtcM4PpShZZS23nog2f3WAGTs3hWTTmC2j8F6kP60=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qOeULAyBaZd9L0RytDoDqE72bAcfAuCoAFy2HlhbhUL7n9luxv5BW7nK65J2OqQZsDulDQB9v5KkAOWOHHRhUVH2HnvtsMwz8NTRn+qBB3wMZzJNnE8NPmaGUBbj0Udp4wjN15mfJjoAIQWLA5BR/bRqDJQcEqXj3y0v+jQFF6Q= 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=kibChKRm; arc=none smtp.client-ip=209.85.221.48 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="kibChKRm" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4327790c4e9so4913752f8f.2 for ; Wed, 25 Feb 2026 02:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1772013989; x=1772618789; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rQCAfG7KfmZ2nh5OrsOY1rBpRss8IzkmBnmQEIjr/00=; b=kibChKRmTZ1mECKAvUIBgZP0FGDb0stYcoHfj4cVwLBTjJMeIs2g9QzIt4hYVvyeTz ac0MrkCmw9tAD0VRVrG4B0hITA9zaOJaNJYlF2y2cyvDouetWCdCyFMaSfSuiAnThiVn gvEA4h6QcAqT5cCKwJ1/nVXnJWGKztKp1r2ZnPaD9w2+lTxQD0iBkV5QUqbzEma4latR uHbVDT6rt4x/E4ZKsNTd4P6AqjKZhYIB6etvPHadqDj1n7sSF6rF/VnL+fNRd3Ncx2Qt LbTSiSxEn1RvlgDmV1ipASImrcZ/koG1dx07bgu7Vt+10vmRPyh4wJgLyPhfpd4x6qdj E13Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772013989; x=1772618789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rQCAfG7KfmZ2nh5OrsOY1rBpRss8IzkmBnmQEIjr/00=; b=VjjuEqSMSUBB2qV0ieyLHxUfg53yYItWdxsVDBX19414z4kHQgCQlRG1vkLhwEDcQ0 v5oLriCVXQS4YbIhxI3tawHxUIluv44dmbzg+TV873ilIDltwB52avXoS5vsVKUylnds 18cabhGDEJBBC6y0q7+OoQMD5sw1rIWPsMZHYa6kVIB9pgTWSMmuk0Hj8NLNNcg4WsJf SqaEPwqFyqNrC5Ls1KaLriKtWWYP8XJif/R/qB2jzcvOXKnX0QaQClKLjHudbvSuFtSi uhYqWnCbR/O0jTZtQoeq6wiSwr7FIFSOf23MLuqRzBTy5ZtOl/v7TK2Kwu3VW23u/XLJ /kig== X-Gm-Message-State: AOJu0Yxaf43//IqJZr6M3pD66Z0AHWsGUBTaV9CLv3yHxxyW8R9wjYJ0 zmKfActSZCP56OkyV6EFzltaX6CWndYptd84EhJ37BnVCMy1uppslXRYNr6RF7Md//IJSydBWVn 5tC7Nq/g= X-Gm-Gg: ATEYQzzvNXT433KHavaFcXAcM4Fw2sH+11Oy/h7xasZlEUOjzepNaxGRyWAvfAhygLy 7FBx+UPe0PezSpevxrBXfv5B34GECREYzGIzA+djJflWR5S5+gLY24KJDi6Qtnduc6pzWofZBRN fZqEbTdi9COSJZE4npKsR3xubD1eAlyQFpZh/dTF0au3F+tXR019EiOBYOE8vTofOHz+Xy9pVP6 4geJTFuOmHdl9OaSf4BOvK3eQltA8kaI/i8mlPLWwxBLRx4bHdwK6iKfz4riW2SpHArkESBR29l +/Dj5Z27xXh6W8f0F0e7pN5X4iGZ49e0qS/a7d/eavv6O4k4WEUX4It12ki0nvxtU+pX1jCbVfv 3jzRlxkOToQs/somseEDFuzCoLTPjycZfLE0ntK3X7xFDdYOLlq1XHyR/A+OcZ3Yjr5CHq8xdOQ n9RRVWTQDZlUvAWtlDxEtWSXyL X-Received: by 2002:a05:6000:604:b0:435:97f6:4f44 with SMTP id ffacd0b85a97d-4396f1a97fcmr30422542f8f.56.1772013989025; Wed, 25 Feb 2026 02:06:29 -0800 (PST) Received: from localhost ([151.35.220.155]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d4cc81sm32230651f8f.26.2026.02.25.02.06.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 02:06:28 -0800 (PST) From: Francesco Lavra To: Cc: linux-kernel@vger.kernel.org Subject: [PATCH v6 6/7] iio: ABI: Add custom data type Date: Wed, 25 Feb 2026 11:06:05 +0100 Message-Id: <20260225100608.2367061-6-flavra@baylibre.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260225100608.2367061-1-flavra@baylibre.com> References: <20260225100421.2366864-1-flavra@baylibre.com> <20260225100608.2367061-1-flavra@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4581; i=flavra@baylibre.com; h=from:subject; bh=/+EtcM4PpShZZS23nog2f3WAGTs3hWTTmC2j8F6kP60=; b=owEB7QES/pANAwAKAe3xO3POlDZfAcsmYgBpnsmNWrELV6QZHRH1//cLHvGcAS3iRA4IUjLuG OdEJqYDaOaJAbMEAAEKAB0WIQSGV4VPlTvcox7DFObt8TtzzpQ2XwUCaZ7JjQAKCRDt8TtzzpQ2 X41xDACsOl0lnNABJjU2lyM/iVTW7oNGYUtfPlPcxLvrsbxvFTbtgI6rtdy+Un8w3FG2hqTwfng NAm1DhOi+AgkOjUh7aKbFa0Z7rFbKhQ5PacJFoaEvtmBGi005eA2juwfGEO7qhszTTJMHUkZEJJ kOoKAcPBDrYlTu+GzlRGoF5V10SaJt+xHdHBbTx5tV+qEaIDe/i48HnHr76TuBcJu2Q0/MpMqiU MihImx6pzEt7uHPFtRYMtFJy2zRShUaObb+ipMUnN6czmK1j+oLr0ASCTqIBLGPWUzFXMZ2uLx6 Qi3iRD4C9DN8tmiBpSeEnQvpCV7aZ09a7u0/LzhM7wtERWRelUINlhXzwV/129GGrq+5Vtdj4Lp EIjZTYaVk3tiA+GnPDbksYLTIJsGm77KArHXfjH6BZidtR1T7fugEdXeJZPiLUexR79MduP3J35 niICLIRYawHe+ehurZVjHNOCExyKi9v85v49ZNPT49fFkWcLiiTzPEPvwEwaIXq30ouZ0= X-Developer-Key: i=flavra@baylibre.com; a=openpgp; fpr=8657854F953BDCA31EC314E6EDF13B73CE94365F Content-Transfer-Encoding: 8bit This type is used when the data received from or sent to a device cannot be identified with a standard type and must be processed by custom userspace. Any driver using the custom type must provide a driver-specific document that explains what the data represents and how it is to be interpreted by userspace. Signed-off-by: Francesco Lavra --- Documentation/ABI/testing/sysfs-bus-iio | 19 +++++++++++++++++++ drivers/iio/industrialio-core.c | 1 + include/uapi/linux/iio/types.h | 1 + 3 files changed, 21 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 61961bca4dce..2e45e54f54eb 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -450,6 +450,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_offset What: /sys/bus/iio/devices/iio:deviceX/in_rot_offset What: /sys/bus/iio/devices/iio:deviceX/in_angl_offset What: /sys/bus/iio/devices/iio:deviceX/in_capacitanceY_offset +What: /sys/bus/iio/devices/iio:deviceX/in_custom_offset +What: /sys/bus/iio/devices/iio:deviceX/in_customY_offset KernelVersion: 2.6.35 Contact: linux-iio@vger.kernel.org Description: @@ -507,6 +509,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_intensity_red_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_green_scale What: /sys/bus/iio/devices/iio:deviceX/in_intensity_blue_scale What: /sys/bus/iio/devices/iio:deviceX/in_concentration_co2_scale +What: /sys/bus/iio/devices/iio:deviceX/in_custom_scale +What: /sys/bus/iio/devices/iio:deviceX/in_customY_scale KernelVersion: 2.6.35 Contact: linux-iio@vger.kernel.org Description: @@ -1486,6 +1490,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_en What: /sys/.../iio:deviceX/bufferY/in_pressure_en What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_en What: /sys/.../iio:deviceX/bufferY/in_proximity_en +What: /sys/.../iio:deviceX/bufferY/in_custom_en +What: /sys/.../iio:deviceX/bufferY/in_customZ_en KernelVersion: 5.11 Contact: linux-iio@vger.kernel.org Description: @@ -1505,6 +1511,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_type What: /sys/.../iio:deviceX/bufferY/in_pressure_type What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_type What: /sys/.../iio:deviceX/bufferY/in_proximity_type +What: /sys/.../iio:deviceX/bufferY/in_custom_type +What: /sys/.../iio:deviceX/bufferY/in_customZ_type KernelVersion: 5.11 Contact: linux-iio@vger.kernel.org Description: @@ -1566,6 +1574,8 @@ What: /sys/.../iio:deviceX/bufferY/in_pressureY_index What: /sys/.../iio:deviceX/bufferY/in_pressure_index What: /sys/.../iio:deviceX/bufferY/in_rot_quaternion_index What: /sys/.../iio:deviceX/bufferY/in_proximity_index +What: /sys/.../iio:deviceX/bufferY/in_custom_index +What: /sys/.../iio:deviceX/bufferY/in_customZ_index KernelVersion: 5.11 Contact: linux-iio@vger.kernel.org Description: @@ -2393,6 +2403,15 @@ Description: The x and y light color coordinate on the CIE 1931 chromaticity diagram. +What: /sys/bus/iio/devices/iio:deviceX/in_custom_raw +What: /sys/bus/iio/devices/iio:deviceX/in_customY_raw +KernelVersion: 7.1 +Contact: linux-iio@vger.kernel.org +Description: + Custom input value, whose type is driver-specific and is described + in a separate document. It can have a modifier Y, in which case it + is a measuremement from channel Y. + What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_either_label What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_mag_rising_label What: /sys/bus/iio/devices/iio:deviceX/events/in_altvoltageY_thresh_falling_label diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 22eefd048ba9..dd179e3b0fb7 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -98,6 +98,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_CHROMATICITY] = "chromaticity", [IIO_ATTENTION] = "attention", [IIO_ALTCURRENT] = "altcurrent", + [IIO_CUSTOM] = "custom" }; static const char * const iio_modifier_names[] = { diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h index 6d269b844271..47fefcdd693c 100644 --- a/include/uapi/linux/iio/types.h +++ b/include/uapi/linux/iio/types.h @@ -53,6 +53,7 @@ enum iio_chan_type { IIO_CHROMATICITY, IIO_ATTENTION, IIO_ALTCURRENT, + IIO_CUSTOM }; enum iio_modifier { -- 2.39.5