From nobody Fri Apr 17 10:34:38 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 951189476 for ; Sat, 21 Feb 2026 14:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683191; cv=none; b=qtaUImCXyNAhStmQafhyVVp/wrrGMMfcqwpthQ4vvTmBZzyfI8+0YddW6dQ8BhAhFU0ax+v8CEFswmdubkW/SpxqusOBHmySNfN96FwmIKCcdJr4nsjK4hxHsSChuDV5Jfg9NnXpmneU+CEtXqRurhPEO0oLYkg9sVEuQxzTH8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683191; c=relaxed/simple; bh=jygn9hfhuwiAljKBRe7Yu0fCo7DdMqIwgB/WQt9+uSw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BdyXa9ypnod8lYPMyLNvn1Y26ZR1ppn4oE/03M1t2hs/Iw1uTvhqdavBjQ+QAjHzBkiR/A/T/5zYsJ6DGMcQEB/tH8CNCJsUGVUUdxY1gZ2cRRZ+e7wWi3AxDJglcAEvkcww/fw54aMUi+hC31lV1pWoqyw3hRXFfyLi8M8672o= 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=a68gP2WT; arc=none smtp.client-ip=209.85.128.49 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="a68gP2WT" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-483770e0b25so29268665e9.0 for ; Sat, 21 Feb 2026 06:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771683188; x=1772287988; 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=Det23t3gXSrsxwybIdE4hiHLe2ZCpMnMdOVYGU14wcw=; b=a68gP2WTetzwnxFbBtS56jjAGl4OvZjWSA1uUBvUMWBv9+0vqgKNdI0UA8VxWUyE/9 vcbfx0FY1GZrxe48Kfd4AH3IlJkWKAhmwYv5CcNlj3IMfNlsB54DpD3/PLPt2NUgN7PW Tl0y6va77wB0b2mRbSJVkwQw46sO6MCiHbw5gAYTng/GI78XJvjGHJNNdd+6AYd3KzCe ksX5oPg5jGZi9D49C0FFQ+UjkkzD0v7ArtiuqkkWooa1vkrxittLVMF8NEuAcloDBRzS ktTv8HCW4Jm5CPc3ndz3D7HeOwl5C/LWhjWJZJZGm7iFoxQfdXZBzSzPlm4LIs9usWG1 NrVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771683188; x=1772287988; 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=Det23t3gXSrsxwybIdE4hiHLe2ZCpMnMdOVYGU14wcw=; b=qGZNyWkBz7TsaELEZWJ+hhQ6Bf+fBvuaVPhEKEig/HloilCXKKmD1e/iUY3PmzbRYy Ge6jCVZvCRP0CLVEMmz1jL7hYZUKLVLo5UrplPaaPHfCqeLnmFk3VfVaN6olqRk4Z9mf /Wi4o8aiZ3RnuA82aQWcyPYan7sZTlRslppbTkp5V2Qj2usL1XksdyNP655H8fLesMFX rcyjrpCHGHsxzFloBgNo6tOPkNkw1OP2QCZ9jrtZ+XiBism1VXYCvP9ElLayAz/YU/yl QIFNEPdeAuA8N/L+jTBMilKT/Mx3y+d/dbfw8FHHC2JfLN74d6yOJaWZ1O71oCPUmK32 uqvQ== X-Forwarded-Encrypted: i=1; AJvYcCXSJD/4a2v5T/wAtCKRuRogx55/UZzKpctUwOONHimGkiBySKMjSSbMCDc6Yhz2tSA34BkMtK/xY8/hIkw=@vger.kernel.org X-Gm-Message-State: AOJu0YxJgCRnJXqIQqbirdDzUEcGfBUpBMFBOAGZ7IV/4OhfbAs/OCaB fq1OGVrDHTtlHPs4G0CcBBre+MNsWyknG7hWXL4mcO5Laru0uayMX3DX X-Gm-Gg: AZuq6aL+V9Y4ZWe4Kp5b7LQtBAeIZp9muc/Ri6ybU/dTl4M7EvQ/ElzAxh82PCUVUPL t4NY5fjZRFIohLGiChP2+dLjv8PItoNMHhAxGlIP9Wy4xgij2IGhHUcG6irs/b1OV0H8naqHWit tZ7VmPWiQWA9rz0Gtp6II4GVeY/FXO/r/cUgaVMQrQrFNWza1TGnCOfdyKEzpoNa7lMyqdz3DIA 5Jfp10BCJuQklbdc1ZPMiL2/DdLqGtVPtCZd9dq2oYRfWICAVy1BvGLIbGkgZSv3xuh7j1VJPPt eEjrIV/VXCXQCS3Fu2danGjbrns8gY7WWkD8/s/byTcdy1wFpYqCix5YUiAe5AYL4Yy1D/cHPpd NlfeGrNcXCadRbEtuole7aL6A4e0TLBgvnbcMqbdciXeWR+yA3apMmxVNvKtLI5jU7rYQg2AOZl +CV3evoAAwNe4AxkctjZgEo3D9W/hjTQNthb/MyDpJl1KkDOlXbcNADGBO9PaxZA== X-Received: by 2002:a05:600c:820e:b0:480:1e8f:d15f with SMTP id 5b1f17b1804b1-483a95eb591mr49289755e9.2.1771683187714; Sat, 21 Feb 2026 06:13:07 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a3e01c27sm50169825e9.9.2026.02.21.06.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 06:13:06 -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 v4 1/4] docs: iio: adxl345: fix typos and grammar Date: Sat, 21 Feb 2026 14:12:44 +0000 Message-ID: <20260221141251.34855-2-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260221141251.34855-1-0rayn.dev@gmail.com> References: <20260221141251.34855-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 Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> --- Documentation/iio/adxl345.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst index bb19d64f67c3..3ca6a78feb5b 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,11 +90,11 @@ 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= ] | +---------------------------------------------+---------------------------= ------------------+ @@ -118,9 +118,9 @@ listed. +---------------------------------------------+---------------------------= ------------------+ | in_accel_x_gesture_singletap_en | Enable single tap detectio= n on X axis | +---------------------------------------------+---------------------------= ------------------+ -| 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&y&z_mag_adaptive_falling_en | Enable AC coupled inactivi= ty on all axes | +---------------------------------------------+---------------------------= ------------------+ | 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 10:34:38 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 C938D1DDC33 for ; Sat, 21 Feb 2026 14:13:11 +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=1771683193; cv=none; b=KPDvkOBYHsegaDwJ9xksX9tK5ZQfZJE9XHpuwLe1gQ/6i9yuGIM+n+JaVeKf0mU0x5z+x9ml0aX+LG/efxq4iRGx1RdubNDWcEwiomCVxh5tmFZSqo/J5pP/U2gollr+s8z38tSpY61YFvTH7zNuia8Knq79HbeeTdaxB/435dU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683193; c=relaxed/simple; bh=9/7QTpM9w9CetgDRp3W/v439sqmC/gELVsuHbq2pmD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sdPVA7eQnznQhhghLNFeHc9MUGAx+o4fu/lGxvs/9Qzn7VujatVSN9t/dBpuH4XU0xaxYLpJ6U5qnUrLqfF2UtOkiNAz3VgsrNv1A1OeQ8JQ14KsgM9pnnzm/W8RLXLTu9yMGLrN6K96t7kjMRGWg2LucM1/sziOZiEaMU32/gI= 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=DsjNUa9y; 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="DsjNUa9y" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4836f4cbe0bso22267175e9.3 for ; Sat, 21 Feb 2026 06:13:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771683190; x=1772287990; 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=DsjNUa9yuLHsE0W9ueq4IambVxlVhi59Ff5uXyEoe6zTigob0cRUsBUoZ6j5bVof+V pYaGouhxYZp221b1KviPOKtGHrlP+nCFu9jMz9UcZ4CbiXX4KmKCOj8vVJAPN+ltP4LB AAz63wRk+p9RHzxSljPoFWCbcNFRZBE/5xg09vcaNawRgY4z+xK93juGUeSlbkLlmF4T 8uhpf5Cv3exltuK/dQdCVPJgKltl11Blf0xNvaaE0TVr2wnPmK6Gnqpno7N03sD1xBiH BBkYHQuyCkLMNKGUmoiHHKcccZbJCoapumt74ZggisoAGDZq4FMvgSisBlCG+GtHWUlT RBjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771683190; x=1772287990; 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=heL5PrAyrnZkmwKmw20e0fUZQQX+XVL5oGzjYss1BNNQkYzvl6C8uJ68hmzpZYZrsM 7gwl1kBHDzTfJEqlJH6R696dfyUpm/EjbzroSTQ+3dmdNp9nRl4SvxBeYZHyd0QYxCQy 6XL1oOcvH4kcPoEpLECSeA+GeXTDJ295iL7ZXTqWogB/oVQriZuKQIm+5qTGtdfuoL95 OGhZpwVKPkOO80UJgCepH+CJ5hRmZxqCmZITy4tluJwpSeY3p/Ge9MMCTeOXEIlF7fFx DDHkfuCqJZWAXqsjczkFLhiczhBOFyFYUSKGwYSs9q9ZiQY0avgxgM9F3Jq1CwZB2uFv Gefg== X-Forwarded-Encrypted: i=1; AJvYcCUT8dswyQbkOvShwdhAi2eBgtXszMGcFFU/UNWytzdwx5gOyKHlGYf6Tg0+B8psxxO2uZWj0XN9hkhFDZw=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8kg6KgTlwgpenbM7UozkefRCppPWky0ccYmttbbmWzBv3PQ7v nVGlxa31ldOToc55+8Sao62PjOsypXopkRylhyMo8txgGBhRRq2c66Dz X-Gm-Gg: AZuq6aKlcFPh2+PeGdNCT2WgsZ7OTkLrRtmdeDWKNg51sdLY2wPMUMCLq9CdMA9/7CN pAEXhrWvJKvFseCmMDeR093p/bBQwRWhuP4zb1PnxE7UIq7+wFQ+jUNWJA/0XMzQHbsUHu7sLoR rvjkqbiLnIpXJrMM0HZVNFCgYbwKQWpGU6kBU1VD21uNS5aHrlRXJpLQtCrz7Jy1nYlAYgd0VVd VaY8qkpQl8BuPIMP1zKSqRnC+I+iZOKErHoYstn3eqVBbeZtZA0yh7n2RQr1xQMUQwKqRK/J+36 43jlpbANPYG7WzW5B2E00WSj9AbO3WD+ZIDo/91ZxlApvbZGJ+LUhqhBTfpOFU9mZf08jpnuDnn X0Q7oIQ5Xi0M8gGqCiSYJ/qgsoWCI9bXUulWIcbd0IHf7AZrTPm2cTtN+Beh7ZmvaYGfrkWGtpC y6OuySbtLODwjC/HEGCUES/y1zdMltfrxiFc8w0Pa6GfV1+PzNBr/OC8a3D5iQZHgkPZbLWsGx X-Received: by 2002:a05:600c:3508:b0:46e:4e6d:79f4 with SMTP id 5b1f17b1804b1-483a95bf3d0mr58953795e9.15.1771683190057; Sat, 21 Feb 2026 06:13:10 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a3e01c27sm50169825e9.9.2026.02.21.06.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 06:13: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 v4 2/4] iio: core: Add IIO_EV_INFO_SCALE to event info Date: Sat, 21 Feb 2026 14:12:45 +0000 Message-ID: <20260221141251.34855-3-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260221141251.34855-1-0rayn.dev@gmail.com> References: <20260221141251.34855-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 10:34:38 2026 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 B20331EA7DF for ; Sat, 21 Feb 2026 14:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683195; cv=none; b=QiWhUw36DkS02D9oGY3p5PqNFroE0XCwh/6JXI1LgFQ50ib06CH9VZglu0Lykj/AkXCXTf/VgfrdFIHEd68ENMFcvtoy87NHkoc2bzVPvjWzAKv9zM95nOtwCNYtEzzG3doG3pT+Xkl9oVM8pICHJwMOl9LJEzQdv2zd/2LhM60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683195; c=relaxed/simple; bh=6ghLbRzOpxQn9OiRcxj7ZSUoK/TJaCcU0SrAfILDiEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lzUpUIDV3bUmkAz3EMQZs5UVmXTS3cXsi6TpLm1RUNwhYPEysJW/D2v1ERUpjIaWKltdccTawXgn7vbUf2slWgJVLQQGGhhCpy35VMFEp8fKO3cWUi5xTbi554q6zouIJQRXTUX+tMqD8EcJ7yGlKBxDuJ3p0h1h6WB6Otd27Jo= 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=TY7Rz+Fn; arc=none smtp.client-ip=209.85.128.41 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="TY7Rz+Fn" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-48371119eacso30882495e9.2 for ; Sat, 21 Feb 2026 06:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771683192; x=1772287992; 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=wQDbxuvZXARR/5hnSiCglzij1Z7nJyORRk4T/d/X+yA=; b=TY7Rz+Fn2yT6NaMz5c9aNAB2t4hpzdrkGtAPZI3+obkfK8qDdSZsmOW8gjqR2o8+10 6JD/aJ5Kv1EZJQKoapr1PBVtJ3zLBHQWzPqy1o8R+XRPmqWfmihYlPONAlIyvXIUHc9x 5lLtPyVnmVFEwkyS6UQs7v+6qkvEskhXfjbbJJl2ZP7R88H6eIe3R6b/e8y+Y90VJxPX qv7+Qf+CmVh9t/D9m36xc2m8hBTi6QsKrLtXOjKqC4wk3mvgtORuv8V9Yr9i1uwBjZnx BBiYuotKBbp/j8XqG4JYqQ4MFrvxjEopQPLP3vDUKKxI9w0wvkJvKVIpI+TyDcMeUTVR AqgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771683192; x=1772287992; 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=wQDbxuvZXARR/5hnSiCglzij1Z7nJyORRk4T/d/X+yA=; b=TZftad5/yJYCIDEu9Zo4wU0Hb/968r3RTQYvhhfY0O8Tp58MHG5xRBBOS+XeXtjyoN e7LeRiEkLdNrntrmSrVHpcuCE1MUv8q/DCbx91SiA80+kIxkJy1W5OAfuLYHWn2Sk4aq ++QqvlBCsJRm+iHKYPN326T7Xdw8awC4WEefRfVZwUNMzaqFKEpyGPZ8TNRTBK73YCGN YrkS9En7Ely3wr5dbZ/TdZLScQ0h8NaIyCRPX3HYPGCKGPYLj4ZyYDy5lVE1iZnqRL/F P26oVg1J5V6ENg5jVbcIsJ/Yu5XpiNdLdPf2EuOiSctIvmf6BlK5iH6/pBzkCxW06TuH hmeQ== X-Forwarded-Encrypted: i=1; AJvYcCVgZg9mKv6RSkL9yjFEsa24DDmpVNxbHPq158/qFkl1YfOq8cCxreGuqPSJ7rYsySYe4MBSx4K0IOTcSH4=@vger.kernel.org X-Gm-Message-State: AOJu0YwP4FZpbFY6By8Df9MFQbWC7Ezn6/J45iZvqfSrhfgCwv24pmAY eW59XW/QQ1bMlIclhoxZmjSxjAkTzf8/FliOZPFhU1jVCU/wAU0jWux6 X-Gm-Gg: AZuq6aKIgl1ZG66xteDp6CsE5ALb1o6y3iPS0Stgf12lNIXJICNWPM/h4kPsDc7ovMh qg5S+B3qTuI8loRlJaxKOLKyX8exY2Av8Ex17fbNv5o+ucMmP0ZDFxgFoZXnl7Et1CJUYmBWf6/ Zy5nnAJW+5VXZfCDValfjo9EU13GefMI5By3phGSJFZNkAMQx7x4J206JVhrV1UfpqGNZtC97ET esBaQ4WymnnsqBl2/KkJMDF/nxJB4Sn8Wt43day+7VC7cf8qtG4EQlT+OtT1sLgB7tOh4qfQpeb ud8qJgf6ZV32hN8lfmD7A1LXat66K1rhatHUSfb3WrWAOoEbQULyFjfPl4HPnhfc8hwSaALOClO FaXzTmT/Uuw6U7H+e0B70VSObIrZFUSGhAhIKfLMilYdj4rK4QCGcCNIYaXhC1DjlYOo0k/CjXc DeghpbTCcWLIFIHLaQaETphC9ue1owWbXip7R9laBQYEMJEoAkeOeauAKJL5qAuszfaoYWagHl X-Received: by 2002:a05:600c:4fd5:b0:483:498f:7963 with SMTP id 5b1f17b1804b1-483a9637a61mr40665565e9.26.1771683191847; Sat, 21 Feb 2026 06:13:11 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a3e01c27sm50169825e9.9.2026.02.21.06.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 06:13:11 -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 v4 3/4] iio: accel: adxl345: Implement event scaling for ABI compliance Date: Sat, 21 Feb 2026 14:12:46 +0000 Message-ID: <20260221141251.34855-4-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260221141251.34855-1-0rayn.dev@gmail.com> References: <20260221141251.34855-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 | 37 ++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_c= ore.c index 78e3f799ecc1..eac4ab052fa2 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,22 +222,27 @@ 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), }, { /* 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_SCALE) | + BIT(IIO_EV_INFO_RESET_TIMEOUT) | BIT(IIO_EV_INFO_TAP2_MIN_DELAY), }, }; @@ -275,6 +281,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), }, { @@ -284,6 +291,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), }, }; @@ -1341,6 +1349,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, @@ -1355,12 +1373,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) @@ -1401,6 +1413,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 10:34:38 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 722931F3B8A for ; Sat, 21 Feb 2026 14:13:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683197; cv=none; b=fF8r8HzAOZC+yi9jU4djsLgb3QrQN4GeLgDLjma4tOWFUR4Xhx8IqOWvx7Xhpzq/6UhRjdAusjsxwYDE8Az9D+XYplTUBgmbBN/Arxtw3c5iT903MrOPNI0b3489lQ0W3YbT6Pbj9H0CBuH2HDtTqsLv2+GCRU6BNfzz9dpMlFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771683197; c=relaxed/simple; bh=bfZp8VUpAavl7rFGwG+PpAa0qeAiEIKKx1OJoyUuLR8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VCVkPjFB8ZFcSkfK5oWdsbdSAMTW2gP7u8yjNzPXUnAm19TAN2W/0bnQyV7hWsRBlG7lynKGMqbSpq/cxHQrb43hSvQMvZsnKwFDOUZOML7HYYIYPMjP3KxzPHFlZvG+vi3ERCdeenrDedxCfH8GXaze2GEPs9srBNktba55Qmg= 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=CIr1Yogr; arc=none smtp.client-ip=209.85.128.52 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="CIr1Yogr" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4806bf39419so29098635e9.1 for ; Sat, 21 Feb 2026 06:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771683194; x=1772287994; 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=Uyqb+z+OnykTCLriGqefxWwK68pFJ9wGyHSk2ev20ds=; b=CIr1YogrfCk9kz8LYR44CJTxKsag9W8H0vqLvRrt0fVHRp+V58K+SdEPI6wvK0lGSf UlgaTpsXsUCjvgk8iQtFeP6pqQxIQ5VjAznNRK8W+RUoT1Vowu3RPRj+h+lByvBt1WE2 RkWn7kigNHoQp0OgnZkQT5axvXatyZuAQWidAiJjHt3FDB8FyS2Heh0RwdATCwVRoNUr zJlwyNfFG6z0/WRa/LRWvFSwQ6y9qXHfdoRFySZdqrWZWw4N5odtRJjw8zfBXO7KjuDk 1Zo+zEwmL9+ZYe0pArnN6dRE/2n5MaEUWBD7I5kS5p2krTKGtSfV1hRolMRR2h5PFxCB g+JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771683194; x=1772287994; 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=Uyqb+z+OnykTCLriGqefxWwK68pFJ9wGyHSk2ev20ds=; b=jDiHPMLwl9NWsQB+g28yq1oyAbLW/qbD5M6l84K49JKqbSTVnqbnj5+NSm3qe/Y+gW lm0grvqnePwESF52CWF+I7EQvPgu+uTF/wRFUJLCuYKzC43q11c29970HcokazIs0BVT rQlsz1d2RUjRHL/L42W5AWOOd/Cq/mNpuof8xCgJpGOoT9yyFNXfF3We0ZNw2uMl0fFZ gIvOV49YgkwLY4d1+7hLXFaipxM4d2UI/tMB9mt1UQ7mDq1gm9KP4n9CNF4orJx/ell8 uok3owKGfq++ybSZna68Zx54EV0jnTbzJI/0YewLPwGtNzsq2FcsJKrth1+jZwXePyXE EC2Q== X-Forwarded-Encrypted: i=1; AJvYcCWNWZV2dErzF1Y2zJT/jbcRbLQlgI+usR8Mol0SiikO2fX22dHT0xZc7Vl6jO8s1TOXwmxpjZqPLjO4E6M=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+FT/3dgrUXothv9sj5ST2yzXCgeycjDoFUJXPqPiPrDg41VS7 rXbsZCipWc4U1FbFlFQQxsPSDflcnsWSYOrfKhBxXWc0/50c1OUxW8fn X-Gm-Gg: AZuq6aK0jNaCrXDitHg/lF0ysImzxJVScin6sCE410rABmUCTqQddtrXtdTJDHhSK0S AiYArrfpmPAIm0Jgo9Ne3xr1c/5tew7EfdbW/HzKfTQ20It81cpG9K1gjioLPq9M2SpKCNQEFkM ji2Bv8lUL7ZKLLFapmCdYUfFtn9eFSF7/HLbxAt/0Wfb32QuoLnQP8PKPeR1i9r85z4fpjT4gpz 3DIiGov3R59K9b9GNp8MbsmdgyclYGvrUlS8x7CUPziXwRa23XR7CmrufoPe4OapVYTfOvvgiKP 5meOUsy/EWaEfL9q7pYW/UfUeHK3DWYDo0RQE/mNs7fe/d6MzP2j8cKcUsKEn8Zx0SU8+XbjvB4 VcMrHsCXeR+XhaKE3SrD4IDSDRbDA/2wMqp69M6PZvKJwrstradYV+7otJD0Ula2l0rVTI4I8S5 RihzkK4mN+Sh4ImQ5B2jRXkMa9Igrv4X0QrQ7tYeZdiaz6rUiWtaXyi01pZUh2hw== X-Received: by 2002:a05:600c:5391:b0:47d:7004:f488 with SMTP id 5b1f17b1804b1-483a00a537dmr137444845e9.10.1771683193520; Sat, 21 Feb 2026 06:13:13 -0800 (PST) Received: from db07.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a3e01c27sm50169825e9.9.2026.02.21.06.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Feb 2026 06:13:13 -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 v4 4/4] docs: iio: adxl345: update math and examples for scaling Date: Sat, 21 Feb 2026 14:12:47 +0000 Message-ID: <20260221141251.34855-5-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260221141251.34855-1-0rayn.dev@gmail.com> References: <20260221141251.34855-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 addition of event scaling and correct existing technical errors in scale values. 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). - Also sorted the existing table entries alphabetically as suggested by David Lechner. - 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 | 57 ++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst index 3ca6a78feb5b..e830430e4870 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,33 +99,45 @@ 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_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_falling_period | Inactivity time in seconds= | +| in_accel_mag_adaptive_falling_period | AC coupled inactivity time= in seconds | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_adaptive_falling_scale | AC coupled inactivity thre= shold scale. | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_falling_value | Inactivity threshold value= in 62.5/LSB | +| 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_falling_period | AC coupled inactivity time= in seconds | +| 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_adaptive_falling_value | AC coupled inactivity thre= shold in 62.5/LSB | +| in_accel_mag_falling_period | Inactivity time in seconds= | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_falling_scale | DC coupled inactivity thre= shold scale. | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old in 62.5/LSB | +| 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_x_gesture_singletap_en | Enable single tap detectio= n on X axis | +| 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 | +---------------------------------------------+---------------------------= ------------------+ | 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 axes | +| 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 | +---------------------------------------------+---------------------------= ------------------+ @@ -140,8 +157,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 +287,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 +329,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