From nobody Fri Apr 17 01:39:42 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 29DBD39A806 for ; Tue, 24 Feb 2026 14:04:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941846; cv=none; b=owqR32UgKUlyy/i7NlmXoHX7B/kHUl8TH3W8+ngnUWnYTYq+qNIzG8BZ275bFpe4NIHEFMlb5USVlS0rYpZRkpzuk1UTDWHQ6FHukvBMTHIGsUNLc6oSqMot7WOnlE6aQh01fctRFXHcEKpYwLx3dfv3q03ShgHXPaYccz+WiCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941846; c=relaxed/simple; bh=pQavWAYPpsey0yQqgVWWpFe8QdmDgqTBdo0zNEICEsI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MKQMBlmZ3ryM1yP0cvSffe7UecDeXw19wDfiPXiQUcPbhTIw9ojw/gaS5e1Wc5TIOMeDi92APBBmvUW7xMs03Epf26Gf8vTqTUoTA9MaGNT5jD/g2XLeyX6ZHTuuTuG7kwJmOS+bFeICcDtLyNnbm6BDMIe8e/oKmMVxaR8ptDM= 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=R0UIijTd; arc=none smtp.client-ip=209.85.128.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="R0UIijTd" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4836d4c26d3so48497425e9.2 for ; Tue, 24 Feb 2026 06:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771941842; x=1772546642; 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=R0UIijTdn4zZ5CTj58056vieMdKpwLzA3/zUN6dJoK2UNN6V0Y0Nkg4IZmB7ilFZTD f6w0s5SEwUeBlDh4vYR6G7/OPg+dmXdrKWPkZz8ARzn/VF5IQZeeMVXWrAq4SsL0YLm9 bQiZwoRo3CjshbWk2vZ8t02CYR2xSTUR9LAiJy8bJx6t+zDF7WjXBojM09YoPnS3+rKg X8VcdBw9lmMqE6RwSBc/sJeKwr3dwbzYuHkj0YWQ07zF/ju56ZWGU8yNFnNta8ZTK+GF E9Vd9ANz4bVkyXRahvTrPAJ1z149/sRACXIsPVdGfbrFfxA9qH6isRldX3l/IqQ3wRAB s0Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771941842; x=1772546642; 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=ZBjBDC8Cj5UNud4vwaBW6B9TrP3GdkT3E7yUc6PK9m5sXbOhMeH2B+vvdpLFY5GkRO k/9KEUpMBMP8aKDJDO2AftqXnwQ4K7GzjF4GVDHfijTOb8HMzXtePHJfvDXMs22YXRmj ie31bZbxgpra3biaHjekj9Pz+UvaS3jp495iRjU25l/ejY6c4xp8uAHBEFT/SsS96+Cd Xq9KFIqGsnjq42ZUgbe2jsUaVdKQS4GjH7pQtbdYXJYcNa51zBHB550OkmWdB1QGqKEB XuTn20wuIOq7fudsLcbzp+/LtmvY4MtmZ2Zo3aKda7HOaYtBI9Dnjw/msUlV/lX0um8c 2anQ== X-Forwarded-Encrypted: i=1; AJvYcCWc6nB25jkvO9x9XFlawRsBMHEKpQgo9SSy+DP85Hq1Isxqsb+kE01JdS85HLlIKhl18nS9LThWS4I7jPQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzHRtdHtXobKFEjPT/b3GoKW57mmjFiMDDoYv2nJhC0qplVqtUJ AFfAprKQo5H0IG/EOKpRRZcY0He5E+KoxTfjPwyBkacjJrgBCdgyqL4h X-Gm-Gg: AZuq6aKb4BO4AA6RWp9dINAPfyTj9VavwVKAD193XZstTqEOGNWoNgpFyt5t0Dq8DkL K9130NXcWuvtfnQ0aOzc8W+rM6Ss6T83LC13u4d7xOKbiHbSE86b2gY+nw0azgM/WIGju4xEVs2 qvesIRkRkKFlU0VN5dWRp9McseKHWu0xdV2WZAebZeARjFeu+zDseU9m97dV030PR6tbpT0dcSi YB7C43hG8m/650zXmoYMmUzlVanV9AtAtVnkYKb3kj8QapPdEmvYsdmNjc0OFR9Gj3gKaTWFuUG /DVBiUuOs/Lty8tm9BW4en1oI0kJ2l15qB4aMCbPY2qLlY/IWPOXPMDvXZ6xlEcFSrzWYJdTLiC lcEhVWOrHYAa3Lv5q6RRhXXJxzlU3Gik+dS71WnSTD/fyW9pkehxnC+qIvM6b+oSoqQPmAo7N3K qtCzhKbrE7aFvS3qM56lg1NYnTKnrR8MiQ4YuqHuLP4J+fEDkusjgBb8F4KOBtPnpc4XLXnW5h X-Received: by 2002:a05:600c:1e28:b0:477:5af7:6fa with SMTP id 5b1f17b1804b1-483a95fe96bmr179774455e9.32.1771941841959; Tue, 24 Feb 2026 06:04:01 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7010a0sm1043505e9.5.2026.02.24.06.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:04:01 -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, linux-kernel-mentees-archive@lists.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 v5 1/5] docs: iio: adxl345: grammar and formatting cleanups Date: Tue, 24 Feb 2026 14:03:44 +0000 Message-ID: <20260224140351.27288-2-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260224140351.27288-1-0rayn.dev@gmail.com> References: <20260224140351.27288-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> --- 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 Fri Apr 17 01:39:42 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.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 942B937BE70 for ; Tue, 24 Feb 2026 14:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941846; cv=none; b=cUGimLNm0fXdeFN/1vQcMrV1fuFfBAPtq1mHrfQ7l1yOheO/epmPTA4DleXpAnxsDe90OgKyPN9r7SGjUqt1sNmUug4YA+FxuC+WX6pYuotiebbfpuz/EnPes+7r38Ypg7s2UC4Px5oDkM9WUfMDd1Fh0kMafsJqtHgoV5lGHNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941846; c=relaxed/simple; bh=9/7QTpM9w9CetgDRp3W/v439sqmC/gELVsuHbq2pmD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bf7bmd4tAHrnf+PHUD2u4Oiul9sSV89R5aWsXi/E9xqUCeMfI5TaHtNybRJAQuW3ZOPvww8z31dfL/aCIiU2tHzm4gl1WxghAUd9CDBvys/5DJxRQLi9c20G1YRuV33gdRhaAbNvCRtfnMc5skVgvOMp4x2CuyNtp1GkNdoK0to= 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=eC81deql; arc=none smtp.client-ip=209.85.128.48 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="eC81deql" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-48372efa020so44447245e9.2 for ; Tue, 24 Feb 2026 06:04:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771941844; x=1772546644; 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=xbmaZh646ZKImMHo419Q/3GSUkucF5/edL1/4X8vppA=; b=eC81deqlDrSuOuJTNTb4+E+xrQRt0V/yN3broUd32Cgm6vKXc/6nPdyn97cmcdVYRR 2mhNqaoKrOL47Sz0VpERzLG1RxsgZd5LOulGVEM7ZSGjm5oC289VmmRs24V+blE3QNP1 qToc1IYf8/qZ2CNdb3VxDFOYYahTxTXAQQlZrZy1sfDjg7Fp1aVIuc1l7PDqTR3BcTnY a8EcnlOb06hPLBcHnzDCL+uWbGowf2J//IPHq/p5IXHgwUtalUliq24KbgpwJPc6Zfh3 Y4HC7DhrbrpkqWBI1reJfOUuD5Eso5HHCZn+HncS8TVYL2Z8AIisUojFoGOWm5J1h8hX 0rcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771941844; x=1772546644; 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=xbmaZh646ZKImMHo419Q/3GSUkucF5/edL1/4X8vppA=; b=R1vLcyeTwlVAkHT4Xs/BPzoRvYr+n1ubvKWyHkiEvsm07YUVE79jS/5JOhyGY7ZO07 WnXfM0SuETkUf3Uc0T78LHYXxm0fklxhKc8XHEER0tXXwcg0dTYoeXqTwNBW4rXT8mrz Sx1FzVFB2rciawYU1InBNrP8I2uB2SgM/Yyn0JupxIiD/TTE4UR30rUvk/KOB++ofRNy mTuhlYKlXYiPJjAvucDEMJmSpwDfNon4DirT90tNWVJmsHZ4w3rxiP/9zO19+yqJ8KzX moykKBlB2NsePx2wQsNTQbio/jcq/u/d5XVRvwdx+MI+h+RK5q51GO5P1w1sAOSD53G7 mDeg== X-Forwarded-Encrypted: i=1; AJvYcCUJNvvvCLwFn4ag9oJ2aokoEJUIRenQnuKAfC+HC7WRCMlQ1XL9XAIqLOrri5KQfmjb1OwiNphCP+ibvi4=@vger.kernel.org X-Gm-Message-State: AOJu0YzBKmif9JqLV7AVTZ0lRmQNDonrVc8SM9GswNJSmI9kv8ysEvG0 LtkjIKZkXVUY7GkpMBI1t7tEP50M6qFGM1mSWhsCUfI7b8Gu1Yc72Ynq X-Gm-Gg: AZuq6aJhpErxzQOKj2J5HBwVV8n/n9NZP6tB/rDpdyRvKbz8Kq3x3eojTKbJ8Y/TsTw w5TvztGn+QD/xLNo+sLRikSEIguAiDWPvbt9P51JvWa40JWWx+WmyOhg3LgZKzH6jrlASr8kceG cUXp7WSGlei3IWy2lgRsu+0QpPHfQGyaWwXUGbk2TtkSOVLMn/cY/fIZQGNxpiKEf8T/RhjX5Mb uEBjMpSEwitCPxaGnmBDEruNnZbQMF+SU5LU9CKahsNU7MS1hXzYp9tPkynX2H+2aDmjCygj+pw cpf9rYDjuEQzzVuU6jx7g14YLhf3pXwSu3cD0Pj1FkDJjQhR1s6DawuvuJVOLxQBjf64OYfDhrs /ag7O1PA7hCPd+9Lu+IWBZfiHCX4wJ8ZK6LNUDVpGoE4ilb3qL1j7O5it4bRvicF8uD9Hi+6YP4 3rurTjgKO7w5EwZWGf9Q6FgqBR8Kzi4iaVy9JLlYF1cnAUecsM8j5/S+x8v07tDR/bzxFuVxm3 X-Received: by 2002:a05:600c:820e:b0:482:e5d4:b7ca with SMTP id 5b1f17b1804b1-483a95f7d94mr187018185e9.8.1771941843952; Tue, 24 Feb 2026 06:04:03 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7010a0sm1043505e9.5.2026.02.24.06.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:04:03 -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, linux-kernel-mentees-archive@lists.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 v5 2/5] iio: core: Add IIO_EV_INFO_SCALE to event info Date: Tue, 24 Feb 2026 14:03:45 +0000 Message-ID: <20260224140351.27288-3-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260224140351.27288-1-0rayn.dev@gmail.com> References: <20260224140351.27288-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> --- 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 06295cfc2da8..5096baf233f0 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 Fri Apr 17 01:39:42 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 8FEC939E6FB for ; Tue, 24 Feb 2026 14:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941849; cv=none; b=dZCjyX9/5VhXJFiFLtJJe7XFmIok3Ud1nttOC5dGePeTGTSqNz66hHIYF8Y21S2lNwzAF0KNO0OxgKM49Tf+B3btnlseeVfVwmC7hzRTTEfP8kSqf5APAHzBVkSBvk6G8WtEbKwBUwOlIEs0VC3GjAOj+Fx5evqQEe84VFMlhxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941849; c=relaxed/simple; bh=oLLb29gcQ0BdhzqDQZuPnB8XcQV025xjsRtvxagy5mY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EYNcoDEBcIXlKl7fyYp1DIwm0KaX3Cx4dFvuwUY6ZwJKazVNf1/qrSgChQIDyRhkxmxtXiW2s5JNYpf5J02g1q1RnnOseOtqoDN4/v6Mr6jT97JTO7gVoOEPr7EwVBgzqUZ9EP5ZureFlHI7j49IBzXjjNdOwtCMm2YxyVYW+4M= 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=e0zhnCy9; arc=none smtp.client-ip=209.85.128.50 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="e0zhnCy9" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-480706554beso67152985e9.1 for ; Tue, 24 Feb 2026 06:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771941846; x=1772546646; 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=JXJxDts9nitekq/TVoz9OLkW8FMNDccXXJfyJV6WzLY=; b=e0zhnCy9hl8we8Ow+/1z4tj7c/vNeLMiVlP+m8Nv1QaejlG2zFHsTC8LiPk/WNIDs4 Dv6DDVMSELtSzo+h2CrQjD/tWD90D3HAMVhbg8tSZjP+Ct71POnTR+K+hHQJnC6RB0kB djk5XPwJkE/YSYj4awO4yo5H8l/HgbiDSH6noZUhkMZ92St5fOc3FERRPSfKhuNT5Xxb jt0jquwm1YDjfpqdvw5WO10QwPfWh5qr9OkwP73kEwJ18gG0UGocI6IF1HA1XifGSlil fFgh2Z4uvwPmCGwBd6iOLaNJWmYoE4jCnSUylpw+iVpSQB75+hoJj/ogHr8bo4jzmgNh s0MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771941846; x=1772546646; 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=JXJxDts9nitekq/TVoz9OLkW8FMNDccXXJfyJV6WzLY=; b=iAC6L+SUJar4499Vym+U0eq4PuprFCkk5bKUCW0XrUtinlBzTT2IKHtT79zDBNJzB5 LWBvKtqdQvmoBTPlhaJOyHlJsOvqYL79jS0XdZ4Jnxj6f6ujHmJssAbvJ+P2jSIugZtV YAfKQDqfvLSETwfeRnx7Nn/uswtacZQEPDaPEKuzj6/pRkuyxT8Sb5R5S8F1DwlpqSQo sZM/NePUFlh/uMuIr+Rp8reV4v4px+BZzU9W0uSSm2CNaTslPC9GoYNH+FJJO7h4D938 h2Mmi2Q6hLg/pCFMlr4OkTWrkJjSJva/izuZdHxtLMiSOSAUfH9MA1sMHEa35rFdQDlY Ry5g== X-Forwarded-Encrypted: i=1; AJvYcCXa13DqwVueViusU2jz/IsCvsGhdyjmxgL3lJMlgqWYekLkbAP/nFpnMjx7nj6VmUy3PP6+8+a6xeJ2tCA=@vger.kernel.org X-Gm-Message-State: AOJu0Yxxok33ZVgg63QZEXkl/rU6ZvKK+NZouwdSPGjeJ4VQZrP4SFEy rKVrdJ8QZFjoInh8T1/UumYw1i4yPjHbBdZjaPBR1Gg9xJNCXCcWrhgK X-Gm-Gg: AZuq6aL79083NgHbO/mZzul8hcr7uaV4R8aVQnrDz5PnjH8kupPBXl8m9oSLKxcaokm 2G4RqODeZHimHsnos3fcWBulYkO0U+BP63mxcXK6E9EdfspEFNegi5TPPPKAXSbKtopLdO1+TuZ MJwxjeMT7CqC915397vdZjHgtDLeuFE4ZBS7/aS74yBoYBQBiZyEmDctSC5G+IXOlV4mcFrj3J6 cUzVp87CrhXhioUWLD4ufWb4eW5gtPeAX/odptPW2qVTGJV+SeB8SQ0OihCc5KVYcAtRMz/kL1P vzk8vgfs7JfbiiPgmSPm19pvJ6+1O4qIJrlsUgp4tDou+LzWsTh6JTjtraOrmUXuUbdQd6z5B4m dpYoG8X3yw0labiVwDcb6w54dSqjjjRgWKwJMdo6Xlzm+jsgdvpHxKwrhaHp58W0IXQwTuqZhRc 6On2SgKvwRyVfVYSpGRzC6bDOluLh4rb9FS99OQimKgxSRfqpTvdL8/1RDyil2lA== X-Received: by 2002:a05:600c:5020:b0:477:5cc6:7e44 with SMTP id 5b1f17b1804b1-483a95fb698mr228656595e9.11.1771941845765; Tue, 24 Feb 2026 06:04:05 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7010a0sm1043505e9.5.2026.02.24.06.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:04:05 -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, linux-kernel-mentees-archive@lists.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 v5 3/5] iio: accel: adxl345: Expose IIO_EV_INFO_VALUE for double tap Date: Tue, 24 Feb 2026 14:03:46 +0000 Message-ID: <20260224140351.27288-4-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260224140351.27288-1-0rayn.dev@gmail.com> References: <20260224140351.27288-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> --- drivers/iio/accel/adxl345_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_c= ore.c index 78e3f799ecc1..1ac99263ad8e 100644 --- a/drivers/iio/accel/adxl345_core.c +++ b/drivers/iio/accel/adxl345_core.c @@ -235,8 +235,10 @@ 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) | - BIT(IIO_EV_INFO_RESET_TIMEOUT) | + .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 Fri Apr 17 01:39:42 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 9DAC03A0B0C for ; Tue, 24 Feb 2026 14:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941851; cv=none; b=oxNRmHQROdtzHThbe1sua9QvL+4VnoBZXI0l6HkyjFk82/rfkjLNblBT46bPBcl5Kr19Kg6QXwzJzttECgy22p+BvRaChFd9B32zh/cmXaXhJEwolm2BohjwIQRLd0XFvAHCSmLeKZYBdIU1YnAhwzg7pQvVVYBVS4fLTeIzU9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941851; c=relaxed/simple; bh=au0e4ypE6x/0jDdOhryMt7CY81fCNnbWNQRijiJCi8g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ezV76ft4Olqu4paiek7ExoRDLdPgZokl5t6roKG9+ON2cfAL8nWHZstQfq+uXs18338P7RKuvQv8jNsu0PDLDWym2MOFkeN/XkvIzNYTtE90vWlW6fVC2BXyURtpyDwh03SBZvSEXGXo78Vlz1q+Lz0qnG0VKcuo0eWiyzg/40A= 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=RAYqyike; arc=none smtp.client-ip=209.85.128.47 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="RAYqyike" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-48371119eacso65578045e9.2 for ; Tue, 24 Feb 2026 06:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771941848; x=1772546648; 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=5ecdWDoUpwMTmcnEbrWr6+7wrPFW+milCk6Hirg8t6A=; b=RAYqyikeoeHLs9HnL3NsRYx4WoH62zSUshSllM1ASby/aWFWCSkDmEBrTXNGEKDCKy fMfsAP4uvy53IMeDSu2YqTFMBQ0Ubr8mH6YlQ+Ece9E2Sj27bWnJ6BoClqdyqe6VhICE fvtnFtLlBy+d0SOauubwQdTt7PMYj9Tnw6U3myphBRuQypjiADbAh8bKpiXilEAKLU40 wlf7oaAEeoausjMVvoYImJFHi0GTN7hcyYSdMrZ5uzzam90ukEh/5cbkoDZY/rDWnH1p kz0Zrf9oilRNcSd7etbJyXOxMJ4G6tlI+u1zr6N5DCH9CSDWC4P1chF9H1PIVTufy3x7 E7tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771941848; x=1772546648; 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=5ecdWDoUpwMTmcnEbrWr6+7wrPFW+milCk6Hirg8t6A=; b=ZC1Uz1z3k2Oy0GU9x64Ws4jHIRAWyOJopLnYp6m1uukLe0uuO/GKh57NRjhQXWqPhG zUZ5SZQesWqewCbAhoAPgwUoRUR95zBoifR7e/cS+uBDrbzaUW0NqPZEzxJaZRxG6lEK yfeSTcTVUITBl/YTuTQ0xdefikXDoOCQC3+rjDOoGWzUk7wePmz3Aht4IB4dygwNoT0e lxZ9WIUlgQBuvgpEca7ZGHDkDDsAtdY2IWnE1AhzoWA4YdRG38vTkLVC5XzNymxot0q8 Sg+v99oLz6am8FzESbQxIhg+CGCgxgEkZIElA0/wQDtldt/jTiiWHH6ZXiaZnKBBWslz eatw== X-Forwarded-Encrypted: i=1; AJvYcCVwcR1xEBRbGqFNYuUo1g/2WuVKALWSkAlXhM+HfkJX1thtbgOluDqDOCr1MnOa9r80FLCMrbek+kUVroQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+jzgGJYqTEqgKvgRcq459wwwSHr2F8z+6LV3rrSxGDxn9Irqw H+/R3HmE3oE5d3spKmzbafmu8ymyzyVpkg+sLVvXGRmRP6ALp8oiAdQl X-Gm-Gg: AZuq6aJgGaMP7+eGpD6Y/pUYBmLyN6s+vH55ncqoxUisecqwoyIHCHV5y+wAR9c3gSx lFjS+NefBL6s7jnWQLh5C5hwO/M6MsQeQcJI2uqm02IfTmJ/SPx7Q4B16v9GfQ5JHdyml8W1mlN zysapQzB0WCRcqK4DNKaTkuc6MDcJlW+1AbSYopDEUyyiWUTE2bePiVhmvAyI6uYk67OMT/QSnD BeOb+oC/SS/UO5k+trau+jQzF9E5d1dg5aEHGMG1/sYjY3c0FrqtMpd2bZ84Cj65Y7b2bUI+UfC FaskE6QgiVVj7QJujmt/CnvLHEgKL6iMhjLGE1OIq03WjvXeRdtP8EG+tjvZ5wrdH4eF28Mx0QB AAebBbuwHkvaPKFexHzZZbc7pGBiTB8tAx2oqOpJcXRMSCRQLIPybfvJllK5HvbVU+h1gHJS0EP qn6EfRU4ed1nyglWhrW40IZxDJM8OXkJFuFdj+yUdCZp/jAVZcjzfMy/i/dCj0pQ== X-Received: by 2002:a05:600c:1e1d:b0:480:f27c:6335 with SMTP id 5b1f17b1804b1-483a9637a55mr221457985e9.25.1771941847732; Tue, 24 Feb 2026 06:04:07 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7010a0sm1043505e9.5.2026.02.24.06.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:04:07 -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, linux-kernel-mentees-archive@lists.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 v5 4/5] iio: accel: adxl345: Implement event scaling for ABI compliance Date: Tue, 24 Feb 2026 14:03:47 +0000 Message-ID: <20260224140351.27288-5-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260224140351.27288-1-0rayn.dev@gmail.com> References: <20260224140351.27288-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> --- drivers/iio/accel/adxl345_core.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_c= ore.c index 1ac99263ad8e..722b5018757e 100644 --- a/drivers/iio/accel/adxl345_core.c +++ b/drivers/iio/accel/adxl345_core.c @@ -213,7 +213,8 @@ 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_VALUE), + BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE), }, { /* activity, ac bit set */ @@ -221,14 +222,17 @@ 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_VALUE), + BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE), }, { /* single tap */ .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_VALUE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_TIMEOUT), }, { @@ -238,6 +242,7 @@ static const struct iio_event_spec adxl345_events[] =3D= { .mask_shared_by_type =3D BIT(IIO_EV_INFO_ENABLE) | BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_RESET_TIMEOUT) | BIT(IIO_EV_INFO_TAP2_MIN_DELAY), }, @@ -277,6 +282,7 @@ static const struct iio_event_spec adxl345_fake_chan_ev= ents[] =3D { .mask_separate =3D BIT(IIO_EV_INFO_ENABLE), .mask_shared_by_type =3D BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_PERIOD), }, { @@ -286,6 +292,7 @@ static const struct iio_event_spec adxl345_fake_chan_ev= ents[] =3D { .mask_separate =3D BIT(IIO_EV_INFO_ENABLE), .mask_shared_by_type =3D BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE) | 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 Fri Apr 17 01:39:42 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 AE2A939E6F5 for ; Tue, 24 Feb 2026 14:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941855; cv=none; b=e1owKHXEcvOm1T4ilj5mO0se+SeCh0Q0Lqr/kqyIJDveSe4ihTybcROZtXBKQOIoPO6H/hYAysL4E/dBcDqNmK1jKkqUBcuBBoBx4ONV0D4XMbK5hPiaabSy8UdbjqBfLRKRYCrRCUwGfC4WfcxYGFC5u779eZ1yVBPhnEvFVos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941855; c=relaxed/simple; bh=RCSd/4oQBDUWrPPJPkxgbdapWWuW2JQEIii1gWkOPuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MkbqAxgJ3EsC++qw4RauQ0dFSU7N3FKaAzDZg8SXCwgo6zlYz/quD1CpGwtcpVySgLodHJImAnU2/7hUWxaAvgqHbYYW7m631heEcVDUvHlHUfdPI4DiClrABU9bUAyTo+ly1v5sO62K4aSaGu6N/nWeHSa9aSxyO1TafgnHnSA= 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=iX4jYyCx; arc=none smtp.client-ip=209.85.221.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="iX4jYyCx" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4359a302794so4172902f8f.1 for ; Tue, 24 Feb 2026 06:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771941850; x=1772546650; 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=iX4jYyCxV075TS1zJCpGSsvmhT+7cae19tJvRjGvz8/kKoxP6D5kGvXCmpQ2C7jrn8 UDoi6FdRc5LRE7+Jp8TDM0w8XbnAl3+vfKc6Oq4ZwEVa12y8E/diC/+hcyyZKJ9WPnG6 NDq2Upf7cfTNCvw6fTDuV83XNbqIIrHb1rWW9EOx9vNfT1dS2oP/y2fWms7V/XIlkiHA Yc6R9fRANbIv+DOs9x6KMVc+migLn1GLLCUjvyuYlEc3BSKA2LaAIX6JWqhmnszYEv8c bJOyyxs5hzf100rrkdYGdntcbexPdZDFp2XFlC1MsC9q3v8//3Muc2PYn8zZQi84uWHW bRMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771941850; x=1772546650; 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=UzuuzT1xQ2HJinTHy6ISTXJZfmcEBGGqkV8tv0w89BTDEXwp3xockwVBrMvjI9cFeL wWkwTZe0+pkGuSLygPAuwjYyCJtmtK2xsu0YibjgoosEfmUkQ9KJ77hchN0KW6poMu3K Xt63uknHntRgMz74UFfGyEpb3GSXxVqSol+BgtZnyxfLtqxl4wpWX8hVzSCbmW1ubKkx xLZiTtc8GHpYcVmNVucuH8EYFYOvYntoOkwfvxcTPm6BIjVDVFVjb+ZKD+Z7+B53xZv4 Subkf1htAIEzB3wQSl+CJ4ny2EZXjZROan/BrtIfnMZPT6FCquxF5hxp5DlJY5z/JzpR Be4g== X-Forwarded-Encrypted: i=1; AJvYcCV40xtlXcj4yX/g4BbaZK41BTLZ/MMs7xdr/Fuf1PI8GGKh014GhS5dqDVL+KISOBoNgGw/GFABoeP1ygo=@vger.kernel.org X-Gm-Message-State: AOJu0YxKmkh4uitzyz5kOytOih2jJqZEryDnAMgpI9v6KtsjbIahsjB7 tI79Jjiuh2oDFPX54GESdPrhM3c3HwVfU1Jx46+GEtjPZiafh/mi2JXB X-Gm-Gg: AZuq6aLkOTkA1hpDEHebj6h4tc1i2ptLIhXjR8cKhR4Ycg40eDRIqTqyu0pEd/rbkUC iLiFl1Mfz4Jj+TNce/D2KSi1f52RJ/a1fitMIZDjSm0tG1nS+3KkQeb+lEdDc0cGGlGt2+rTE49 Jrk5UfUGe0R2csJLfl9ZODeeyhlsj8JxHRYXEXSdxxkp7esG9SVjaQ8xWDvCi43c5+VFhMFUzGV ywmhBn/fo0Jt6vSZJFM5CWygpNExs337QYV+D0w/2dPG9eoAE8NogZCxcUu7I0TRcNyMfVZ5tLJ BLgzXiI+Y04Zh26+6MJazrPN5lTbYuxB3KG/9eclJXIlMJwU4Q9NuK1LNRLXQPfvw0kjn+8yPGg SdwXQQkfOY3JKHCrtl+BH3d0OdnR5xT/yD5sK/Cw64L28ttElWhsi44rx43DB4ju/71h9LkphFs iW2ERRiHkeSvgtJFydVtDQBdl6OGMIgMKMCl375Y9TYFCWm8AEnGej27bZGd/CNA== X-Received: by 2002:a05:600c:450e:b0:480:1a9a:e571 with SMTP id 5b1f17b1804b1-483a95eb2ffmr193425535e9.22.1771941849568; Tue, 24 Feb 2026 06:04:09 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7010a0sm1043505e9.5.2026.02.24.06.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:04:09 -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, linux-kernel-mentees-archive@lists.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 v5 5/5] docs: iio: adxl345: update event attributes and scaling math Date: Tue, 24 Feb 2026 14:03:48 +0000 Message-ID: <20260224140351.27288-6-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260224140351.27288-1-0rayn.dev@gmail.com> References: <20260224140351.27288-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> --- 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