From nobody Thu Apr 16 17:47:19 2026 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 4483D3E9587 for ; Thu, 26 Feb 2026 15:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118680; cv=none; b=LbzfQcGeiASbS7sLfjmN0Dtgu+N+Cd5HsCWHrjaDHomgCFje2IW+32/wbqxvQFmUVDI22qCHK1CG7mgIhhiobdGWOOS/e07Da7cmp0MuEei9ZFfCg6Zo47ynH5aM9NGyV9sXdvDvq0yzo7lWcdgXO96qHTEakq3W484SBAkK+hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118680; c=relaxed/simple; bh=pQavWAYPpsey0yQqgVWWpFe8QdmDgqTBdo0zNEICEsI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jzUQuV+lSkfrlfWNsFybjbOQ1l10/oPq56wWN/PnczdnqsB6WFp+f2Xsmemn6j6j+EulI95mOOrzJajmCOaQjKDVIKN9DJ/tMzCQqWTnn7oBQjv4ZR+S10jDYtysUAZ1Ksk2Lsh0XtweM7wmIyIFDZSx8BYkdJOzVSccHRQUgYc= 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=OT5nKnzS; arc=none smtp.client-ip=209.85.160.175 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="OT5nKnzS" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-506bcb23a78so8509731cf.3 for ; Thu, 26 Feb 2026 07:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772118678; x=1772723478; 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=JYBPp/39SgW1yz4SiSW0HB6Or3cMOFZIagn+ooTwLYE=; b=OT5nKnzSHgFw5Vli/3n0Ge6EvSATz9ajsi2jtffnELYnfmO1H5zmOBqBOiWQDeaTC9 E6TKy7cpXIKc9unfX06umjnAo3UYGjtr4UASPBfzWTLttwayUFMheaC33pAowHXt5k2q MmnqSKTqtpac6/0BW3hs3QLTKWOJXarnzbMyGNzA8Pxuk8MYZIljtR7fV176M2tGw4PH aKRwfhTGwibylmdTc4BCrHxnfFziM6pEzxydI4qr7cpy2IUYWkEWTPnVHfAOJHdzK7kc 06dG2ICa46p0I9+xbxV0Jd0mOE3a331UBb/eVKER/bBKb8hVFAxIugPZ9/pc3uM8JhlN kFbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772118678; x=1772723478; 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=JYBPp/39SgW1yz4SiSW0HB6Or3cMOFZIagn+ooTwLYE=; b=bGt8xRfLr1u9yjuOU0BjpSkR2/+xCE2Z7CjiUEnUi9w3+DApRpEQ8Nanl9okXa2P8j iezR8c0ENbmsiiRH4rEayStbhD0wIN6lu5Gtoo9+BuDbtDne4dCQYDjE2TR552pO2jp+ a3Iggcg7O58LC6qfCpq+FLony1TCNQNRs1WZT91QtCNbd0ZTm9zU04sOjWdWAdTmkQli 2tOHLsNGnjww7zuwsmWe/KAoHOjfgLqbRMDbL8eKutKok8t6VhFH688jGY96upbCqbnt V4+WA8DndFyrdpxQ40f1jpRScVF2XIpTgwK30q2932YtZlNQRkxbtIZOVb6drSV6Bfu5 0WPw== X-Forwarded-Encrypted: i=1; AJvYcCWQFOZGMnmZF+nZ4tqwCRelR+14pQijjrKfBYqplQ33XF08VuxOcGL1oMAGLBwfrZAlOKmAsW1Euxiqkf8=@vger.kernel.org X-Gm-Message-State: AOJu0YxytzJ1EP8l5ESCd+I4sfqz2Dk5o/rIeyGiR6nGCbXdp1tiJzeQ ceY+32+cIbcVS+CFq8TUHv5AZ/HHMbjZBxhE3nQECjdjISt6IWldf3Xd X-Gm-Gg: ATEYQzwlS49GXGZcpKa+e2mk6i/pT16Lxa/WgQBs213+A3ILApWVD8nnsH3kKCv3PCJ IAVz5H7iDmoDjtRxOtStfgtr29ZX4eubTcrjtvZlLxeAASniQbuBs5Hpd9jV3go26S6s/EwAVkN gJqHSo7RNe3Eo/t+1i8pa1sskS4BiKw+kAw/C7kYcJs2nopRPyjfub7BxI4S9z4Z2eRExg2kSgC cmN5dpKIib0qEG5NAu5g0wsLFAF30PCcYUbrLJlHvswz6gFl8PHPpRb1jz2YWXkUTiHrYrViO30 ylOiozp1ZjfN4xRtFBZXfnUlHnNShFAQyNAu4lzd7pV0WlI/r99okK5eeyV98CBjbDxJZgWkQlD ODYERefp3yJLDo2HRuun7v4+Ybu93qdMFpVPkEamcN/CzP9DGR2vLYhbQ73pfvHSwhyjWlpeY4v 62w7M93xjemxZ2wyVji+ehvvET8dKYeRrWq3q1XthpbOXa6T22aqoTt1G5xMAl2Q== X-Received: by 2002:ac8:5a54:0:b0:505:e448:1b0d with SMTP id d75a77b69052e-5070bb81df0mr247065861cf.10.1772118676885; Thu, 26 Feb 2026 07:11:16 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c738e661sm19275136d6.43.2026.02.26.07.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 07:11:16 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: dlechner@baylibre.com, rdunlap@infradead.org, skhan@linuxfoundation.org, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v6 1/5] docs: iio: adxl345: grammar and formatting cleanups Date: Thu, 26 Feb 2026 15:11:02 +0000 Message-ID: <20260226151108.22383-2-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260226151108.22383-1-0rayn.dev@gmail.com> References: <20260226151108.22383-1-0rayn.dev@gmail.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: quoted-printable Correct several grammatical errors, typos, and pluralization issues throughout the ADXL345 documentation. Key changes include: - Changing 'generic' to 'general-purpose' - Correcting 'axis' to 'axes' in multiple tables and descriptions - Improving phrasing in the device attributes section - Fixing 'latent' to 'latency' in usage examples - Sorting the existing event attribute table alphabetically for better readability and to establish a clean baseline for future additions. Suggested-by: David Lechner Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> Reviewed-by: David Lechner --- Documentation/iio/adxl345.rst | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst index bb19d64f67c3..0e8977345e9d 100644 --- a/Documentation/iio/adxl345.rst +++ b/Documentation/iio/adxl345.rst @@ -12,16 +12,16 @@ This driver supports Analog Device's ADXL345/375 on SPI= /I2C bus. * `ADXL345 `_ * `ADXL375 `_ =20 -The ADXL345 is a generic purpose low power, 3-axis accelerometer with sele= ctable +The ADXL345 is a general-purpose, low-power, 3-axis accelerometer with sel= ectable measurement ranges. The ADXL345 supports the =C2=B12 g, =C2=B14 g, =C2=B18= g, and =C2=B116 g ranges. =20 2. Device Attributes =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:devi= ceX``, +Each IIO device has a device folder under ``/sys/bus/iio/devices/iio:devic= eX``, where X is the IIO index of the device. Under these folders reside a set of device files, depending on the characteristics and features of the hardware -device in questions. These files are consistently generalized and document= ed in +device in question. These files are consistently generalized and documente= d in the IIO ABI documentation. =20 The following table shows the ADXL345 related device files, found in the @@ -42,7 +42,7 @@ specific device folder path ``/sys/bus/iio/devices/iio:de= viceX``. +-------------------------------------------+-----------------------------= -----------------------------+ | in_accel_x_raw | Raw X-axis accelerometer cha= nnel value. | +-------------------------------------------+-----------------------------= -----------------------------+ -| in_accel_y_calibbias | y-axis acceleration offset c= orrection | +| in_accel_y_calibbias | Y-axis acceleration offset c= orrection | +-------------------------------------------+-----------------------------= -----------------------------+ | in_accel_y_raw | Raw Y-axis accelerometer cha= nnel value. | +-------------------------------------------+-----------------------------= -----------------------------+ @@ -68,7 +68,7 @@ present, simply assume its value is 0. +-------------------------------------+---------------------------+ | Channel type | Measurement unit | +-------------------------------------+---------------------------+ -| Acceleration on X, Y, and Z axis | Meters per second squared | +| Acceleration on X, Y, and Z axes | Meters per second squared | +-------------------------------------+---------------------------+ =20 Sensor Events @@ -78,8 +78,8 @@ Specific IIO events are triggered by their corresponding = interrupts. The sensor driver supports either none or a single active interrupt (INT) line, selec= table from the two available options: INT1 or INT2. The active INT line should be specified in the device tree. If no INT line is configured, the sensor def= aults -to FIFO bypass mode, where event detection is disabled and only X, Y, and = Z axis -measurements are available. +to FIFO bypass mode, where event detection is disabled and only individual +X, Y, and Z axis measurements are available. =20 The table below lists the ADXL345-related device files located in the device-specific path: ``/sys/bus/iio/devices/iio:deviceX/events``. @@ -90,37 +90,37 @@ listed. +---------------------------------------------+---------------------------= ------------------+ | Event handle | Description = | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_gesture_doubletap_en | Enable double tap detectio= n on all axis | +| in_accel_gesture_doubletap_en | Enable double tap detectio= n on all axes | +---------------------------------------------+---------------------------= ------------------+ | in_accel_gesture_doubletap_reset_timeout | Double tap window in [us] = | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_gesture_doubletap_tap2_min_delay | Double tap latent in [us] = | +| in_accel_gesture_doubletap_tap2_min_delay | Double tap latency in [us]= | +---------------------------------------------+---------------------------= ------------------+ | in_accel_gesture_singletap_timeout | Single tap duration in [us= ] | +---------------------------------------------+---------------------------= ------------------+ | in_accel_gesture_singletap_value | Single tap threshold value= in 62.5/LSB | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_falling_period | Inactivity time in seconds= | +| in_accel_mag_adaptive_falling_period | AC coupled inactivity time= in seconds | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_falling_value | Inactivity threshold value= in 62.5/LSB | +| in_accel_mag_adaptive_falling_value | AC coupled inactivity thre= shold in 62.5/LSB | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_adaptive_rising_en | Enable AC coupled activity= on X axis | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_falling_period | AC coupled inactivity time= in seconds | +| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old in 62.5/LSB | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_falling_value | AC coupled inactivity thre= shold in 62.5/LSB | +| in_accel_mag_falling_period | Inactivity time in seconds= | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old in 62.5/LSB | +| in_accel_mag_falling_value | Inactivity threshold value= in 62.5/LSB | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_rising_en | Enable activity detection = on X axis | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_rising_value | Activity threshold value i= n 62.5/LSB | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_x_gesture_singletap_en | Enable single tap detectio= n on X axis | +| in_accel_x&y&z_mag_adaptive_falling_en | Enable AC coupled inactivi= ty on all axes | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_x&y&z_mag_falling_en | Enable inactivity detectio= n on all axis | +| in_accel_x&y&z_mag_falling_en | Enable inactivity detectio= n on all axes | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_x&y&z_mag_adaptive_falling_en | Enable AC coupled inactivi= ty on all axis | +| in_accel_x_gesture_singletap_en | Enable single tap detectio= n on X axis | +---------------------------------------------+---------------------------= ------------------+ | in_accel_y_gesture_singletap_en | Enable single tap detectio= n on Y axis | +---------------------------------------------+---------------------------= ------------------+ @@ -330,7 +330,7 @@ Configure one or several events: ## doubletap, window [us] root:/sys/bus/iio/devices/iio:device0> echo 0.025 > ./events/in_ac= cel_gesture_doubletap_reset_timeout =20 - ## doubletap, latent [us] + ## doubletap, latency [us] root:/sys/bus/iio/devices/iio:device0> echo 0.025 > ./events/in_ac= cel_gesture_doubletap_tap2_min_delay =20 ## AC coupled activity, enable --=20 2.47.3 From nobody Thu Apr 16 17:47:19 2026 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 DB2F53E9F8E for ; Thu, 26 Feb 2026 15:11:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118683; cv=none; b=J2UJG/eWbEIYRnZmAfi0MCbUMGhqLeMmSmEQ9++MgJWccN2uWObb7fKGD7Q0/NLhK8DFkuRbPmkAAIBlkvNRzVn1nacLoCtsWcSkr323x54Zao32YYY/o3QEsaAsIR1kDV8IoG32YeE8KcTBNunp9Sy4f/OPhCbYfVdpSdzM3BY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118683; c=relaxed/simple; bh=eC4OcRhmLSDkTtLlMg/lYgJlFKVw7QIYt47QGv08+I0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kXhkSGW6DSROLTUAV66XAUxB/tYhLChBQoEZl55Bm04I76LLqY/fr7XwavTwhSjsOVfI4ieOdHRGSFKf3G2WHtYYUXkO1n6Ncw5Kc3/fk+UeFUcvFu5nAaT84FCVLLgvpj0xzGOn8MKFCVK71dhWlC0XSIFgUD9CR0NBYcoNHBc= 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=gebXlT+A; arc=none smtp.client-ip=209.85.219.42 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="gebXlT+A" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-896fd2c5337so11503106d6.2 for ; Thu, 26 Feb 2026 07:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772118681; x=1772723481; 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=xGlQ2VVKxMQ5I859rXP6Jbm/Xm1NZz+UcI5mRp04U9Q=; b=gebXlT+AP54M//lpF04hAmIH87YXQCKgkSN5tgPkkVkYzHkvJHel53XnaW0yZ9KGsH oHuPae8Yx4PCBSZ+cwRSpi1p7UrEaXN9wr/hCMCixVivdFN/gVXCCwfNBP++xybY7V/+ ErAFPtvaasTeIiQXyA2f4HGJYxgxQLTxgmO/qD73xX8zGNHxCHwQtPhVaM57lnrnzZrU cS3EgAMnGj/GoBQXoEFwB96EQde0ZwWT/b+FnjWAWPsnPLgwpZqyVGUXzCwImXa1Ia8R Ur02mTGegOaXQPRLeOxkCblFe0INypb9GE32HQUztDbZIFpYQ9OOV6qvCZ8pGYsvOE6B j9hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772118681; x=1772723481; 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=xGlQ2VVKxMQ5I859rXP6Jbm/Xm1NZz+UcI5mRp04U9Q=; b=V453dVWHuwQMKGv8KW8pcP/VGQrjoySpqOsOcGawoJT6k+fIsVisYj0To1CO4u0wx5 mmqNs3K9Q+wlkGe9eCLXZEbuUpiqgqKdTjPcfnGQWi5MWxadAv0O8vi8X3jGUcOZvTda s/MiS7d57JeKcxJ3c1KbHewg2H4a1bZPgviq/cgFQHwQtLn8v57qvkeNafRQBN/23T/4 26p8FATVjZrlrM4jfAJ8u5N0ZMRVmgQWT5yQ+7P577oe57UwH1S2WeNHxbJpjGdTGjZm T3JOs/O+nsImcOTcqCdx2n/Vr0wzknkD3y2uJa+ZCdJqe29rdR5/vZCoQw0l6JxGtrnb F6pA== X-Forwarded-Encrypted: i=1; AJvYcCXSCsrn58TQ6shM+qKMqTf8UVscYuS+Y3rjlbe0Yugz5ebd9gMhtX4ugDo1jvDUwtDB1o5QBnA8NvstWZI=@vger.kernel.org X-Gm-Message-State: AOJu0YwaceNWouzuL/Wo/VXA8VAkUP2e9AXbQ3yyD0abWIVh5JEqwCsR IJQgVW/18Q6KdG1MjeLMUn51u3tIlm01HxQDaONTiu5PAO3g0kMvLasH X-Gm-Gg: ATEYQzzNRCIn555J6bYm1JlR9gnjXNMTv6u+IcuHruKiGag2dbR0PeMrcxPFMT35WoP GaBhJyKeOlLY7ceeC5ApS56PDdVePgiTYwbn7TZzf0mb7V1T/onrwkp1RZlSvkcbuuK2CgIC2Wn iLywktga2R3ZNG66knsWGktztht9ftpYsCiEryFank6KAumY2zRvJy0eie8lExpX+Cz6H1x/IFu dJVeI7TX8Yg9/KXPfst7MkQS2XwZg5aHCNKmBw78eK8AcbvIwh1fXSRbi7SPoFpK1qe2QOEVt2F azH7LX/CVTfzX55NcROdcWNTCJlZS+dtZBNcSIqRGNaS4cJxoExYGdoI6pUTAjUcqn7gKzN6MJD CPv5J7S/T+fX17ZemvwtraUIDBKyIRZ50w8gfIc54sa6MP/fQdCEmulmakmlpZSau7Egcm1BQqh LtFv4ESz4o1qTBhe65+2tt2U5tjfT5F3cstdoNLpPYGk/ybCqKIrnTtr2eztDTdPegdnwIxz7X X-Received: by 2002:a05:6214:258d:b0:895:4a0f:ea79 with SMTP id 6a1803df08f44-899c8017569mr30789216d6.44.1772118680750; Thu, 26 Feb 2026 07:11:20 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c738e661sm19275136d6.43.2026.02.26.07.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 07:11:20 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: dlechner@baylibre.com, rdunlap@infradead.org, skhan@linuxfoundation.org, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v6 2/5] iio: core: Add IIO_EV_INFO_SCALE to event info Date: Thu, 26 Feb 2026 15:11:03 +0000 Message-ID: <20260226151108.22383-3-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260226151108.22383-1-0rayn.dev@gmail.com> References: <20260226151108.22383-1-0rayn.dev@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Implement support for IIO_EV_INFO_SCALE in the internal enum iio_event_info to allow proper ABI compliance. This allows drivers (like the ADXL345) to expose event scale attributes using the standard IIO ABI rather than manual device attributes. Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> Reviewed-by: David Lechner --- drivers/iio/industrialio-event.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-ev= ent.c index 4149efcd5539..a0d6fcf2a9c9 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c @@ -256,6 +256,7 @@ static const char * const iio_ev_info_text[] =3D { [IIO_EV_INFO_TAP2_MIN_DELAY] =3D "tap2_min_delay", [IIO_EV_INFO_RUNNING_PERIOD] =3D "runningperiod", [IIO_EV_INFO_RUNNING_COUNT] =3D "runningcount", + [IIO_EV_INFO_SCALE] =3D "scale", }; =20 static enum iio_event_direction iio_ev_attr_dir(struct iio_dev_attr *attr) diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 34eebad12d2c..4e3099defc1d 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -21,6 +21,7 @@ enum iio_event_info { IIO_EV_INFO_TAP2_MIN_DELAY, IIO_EV_INFO_RUNNING_PERIOD, IIO_EV_INFO_RUNNING_COUNT, + IIO_EV_INFO_SCALE, }; =20 #define IIO_VAL_INT 1 --=20 2.47.3 From nobody Thu Apr 16 17:47:19 2026 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 A328836EAB7 for ; Thu, 26 Feb 2026 15:11:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118685; cv=none; b=MeFKY5TdLiZ4jB8kuYiu48PvWSXv4sdqTkTuDgqAGeS1e8Gg0ivPFDP8ykpD8i15OEVxE5gF9pjYGFm2PsLAHK22XlffVtUwqeX5AiWI6tSsgfk4WiSCuZBK98kvUwmk2YP3SlsGD7kpVlxKjKHY447gqgjt3r9KMo8lNxzP5ms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118685; c=relaxed/simple; bh=NNWTiEb//BrzQ/xGozL9s9RqDOS1KYPUzlwFVG2TNDA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z3O1imdXYxeCQW7Ablq7ntvS1sHXplozIaiIxj1CQy8p3tvvgevvao+FYC0NP1azn3dShvyhnbEngzdSzj5Q3+RwqRGB91c51CN6qCRZr/oWZMgtgAnHTdJIOW8z0Vr1j4rRzW0/Ad7CiaAb/yPxYn+4RAfXmEUy847OEsfdd38= 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=iyRelujL; arc=none smtp.client-ip=209.85.219.44 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="iyRelujL" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-896f82e5961so14243356d6.0 for ; Thu, 26 Feb 2026 07:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772118684; x=1772723484; 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=4+TBrmc0fLXcmkm0VaaldSqs2PcXgyH2nxurKdQgp9Y=; b=iyRelujLQxQalRlxdGj27+QL+6ETlNkXWwxxgpW8LruqdUVmCOVor28GPNJRMvSgFA IwXd9wRwo5PldLqP0XEetMOGc/RgXzYFj4IV/lnScG1/8Huja+bvB0QbARlyvGad+xIX NdpuWH5VQ5pxuELSyKNawbziendaXLptybFIGCuERUeX+TSyxT2VFMH+NEVaVPuNaFMR yqhBs2raARgmS6RkFl/sMg014/2suHf/xx0GjhXxv1Hzrib8HzUFCfxTUT2I5ZwM/A8P mZnZzQwF9DVw/6yfxRo6x+n+BjjbOsfgiWsR6glgmCuqs2F21HZvc+EgDTQIG2PG3zN/ qTTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772118684; x=1772723484; 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=4+TBrmc0fLXcmkm0VaaldSqs2PcXgyH2nxurKdQgp9Y=; b=tPIiNVvtbl7dN6khH06KdbUKR7e6+Vk1G7HQcPUAON+tuvHbLJETGW3kCgwGUS8/nn 3RPYA1Jh/zVTQMkO9uCK9ngtg5YcoMSvZpPY+ZO9HRfvcwxmodyT6UonSd7mv+uCSpbU URANDwB0XN7ZyyezFhHP9dl+/kOC5Ay71Quh+oyY+UKf+mX9QhqBjPNkjgI7sAcy2vL3 FaeYg1uMJaPugYLY6VhLn72gM1iaHSkbWhtoIkR+Rclg9aVOxdCIWi7489eW0lkQBrjo 6QmGVNiVFaHOo7aCWOfwJ2GktoRMaCAFnF6ofxjB//Aw5ZrS/uI2ktmkVbmoDnSZp9fx mAkA== X-Forwarded-Encrypted: i=1; AJvYcCVEzqj2TnrDx1yZcmPlDCJk1eILAbv4IBvUqvtgH5ktK16f7ElLhDxQBrmwSiQWaIW+js3qYYLEFtbngIA=@vger.kernel.org X-Gm-Message-State: AOJu0YwEkzXw6HwPQjnOfS4RG3E0hkPdvRzd5wj0/Hn/GcSb+RXFbWWx svam277ViX8zSO5D7CLNqIeqZKERAK75TisyLf9/62lJv1T/nsRWoJLN X-Gm-Gg: ATEYQzy9dlw2OJhG99OhDUwpRxJiQPyoFNUVg18YrvrHomCEM4N97jOuFR/KmXjt3qe e/PzN+ztdUI1ChiWcxvsUOKOpryYI+1fXNxaT03hR7m9WmnVlsGNVqugG8vrun1poE41IHRPRXW C595m8rAXEWaNgC5GghzEdVkijigymmDz3A0b2JcZsz3MoQnrRM+BY9BkUcxUtzFLBPf8Le22GS bE4E5nRMlEL/3VNeTzel46itEjzRjpt22upBBIu1Vo2sOZf7U4BMA5Ny5hI4HpJNs1AeX50jSE3 CUIDJsr1mnFkYQx3bq2NgZ2AsRhUs9O8s9iP2pzQN4/VeBdpZeIwFUlyEVxINlkJ55uYhZOHVIm qe8xenZsYpYFGXpYjU9FeFpbRyPMfnTZkhAFZ4TllKW6afjCWmGAhVK6S/SOXJC2bqnAzx5MBAN G6yv+Decm8gprtBwt4dIVR7n5CSQATiYhAcSO3aTKoIRzqgiBhjh7YcIKAjK409A== X-Received: by 2002:a05:6214:1bcb:b0:899:bdae:beb2 with SMTP id 6a1803df08f44-899c13fea0bmr67244086d6.24.1772118683547; Thu, 26 Feb 2026 07:11:23 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c738e661sm19275136d6.43.2026.02.26.07.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 07:11:23 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: dlechner@baylibre.com, rdunlap@infradead.org, skhan@linuxfoundation.org, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v6 3/5] iio: accel: adxl345: Expose IIO_EV_INFO_VALUE for double tap Date: Thu, 26 Feb 2026 15:11:04 +0000 Message-ID: <20260226151108.22383-4-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260226151108.22383-1-0rayn.dev@gmail.com> References: <20260226151108.22383-1-0rayn.dev@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ADXL345 uses a single hardware register (ADXL345_REG_THRESH_TAP) to store the threshold for both single tap and double tap events. Currently, the driver only exposes the IIO_EV_INFO_VALUE attribute for the single tap event. However, the IIO ABI dictates that if an event is supported, its associated configuration attributes should be exposed to userspace. This applies even if writing to one channel property alters the value of another due to shared underlying hardware state. Add IIO_EV_INFO_VALUE to the double tap event specification to ensure full ABI compliance. Suggested-by: Jonathan Cameron Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> Reviewed-by: David Lechner --- drivers/iio/accel/adxl345_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_c= ore.c index 78e3f799ecc1..96d1417d77c6 100644 --- a/drivers/iio/accel/adxl345_core.c +++ b/drivers/iio/accel/adxl345_core.c @@ -235,7 +235,9 @@ static const struct iio_event_spec adxl345_events[] =3D= { /* double tap */ .type =3D IIO_EV_TYPE_GESTURE, .dir =3D IIO_EV_DIR_DOUBLETAP, - .mask_shared_by_type =3D BIT(IIO_EV_INFO_ENABLE) | + .mask_shared_by_type =3D + BIT(IIO_EV_INFO_ENABLE) | + BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_RESET_TIMEOUT) | BIT(IIO_EV_INFO_TAP2_MIN_DELAY), }, --=20 2.47.3 From nobody Thu Apr 16 17:47:19 2026 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 8AA113A0E91 for ; Thu, 26 Feb 2026 15:11:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118690; cv=none; b=b0810gcci6LAvr96XosehNE+in9fo/1QZHsuF3dL3mIDpJPqff/RjjKCtA/1Uj8O8WM7MoyMJn+UK7UYj9W4AiT14kNa/noJ+YlJywneilhYH2R6U+EQI4VC5HYmU+6ye/ltf5v982yZLZIFCdSN5WvY/Xpk3BWKZXClzGzAWBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118690; c=relaxed/simple; bh=JejjvVpPYrXeaRVSJxsfFS1CBfXAi1ii04aOuLTHn7M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zfhh+RvvHI4JsRKBszVPS4IrhgNI5ECfn6Qwvn3qMQIN2niDNISWC2QsS7eistz6dsV1L3cGK2y+kSNvA54G8tAY57Oyx7RF91tffu/ajpR1VrHv8nOkYVky3nLqqYz82BPTjo8qimWFcK8Zfg/6CEIWNiLQsC17QRMEdrMOOd0= 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=c7kT3dXT; arc=none smtp.client-ip=209.85.219.45 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="c7kT3dXT" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-899a5db525cso9221966d6.3 for ; Thu, 26 Feb 2026 07:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772118686; x=1772723486; 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=9TivuMjzjzE/SeADDnaO1za2lwOiaGnN4Z4jjyarfjs=; b=c7kT3dXTSpZrwTLFHa9ikNfYoaEom+ULvXS9iRmzds33EN2PSOP71F5eRx4X8tRlC5 RieVLLjrUX6xrMMyOe0e6YqjTClx63UWkzPCSpLOhHVVDwgHOMrJrUQDoYD781gFEo0v 4XzOfnFfeW62CeN3l6aGNlevmQXklBJ+MRTtZM/GAykAHFGVLbQMBM4FIrkWGI80a+ST HKB1Bd2LHnP/JzmhahXmOul6cbBHm3K88I5E9cpjEeTCm6bmdB7u6uRRyz7IhI33TNkc BKk5DtF0HioCt7oKNWO5cGwvwjwCL3eS1Pj1ZFfSZwU/+WW7rDCSA9V/7+7nD0vzEMIx 2I7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772118686; x=1772723486; 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=9TivuMjzjzE/SeADDnaO1za2lwOiaGnN4Z4jjyarfjs=; b=bJGIzZ6tRH0tHoAJL6OsYrohLHynwI4WGc6uQ2mfIDYo5lf1z8nQCYJfBDv7AeX/5H TP4HMxkRkrKcm5KSL+83iS3IS9lNBFOV5BgVNwazGxa5aDpepq+vzk7MdSiUFRJkL3KP t40+IBnQ/eks7nZoh1/7P+TR7GkCJevcv0Frx+yac0mzXLgFHdKgWKk57urWTcSm94Ko 2F7XgVVkZFVFmRCauwaYmiq86VVoDKz3Z0VM7NTBiT1RyJ4OsfLVe4BuebB0+anIiODA iRzuvmUPZZ90EfVUD6aDJ6T2nGBsxMKKLw/C/+dbdobJxnPNY00keVjrkK9zYfPAuhBE xe3A== X-Forwarded-Encrypted: i=1; AJvYcCUuWeYZ3WK94mbKueFJMTpZCT8UV8DchW1pwOMiQpdZ9pDC8aSvKjzwdeADnYriO5BcRYPs6SAgtNuDfDg=@vger.kernel.org X-Gm-Message-State: AOJu0YwR9FoMXKzzgBwmYqtSEJQ+fwZYgZKfKSi1hxwxMvZDNl6SY4+I frlROS8+tA17KQN2u72sPcCq0pjxVYmMFUshWrLJyeKRhBCtYtru+Gcu X-Gm-Gg: ATEYQzxapahd+URGcv6qJfkpxXDp7NfZVPCsPJ0c2Yx9AcfPVr+EytpJu/bo4uDlRkl w4alMgSSgllI87tRAX+oFd7CRbv4bZSbwiAlwA7EoMvFjPALnKXXBU0bvqcOQ8+BduxbD8YNtnq p1G11NsG3Ney8Elh+hTDr9se1xeQJS/U94RdWw9GxFXCwb1cfexV6yD6rHPQBKhlxG7orCbxzwh Qwvur94I6Jb54vQEI8fzuHrZJJ31MeglsFv8eqnix2IkSe78C41xiLgyR18tb50mzM1x7jZnzx8 DO+DBKkamEwn1T7XkdgeAKtUA7syOByrM+ocVLiATpOKmlP7BlNYyyzEBIdYwrYSqSFhDnESXgc u2gBwBU0LGooC2wAfQqEt7i3DqGK1tlgcq1bi9ZhxKt0ziYjdDq3sc1iu2bDicCVGu6jPl4rgN/ JgLH8HFYeicLhPWDEU8YJYq7rkwVwrdXTKZjoFZmdYldGTm5moWNzc0qguNLySDQ== X-Received: by 2002:ad4:5d46:0:b0:899:bbba:b397 with SMTP id 6a1803df08f44-899c7fcd414mr34907026d6.30.1772118686218; Thu, 26 Feb 2026 07:11:26 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c738e661sm19275136d6.43.2026.02.26.07.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 07:11:25 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: dlechner@baylibre.com, rdunlap@infradead.org, skhan@linuxfoundation.org, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v6 4/5] iio: accel: adxl345: Implement event scaling for ABI compliance Date: Thu, 26 Feb 2026 15:11:05 +0000 Message-ID: <20260226151108.22383-5-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260226151108.22383-1-0rayn.dev@gmail.com> References: <20260226151108.22383-1-0rayn.dev@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ADXL345 uses a fixed threshold resolution of 62.5 mg/LSB for event-related registers. Previously, the driver reported raw values without a scale factor. Implement IIO_EV_INFO_SCALE for all event types to provide the conversion factor (0.612915 m/s^2) as required by the IIO ABI. Consequently, remove the obsolete comment in adxl345_read_event_value() which stated that the scale factor is not applied. Add explicit write rejection for IIO_EV_INFO_SCALE in adxl345_write_event_value() returning -EINVAL. Suggested-by: Jonathan Cameron Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> Reviewed-by: David Lechner --- drivers/iio/accel/adxl345_core.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_c= ore.c index 96d1417d77c6..6c9080d88c60 100644 --- a/drivers/iio/accel/adxl345_core.c +++ b/drivers/iio/accel/adxl345_core.c @@ -213,6 +213,7 @@ static const struct iio_event_spec adxl345_events[] =3D= { .dir =3D IIO_EV_DIR_RISING, .mask_shared_by_type =3D BIT(IIO_EV_INFO_ENABLE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_VALUE), }, { @@ -221,6 +222,7 @@ static const struct iio_event_spec adxl345_events[] =3D= { .dir =3D IIO_EV_DIR_RISING, .mask_shared_by_type =3D BIT(IIO_EV_INFO_ENABLE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_VALUE), }, { @@ -228,7 +230,9 @@ static const struct iio_event_spec adxl345_events[] =3D= { .type =3D IIO_EV_TYPE_GESTURE, .dir =3D IIO_EV_DIR_SINGLETAP, .mask_separate =3D BIT(IIO_EV_INFO_ENABLE), - .mask_shared_by_type =3D BIT(IIO_EV_INFO_VALUE) | + .mask_shared_by_type =3D + BIT(IIO_EV_INFO_SCALE) | + BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_TIMEOUT), }, { @@ -237,6 +241,7 @@ static const struct iio_event_spec adxl345_events[] =3D= { .dir =3D IIO_EV_DIR_DOUBLETAP, .mask_shared_by_type =3D BIT(IIO_EV_INFO_ENABLE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_RESET_TIMEOUT) | BIT(IIO_EV_INFO_TAP2_MIN_DELAY), @@ -276,6 +281,7 @@ static const struct iio_event_spec adxl345_fake_chan_ev= ents[] =3D { .dir =3D IIO_EV_DIR_FALLING, .mask_separate =3D BIT(IIO_EV_INFO_ENABLE), .mask_shared_by_type =3D + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_PERIOD), }, @@ -285,6 +291,7 @@ static const struct iio_event_spec adxl345_fake_chan_ev= ents[] =3D { .dir =3D IIO_EV_DIR_FALLING, .mask_separate =3D BIT(IIO_EV_INFO_ENABLE), .mask_shared_by_type =3D + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_PERIOD), }, @@ -1343,6 +1350,16 @@ static int adxl345_read_event_value(struct iio_dev *= indio_dev, unsigned int tap_threshold; int ret; =20 + /* + * The event threshold LSB is fixed at 62.5 mg/LSB + * 0.0625 * 9.80665 =3D 0.612915625 m/s^2 + */ + if (info =3D=3D IIO_EV_INFO_SCALE) { + *val =3D 0; + *val2 =3D 612915; + return IIO_VAL_INT_PLUS_MICRO; + } + switch (type) { case IIO_EV_TYPE_MAG: return adxl345_read_mag_value(st, dir, info, @@ -1357,12 +1374,6 @@ static int adxl345_read_event_value(struct iio_dev *= indio_dev, case IIO_EV_TYPE_GESTURE: switch (info) { case IIO_EV_INFO_VALUE: - /* - * The scale factor would be 62.5mg/LSB (i.e. 0xFF =3D 16g) but - * not applied here. In context of this general purpose sensor, - * what imports is rather signal intensity than the absolute - * measured g value. - */ ret =3D regmap_read(st->regmap, ADXL345_REG_THRESH_TAP, &tap_threshold); if (ret) @@ -1403,6 +1414,9 @@ static int adxl345_write_event_value(struct iio_dev *= indio_dev, if (ret) return ret; =20 + if (info =3D=3D IIO_EV_INFO_SCALE) + return -EINVAL; + switch (type) { case IIO_EV_TYPE_MAG: ret =3D adxl345_write_mag_value(st, dir, info, --=20 2.47.3 From nobody Thu Apr 16 17:47:19 2026 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (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 591F23ECBC9 for ; Thu, 26 Feb 2026 15:11:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118691; cv=none; b=i9Bucpg/Tn7MXKEaWHXRjuiXGMuvFteDKFPKQBfdn8/XMlaKn6kJtaqBDMBXHbHjNHV9S/w8zujJvfZS9UMN5EBzlcT7aQt8QZXGJpg3shkyTwZtTRidFsbZcHUzqAtto4P3kTDJ1RO7ZPkd5cM/3pEMZZdUWIWrq12oBFwhhao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772118691; c=relaxed/simple; bh=RCSd/4oQBDUWrPPJPkxgbdapWWuW2JQEIii1gWkOPuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MrFzZwa+cUzo7x8MPS43907rcq0amfvt3RdTEEJ/9rkSQwb6dZ7nDen8NsLW/dUBR07IdK8yyX1/+Hs280+OacZNAGk7DfK0gMvkcK0s1qOHbKENA8gUDkovGEEXcsSzLFj99xpKikaKqiTAIYCq4KHrTvnP1zSCO7xnN9u4uv0= 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=GkIZPpjp; arc=none smtp.client-ip=209.85.160.177 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="GkIZPpjp" Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-506a019a7f3so11867341cf.3 for ; Thu, 26 Feb 2026 07:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772118689; x=1772723489; 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=3Jc+MOUwKatfWFOZ+bC1UaXsxiBEETn+4AvPc46kCF8=; b=GkIZPpjp0nIW8SdUhZ9H0LLXf7/L18tizZmOLDaMWwmOoUYwdnxX8RY710O4u7g0Bn S3xS3H2R/xugoYGcm3iouT/XDnFvfMNBQ4Wlg2l2HNTPPLBI6Fiw0uT7bcKo2aS9Hvwh 1EEfIQzhQVsoM9HPLAncxdh4fdAT2qcIzad0IfWWBIn/zglEjhJzyzKwDPgamMQH3Z58 JWKT4Jj9RV7rIZdu511RINKq3eUmST+3d8s5yfeDU40GbLb6uFZDFzQyo75JtNFfcib8 pJGEA1ceZQCSkNIu7qNFFNmZ8AiymT8zDl675avvXnQ/EDApJtdx6b/6reAfvZmSp2b2 y5FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772118689; x=1772723489; 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=3Jc+MOUwKatfWFOZ+bC1UaXsxiBEETn+4AvPc46kCF8=; b=oicWPt7KwcAr9xH9ShxCwpE0lnRXTEM0i0GQgwjsU/349ZJLUc8TOTdezWqcuL7y80 H0EBN3Cup89lT5NhOmr1ZjkNKT4oqNpWD2reC7uRpyloRTwhomBYdw1lqdJU7FRAflkS 96t3nn5CqoOzkOyWfcpcJAdNGfqJ8QFZK/JhJLaGOiQNZBeE0lN/sF8ax+2hb+DlvTKX TqC8Jm4QXPNrUPWMZaBEYlputSlES/u3xMorEsY7z6Dka9qLz/pwj2jkz6N0oqoKR60h YBWByvA8ErLpotnTpvXMZeJKQiUQx3BXpHqrMX4lWeSVLVAeEBTB6O78v0391ckONFIt euzg== X-Forwarded-Encrypted: i=1; AJvYcCW3Cd+3PB9dKBiCEmnUyAXLLRBHDyFjd6Djsy/L96UKn1V77zYqw4DaEFX6l3M74IVBidVTaO1BkVeEO1M=@vger.kernel.org X-Gm-Message-State: AOJu0YwiOGZZoQF7GOP4DKfuxtlhiQbGuNS9MnoOlJFKvdu2y2hZ9DzY qPxB966wrpub9lS88+nKeCGL7PpEKcWUEw+nL0QBotBsv8uh6+gcrDqM X-Gm-Gg: ATEYQzxAjL/CYXneGU/9tLgGGnB+uTVZSNg3CfsI8ra1z+3P85eMUZmRUCqI9KvupNX 9siAXmjJAuFlhb60xbDU4crFugB/oP78/tQvmUdKs+/axw2MQqTRRVi0VbxLmphzMg3AxAhzikY XXqo5vPnjiYhyN6neXT7a2wRqnAwdoWOyXT3LA3Bo9Eh62Vmwl7LJxsTD6xqf7APJh1GGOLun2a f4wrz8Trcxt4+EEoBgIWXfrhc1SWq+u5lISXyHQxseqyvmIyzaMyArQK3hjsgGjdDnOolIGZsFt n/YBDERwov5sZWS0caSGBL8dDnUCtfYOtEl1pO0RihSa7XKyzlyG5ITW41101jIpz92woDqdoHw 9dt90ORtUjWIOi53htnORAlhoV469gJpb6V9e0YhNVpdUF/hJBqQhI6EUezL1LA1SiQvy35XCf+ RcqWvd3zERcXuProGEdu2UoW5Es5V4TRsi/qJTHEZMu5UgXxOG0f9V6TqBmaNQsw== X-Received: by 2002:ac8:5855:0:b0:501:4446:2ce with SMTP id d75a77b69052e-50741f85459mr63908431cf.49.1772118689177; Thu, 26 Feb 2026 07:11:29 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c738e661sm19275136d6.43.2026.02.26.07.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 07:11:28 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: linux-iio@vger.kernel.org, jic23@kernel.org Cc: dlechner@baylibre.com, rdunlap@infradead.org, skhan@linuxfoundation.org, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v6 5/5] docs: iio: adxl345: update event attributes and scaling math Date: Thu, 26 Feb 2026 15:11:06 +0000 Message-ID: <20260226151108.22383-6-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260226151108.22383-1-0rayn.dev@gmail.com> References: <20260226151108.22383-1-0rayn.dev@gmail.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: quoted-printable Update the documentation to reflect the recent driver additions for event scaling and the double tap threshold value, alongside correcting existing technical errors in scale calculations. Key changes: - Fix the 62.5 g/LSB typo to 62.5 mg/LSB and add SI unit conversion. - Correct decimal precision of in_accel_scale and in_accel_scale_available to match the actual SI unit (m/s^2) values reported by the driver. - Document the newly generated event scale attributes in the ABI table (e.g., in_accel_mag_rising_scale, in_accel_gesture_singletap_scale). - Document the newly exposed in_accel_gesture_doubletap_value attribute. - Add a sysfs example showing how to read and interpret the newly implemented event scale factor. Suggested-by: Jonathan Cameron Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> Reviewed-by: David Lechner --- Documentation/iio/adxl345.rst | 51 +++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst index 0e8977345e9d..978f746a8198 100644 --- a/Documentation/iio/adxl345.rst +++ b/Documentation/iio/adxl345.rst @@ -13,7 +13,12 @@ This driver supports Analog Device's ADXL345/375 on SPI/= I2C bus. * `ADXL375 `_ =20 The ADXL345 is a general-purpose, low-power, 3-axis accelerometer with sel= ectable -measurement ranges. The ADXL345 supports the =C2=B12 g, =C2=B14 g, =C2=B18= g, and =C2=B116 g ranges. +measurement ranges. The ADXL345 supports the following ranges: + +- =C2=B12g (approx. =C2=B119.61 m/s^2) +- =C2=B14g (approx. =C2=B139.23 m/s^2) +- =C2=B18g (approx. =C2=B178.45 m/s^2) +- =C2=B116g (approx. =C2=B1156.91 m/s^2) =20 2. Device Attributes =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -94,27 +99,41 @@ listed. +---------------------------------------------+---------------------------= ------------------+ | in_accel_gesture_doubletap_reset_timeout | Double tap window in [us] = | +---------------------------------------------+---------------------------= ------------------+ +| in_accel_gesture_doubletap_scale | Double tap gesture thresho= ld scale. | ++---------------------------------------------+---------------------------= ------------------+ | in_accel_gesture_doubletap_tap2_min_delay | Double tap latency in [us]= | +---------------------------------------------+---------------------------= ------------------+ +| in_accel_gesture_doubletap_value | Double tap threshold value= | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_gesture_singletap_scale | Single tap gesture thresho= ld scale. | ++---------------------------------------------+---------------------------= ------------------+ | in_accel_gesture_singletap_timeout | Single tap duration in [us= ] | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_gesture_singletap_value | Single tap threshold value= in 62.5/LSB | +| in_accel_gesture_singletap_value | Single tap threshold value= | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_adaptive_falling_period | AC coupled inactivity time= in seconds | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_falling_value | AC coupled inactivity thre= shold in 62.5/LSB | +| in_accel_mag_adaptive_falling_scale | AC coupled inactivity thre= shold scale. | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_adaptive_falling_value | AC coupled inactivity thre= shold | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_adaptive_rising_en | Enable AC coupled activity= on X axis | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old in 62.5/LSB | +| in_accel_mag_adaptive_rising_scale | AC coupled activity thresh= old scale. | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_falling_period | Inactivity time in seconds= | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_falling_value | Inactivity threshold value= in 62.5/LSB | +| in_accel_mag_falling_scale | DC coupled inactivity thre= shold scale. | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_falling_value | Inactivity threshold value= | +---------------------------------------------+---------------------------= ------------------+ | in_accel_mag_rising_en | Enable activity detection = on X axis | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_rising_value | Activity threshold value i= n 62.5/LSB | +| in_accel_mag_rising_scale | DC coupled activity thresh= old scale. | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_rising_value | Activity threshold value = | +---------------------------------------------+---------------------------= ------------------+ | in_accel_x&y&z_mag_adaptive_falling_en | Enable AC coupled inactivi= ty on all axes | +---------------------------------------------+---------------------------= ------------------+ @@ -140,8 +159,8 @@ When changing the **g range** configuration, the driver= attempts to estimate appropriate activity and inactivity thresholds by scaling the default valu= es based on the ratio of the previous range to the new one. The resulting thr= eshold will never be zero and will always fall between 1 and 255, corresponding t= o up -to 62.5=E2=80=AFg/LSB as specified in the datasheet. However, you can over= ride these -estimated thresholds by setting explicit values. +to 62.5=E2=80=AFmg/LSB (0.612915 m/s^2/LSB) as specified in the datasheet.= However, +you can override these estimated thresholds by setting explicit values. =20 When **activity** and **inactivity** events are enabled, the driver automatically manages hysteresis behavior by setting the **link** and @@ -270,13 +289,13 @@ Scale range configuration: .. code-block:: bash =20 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale - 0.478899 + 0.004789 root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale_availa= ble - 0.478899 0.957798 1.915595 3.831190 + 0.004789 0.009578 0.019156 0.038312 =20 - root:/sys/bus/iio/devices/iio:device0> echo 1.915595 > ./in_accel_= scale + root:/sys/bus/iio/devices/iio:device0> echo 0.019156 > ./in_accel_= scale root:/sys/bus/iio/devices/iio:device0> cat ./in_accel_scale - 1.915595 + 0.019156 =20 Set output data rate (ODR): =20 @@ -312,10 +331,14 @@ Configure one or several events: =20 root:/sys/bus/iio/devices/iio:device0> echo 24 > ./buffer0/length =20 - ## AC coupled activity, threshold [62.5/LSB] + ## Check the event scale factor (0.0625 * 9.80665) + root:/sys/bus/iio/devices/iio:device0> cat ./events/in_accel_gestu= re_doubletap_scale + 0.612915 + + ## AC coupled activity, threshold [0.612915 m/s^2/LSB] root:/sys/bus/iio/devices/iio:device0> echo 6 > ./events/in_accel_= mag_adaptive_rising_value =20 - ## AC coupled inactivity, threshold, [62.5/LSB] + ## AC coupled inactivity, threshold, [0.612915 m/s^2/LSB] root:/sys/bus/iio/devices/iio:device0> echo 4 > ./events/in_accel_= mag_adaptive_falling_value =20 ## AC coupled inactivity, time [s] --=20 2.47.3