From nobody Mon Feb 9 01:44:21 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 539A026FA6F for ; Sun, 1 Feb 2026 18:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970830; cv=none; b=evbq5/icznzT9q+ywIrm8DIL0SgxHqLGGAKGzUGGDk4nBnrz4Ss3xgPIfvF2C0judmmcgma2m/pIixfI8JxDunC+6sbsWahVzmJlxVf+OnZelNXj7fI+wv5h56MfUmNJkIaSyATX/VXlUmOSdyK7HBL8Bv3LJByzcQFWUO89vIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970830; c=relaxed/simple; bh=ZCpnkgLOatzf4jWZphZI1+PCO8fjiEtTsfpE3S5Xwmg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KK7WGQeTf+G6S4JtanXTb6WhpTVatr2SZpM22R/6xSCUtDvBfG0IalBcCwXsJr7c1blsjIXzuEQTcvq4z1IreuaMqhTUA1st87UWgNoHy6n0hmIZhFjFQU/F8bxTZ/oI4CVky49lWP0vabvpk70xwKebI/ST/Hlixyw/DB+S5XY= 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=Tg+gA0jX; arc=none smtp.client-ip=209.85.221.43 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="Tg+gA0jX" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-435a517be33so2197409f8f.0 for ; Sun, 01 Feb 2026 10:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769970827; x=1770575627; 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=kaaojGS173TnJlve70QP/+cu6NF4HjbgNLZcKgOyGYw=; b=Tg+gA0jX2o+9qmJTtjBA1UC2afxELJv807VGWDjHZC7BWlapLfnBAILxexVO8i2MbI 28nCGzQ6CiQ1fB9l1zR1eMs41HKCwlz3TWmXERo7UlDCYxJF262aE7PrkFvB4OKrhDzS m9BTUvuzRYxG2/BtTZimK7nrdvcLHnX6dckuMiaqugHxJ+YcICFcliXYTM+j7U9oIE/W eT4PRH/0+8MSaZL/4n6+8rRaYwbTxqCBlj0NtiPEf1mxYcpnBybZpMqHsifv0HuPZ3VO 3ckNPDCFFbT8Y84HX3dACKcQcEHO/b7hJmSvfvwR7P5Btz23vYomi1gDP3Pm+l/FQ7Hk 5Okw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769970827; x=1770575627; 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=kaaojGS173TnJlve70QP/+cu6NF4HjbgNLZcKgOyGYw=; b=lMvvkts7YN7PAAda5mZYb6oVFbKBwym5B69zP6VLb7dw50WJ+NaT2pGjZHiGLvrSkD dvsy9a4Fwz8OsoE4/6vcr+flz9Mko0mkXiUeHZbrHBQwkw3U61jjWt4OUzCvztU8YBrB RtCl5G9sH+gK4akvVWg375ldhJyaHx0/3fI1gdM+g0/DNodcUzJtoYMI5SmXIElO/O2Q oLdDNPgBVOW1mVjpNWzxfm2dxT3BnJ+/3sOUmP9+C/RNkEkp9ec1rx5W8ErLkYzD6Zq2 Z8ldl6UFQM2hVHeOkz5vpBP0bdQlabUkKqG2AYGRcC65K8xFll5tQi2McB0ZVhOgcHJo Wjzg== X-Forwarded-Encrypted: i=1; AJvYcCVND+EiHSOlZa/07hZPhN1YBsI6x2hRBIHLQcsTfINKgIbdQqYGEjKo6LEi1UV2JB9vwYsrr52oMx1ivY0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0QeuPkMd/ozNuBiEtavZUcDUkdQ1OYdw+HAk9ygKXHFatLSJW 0xqy+/FaStlLeKiCt/HOwL2gP6vAW7jDg6N7WfdgPKir5/HYhtdYaqqR X-Gm-Gg: AZuq6aKaJUFBQ5pqz9MeZlPulPnYxWYj9pXtjs3JdAXFp659BMxVy4rdsdp8wZBF3cK NdcG8X2DcI5VOd58aYw1YA9pN94qGVtbv/VNEz0C/lxMzMk7itbUQ830zeLBmnu+KsPbTrCxwWU 9CFDxRbQPY/sLiMA5Oy+ea8puRTBs1RxRsuxsAf7IobhprhQwwQ+m2SNbkzvtiBC9HfHMJzijf5 t5AnEVfE89ElKWZyLsyqYvskENSgar9rUMzoTWuQrrWqsI/BbHQcbOXDwbC49FLvzgCuTmOUiFd gmZsvrubBszLfo1m9MoNufK0lz4JbeUxqyEws1yj6NrSKaCuUZtuSO3otVpeRfWa/jJTys+hQtR TaP8ZIG+FO0v0Qeg14Fr65PSijsfZo7cHuNb/MrEX1PPR/TqeMdIH7JLzXU5kMpKx3rD43fQDO3 GdDKrlbelpk4l63nwTYoX7DX8vnqaYOgEKE0RQuxbVpIUXhsV8pH1LLGqM X-Received: by 2002:a05:6000:40c8:b0:431:104:6dc2 with SMTP id ffacd0b85a97d-435f3a674f5mr12407152f8f.8.1769970826540; Sun, 01 Feb 2026 10:33:46 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10edf62sm41400084f8f.13.2026.02.01.10.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 10:33:46 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: jic23@kernel.org Cc: me@brighamcampbell.com, skhan@linuxfoundation.org, linux-kernel-mentees-archive@lists.linuxfoundation.org, rdunlap@infradead.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v2 1/4] docs: iio: adxl345: fix typos and grammar Date: Sun, 1 Feb 2026 13:33:10 -0500 Message-ID: <20260201183320.27023-2-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260201183320.27023-1-0rayn.dev@gmail.com> References: <20260201183320.27023-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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst index bb19d64f67c3..41d209a4dccf 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,7 +78,7 @@ 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 +to FIFO bypass mode, where event detection is disabled and only X, Y, and = Z axes measurements are available. =20 The table below lists the ADXL345-related device files located in the @@ -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 Mon Feb 9 01:44:21 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 F2B76287507 for ; Sun, 1 Feb 2026 18:33:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970831; cv=none; b=WOO4OX+D9XUM+PB/Dae+8rYvZGBBiywRcob0Pm/x5GGSY5MJgHy79FAGZ6XhX4yPtDfhsO4aF8LNwEmBgjck2sJkJBwu8ylOp/XXwVvHBoPgX0kFz4jOl2FdqHNRbrhLxDTDyoLZqQ+7GaFPTvqYEUeSSUU70BeQamZC3tB9W4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970831; c=relaxed/simple; bh=8s71L5/222QicynAznln9mN/6daQ6Flg3Ya1cwHbxeY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eGBoVtrlpli6np3BCX0PVQL0or0MJlxBk0K+5aW/LgJxrEngZ2uUqWRCkj41E3WefYsOr8cFqZ3TnSuoBXD1On6v57xs8R0Ns9ivV9RYRtTVP+hoKpXSBe6sU6tP/DDnIAUEjzjAa8XVyby3focUT91IdXbINTK7H69u3LNmu9w= 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=aO0w8p2x; arc=none smtp.client-ip=209.85.221.43 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="aO0w8p2x" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-43601e96f72so445714f8f.2 for ; Sun, 01 Feb 2026 10:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769970828; x=1770575628; 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=309CH24IybzBmjrd1Z1MDsc4bcv4TEJ+M8kIPobk7aI=; b=aO0w8p2x6GjluCr6aSD40DL5zwcJDUrdkJdxw51wvhJTPHfanUShb0xY3ef8A88bHF 9nwpZDGBqR7iFStPYKtA/0AqcyiliaZ15JonrA6ftdvTbcJZZlcQYkBQos0dfv4B3Bmx GAA++ptTLMsfQLG8aVRApZBrBN75Ldd8jQuc+T6gV73CbumCywjSregyHD4028dmsNvF A27io7PtX94npGkKZV8PPoxXdQuVHrj5JhdEn8S0wjxwq2/z9Q8vuQLnb9xu27C8FzD7 uAkqK0oB6Ifh3yty2jbH+3E9JDZcoTkiBPMwdlbbzWgxp7PYbayBCs1s4l4iHgViotul /d+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769970828; x=1770575628; 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=309CH24IybzBmjrd1Z1MDsc4bcv4TEJ+M8kIPobk7aI=; b=rMRxLL2M2/hNY6gCL+oecKT4JeGDa/kqk0E1e5xIEIGrFKVtdGSmuMPrrbio86gHCh KwtneYwwI/v7v5Sk8x1u6PIV8UJhe+VMtQYZIbGYhBI9xA8oZR1wZ7rkvC1qpdyNFpkY m2xJL8DJESe6uBkVAkEL9dqMUW8DfPr8br4ZpdulR313E3r2P4CZku2+Jx+YRWtyDK1a 52ZDi8DBF122iywyE4/S3vaoNgCaz2aeXRMWHm1Bd5dIzPAS65oz9bv95MHbC0JXG1pN effdy/rlMx1zekgFCAaSpkgy0rj1Uh+AEab/Y80VmOI9n5rG4XFQ85xaycskJAA2IuFM ljmQ== X-Forwarded-Encrypted: i=1; AJvYcCWlGA5OAe0CYeGak9QnggkJM6+zmGHcrKZiyC18n35Q8+r/s0Xxiepo8qZE3RJetCgsBuGfeQOcOZ75pF4=@vger.kernel.org X-Gm-Message-State: AOJu0YwAnwLPXoF4A4npWMd/dAai3A+kmtdtZekEaEi82WVWA67luVq0 o2ufoRT/8M016UeFd67txVZyGhsOulLz6OWpOZFNYJSCOenusTGEkPoT X-Gm-Gg: AZuq6aJOULbHK1Q/pY49sVG5gr4Ifr6Pe4XY3sV+zVcDDt9GZu/PuWzPqVt/AtEbczw i0Jo/uS2XT0MEDdUS1Xvwuvu6S+s3+tjlgH9833HCRkvFDtfvWbuuZt5gnBaO4XUiHv3/dhedJ4 6o+UODe7DUZ+BVeqY6AgvQWxKP2G9eIuuoWi+HxFm9pFaQf+AKXsao/a9oc+sWhrqKBxM2vLXl+ yvWtiL4kJBKEWfk93BBq8q9uyeZ+KpkKstN6bpFeSDqyMKn/l80Y8snX5BwUYNu/8shk0DP6mpv pdX5Kaworlnzth+7mDV9r29DeObnuC7L1IaeikPx6vjI4FakY3cYW5nmricHU8LrLTNyaJA8Toa WynD7VZAlBuH4p5XiWfnMdgiJocOMt5N5OCSsaqOP0Nm8zQVnzHGE23mgQGoTeivCXG4AFk8kss AMeru+ZrINNHMuWw8gzNMU9fHOD2O3DfdFtqBN4VR158ZBrQ== X-Received: by 2002:a05:6000:2088:b0:435:b7ca:7521 with SMTP id ffacd0b85a97d-435f3a763dbmr13149181f8f.15.1769970828099; Sun, 01 Feb 2026 10:33:48 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10edf62sm41400084f8f.13.2026.02.01.10.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 10:33:47 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: jic23@kernel.org Cc: me@brighamcampbell.com, skhan@linuxfoundation.org, linux-kernel-mentees-archive@lists.linuxfoundation.org, rdunlap@infradead.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v2 2/4] iio: core: Add IIO_EV_INFO_SCALE to event info Date: Sun, 1 Feb 2026 13:33:11 -0500 Message-ID: <20260201183320.27023-3-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260201183320.27023-1-0rayn.dev@gmail.com> References: <20260201183320.27023-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" While implementing event scaling for the ADXL345 to match the IIO ABI documentation, I noticed that IIO_EV_INFO_SCALE was missing from the internal enum iio_event_info. Add the constant and the "scale" sysfs string to allow drivers to expose these attributes correctly. 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 Mon Feb 9 01:44:21 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 56C142882A7 for ; Sun, 1 Feb 2026 18:33:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970833; cv=none; b=CwAgpmKkHupXwgjttwefqTFY2f14gNrlRRcCqOwEM6nUEL8Ng1YQ6t+rbXb4Tw08Eax0nG3F3L+Zbd+clxc8pWSQDcX07oG6eYMpsFpICoyvfq7K2xj5rykgPR/VqCo1PJAPYvZQlKgUI+bUQdpeFljBYzf1IVnqG/IbTWTnOUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970833; c=relaxed/simple; bh=IUjmltrTFO4YbZQalOEcuCS0vZJiq0YFeUYJfges9VM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gv08P9sxsSrOut16kUtXJqZyvaEKwSypOIaWMaGeCt055oXnkduMDrM5B1eAtrPNxjjbNauJxW9qjGisiE0EG0xPRQbu/x9X60fyh9cejWOuuX7zpYcGoSaFrX27rjWHHFpfLqdWIEcNnwdOmb4xmkR7OpMsZTxqvmNGSVXVitk= 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=VD9CQpIF; arc=none smtp.client-ip=209.85.221.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="VD9CQpIF" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-432d2670932so3448332f8f.2 for ; Sun, 01 Feb 2026 10:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769970830; x=1770575630; 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=I8B3KYHW7oN1cE0ooieHtgCbkDaH2P1LrwaeA4680tA=; b=VD9CQpIFSUADbBs2JiiTlI141An8Tyr5zbxeu4fuQkGHoNcITQFfo59yeUT1waKb5Z c4GgeN7ogPx7S9iEVcBtlIgHeYX/3D95w5SAzipQLwBAoizsiWUuFGFqouSm9C6YjeRU pvgeF4U1w5atwGleDQDJUKF24ID07z7RCjUAJBkPlz+ZuHZi3nZo5IBGH58G34tHkmy8 nUILFE5i70sUYaXXpRetO7EvojTA/Y9NkV7srXx1fkLLnUaDD8etRJK2tuMaUpuPINEZ 2KurmRnGZklOsqW4y+jZ8N3C3eNbDorNv/Bn/PrftXt1fjGd++2kKwsRxzeXukXCgbb5 zpVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769970830; x=1770575630; 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=I8B3KYHW7oN1cE0ooieHtgCbkDaH2P1LrwaeA4680tA=; b=e3ARatr3/czOG6HLo5uK/tVFYiEHIJA68gtLrEGPDAYPj5DS40HmZaXBmi2CwEzeCw L/CKmFAFu3ZwC7VWKeotkmcMS3Gvh6aPwpBQAQlks64xysfyMXkD44nrHhZyj6O0wIlJ d2j48bvS/eZoPyphkuqzbvDc7xavX4kYWfQyPdeYqvGOcl2EEayzT/vCscoi0LnebZR+ XwAwsImiaKqXtH/L38ytdHMIxYPRoRI2nd9vAC9RvUIfTDzRpHP5EPAu3CU5EVt1OFLw rc4ygHfRldI+vkPtVhBEOll9MH31a6bI/LkkYeQJ/9xOiQ9ozFHdSJ4NKNO+DuA3Ljy/ bb/Q== X-Forwarded-Encrypted: i=1; AJvYcCV2+dcjYux9KnkYV/h7Bxu0fwaaMN73HfLkZ0OBwb1+fZOtIUlNJFf0j6ccSssSjxp/8yw65+8LYmxNjHY=@vger.kernel.org X-Gm-Message-State: AOJu0YxZ9/51dguIct/4nLiO6gc7qtk7cDDFRevLv1PxVN6q5EgvlSjH X/Aq4hkrxZwmOPtDa9pe2hycYrTAHHHbddmKODmM5EdOWZuQ7nF7ZHlD X-Gm-Gg: AZuq6aKxFvetGMpCGJb8mgPVhAc455+XlU3cUifyFnU2zhC/gr3GiLIPrebVtJ4W39r 6HhcM6CBw6PpUpVNNZKHdOwwF9ypoUoH9iIhmBS/KSxFmgouz79e861cb3ghGiZHhtNO4fL6WOn fx8DIsY/YbYZ7wdS5TZdC0mpDjC5uwS/0mwsSqKk3fW3tVcKRmfW+7JOXXnQuCJUpq/7jWNkfYm nXSyNCNMIYiUFyi4IawEwfr+cXB0LE/2SCNyQyzTJawCTodFops/ZJr4Dyq0lwXgXFyL+T4EWGd 2xK102g7tG5h67102Rk7P92tUTsAeqYnFAhU3SzuxyAoe+8DRcnFndQ+U45YZTofYqZjq01dIfE f7tPRII7IrEA3Y1G3BFvrGKyouOgBQ0+yRV1xtteLPBBVLs+j+m5ji3dpbCecwVXrK+4bjFuhSW T5MS/Pwp2fkflN+Fyf34nCQ+R2wL8zCGt3D4Tj02cqRZjTmA== X-Received: by 2002:a05:6000:4381:b0:435:8ff3:cd5d with SMTP id ffacd0b85a97d-435f3aaa753mr12566531f8f.32.1769970829536; Sun, 01 Feb 2026 10:33:49 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10edf62sm41400084f8f.13.2026.02.01.10.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 10:33:49 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: jic23@kernel.org Cc: me@brighamcampbell.com, skhan@linuxfoundation.org, linux-kernel-mentees-archive@lists.linuxfoundation.org, rdunlap@infradead.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v2 3/4] iio: accel: adxl345: Implement event scaling for ABI compliance Date: Sun, 1 Feb 2026 13:33:12 -0500 Message-ID: <20260201183320.27023-4-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260201183320.27023-1-0rayn.dev@gmail.com> References: <20260201183320.27023-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. Suggested-by: Jonathan Cameron Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> --- drivers/iio/accel/adxl345_core.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_c= ore.c index 78e3f799ecc1..dfe3169ffc5f 100644 --- a/drivers/iio/accel/adxl345_core.c +++ b/drivers/iio/accel/adxl345_core.c @@ -212,7 +212,8 @@ static const struct iio_event_spec adxl345_events[] =3D= { .type =3D IIO_EV_TYPE_MAG, .dir =3D IIO_EV_DIR_RISING, .mask_shared_by_type =3D - BIT(IIO_EV_INFO_ENABLE) | + 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,15 +230,19 @@ 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_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_RESET_TIMEOUT) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_TAP2_MIN_DELAY), }, }; @@ -274,7 +280,8 @@ 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_VALUE) | + BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_PERIOD), }, { @@ -283,7 +290,8 @@ 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_VALUE) | + BIT(IIO_EV_INFO_VALUE) | + BIT(IIO_EV_INFO_SCALE) | BIT(IIO_EV_INFO_PERIOD), }, }; @@ -1367,6 +1375,14 @@ static int adxl345_read_event_value(struct iio_dev *= indio_dev, return ret; *val =3D sign_extend32(tap_threshold, 7); return IIO_VAL_INT; + case IIO_EV_INFO_SCALE: + /* + * The event threshold LSB is fixed at 62.5 mg/LSB + * 0.0625 * 9.80665 =3D 0.612915625 m/s^2 + */ + *val =3D 0; + *val2 =3D 612915; + return IIO_VAL_INT_PLUS_MICRO; case IIO_EV_INFO_TIMEOUT: *val =3D st->tap_duration_us; *val2 =3D MICRO; --=20 2.47.3 From nobody Mon Feb 9 01:44:21 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.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 CF320288C2C for ; Sun, 1 Feb 2026 18:33:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970834; cv=none; b=bP6pW2tn4olVCUXs3S3jZP8mqqN4ZUY7Ivx4zSrq/+CUKhvAwJDszFeECAueUnN1Y0ysMx1+i4LU2tyb0Ce2j8qar90yKK/4e4t4LGPZZOiDWt1F0JJNilsxSOF47LzykmkWEjT+07Sejoapi5ppgnJOKdguC9NS4NLQlGWmXCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769970834; c=relaxed/simple; bh=NTtrU9ALUW0H2U3GdQ0runI6luxdsHByzTjH6ivbrbs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t3liXKrocuY1+KT1M7FWF9/ww2T9NG9Hrb7IEKss2b7dubHP59KmG4bjz8d5SUKCBhcIqbm1QoXkrdFBJkvd90YdiF05zujefi7UyGrbz0Cddbc+BX4/JovJuB8ffqHrdUJ4WhHPYvOL+BnN8IJRB2bD03Qd9SNDH+mX4zuls7k= 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=ki5c8XGe; arc=none smtp.client-ip=209.85.128.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="ki5c8XGe" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4806bf39419so28547425e9.1 for ; Sun, 01 Feb 2026 10:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769970831; x=1770575631; 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=HE8QDa+6YuW+XTKb20xWh2n+IRJ7xpzuDbFeuNPC7Q4=; b=ki5c8XGePA382RFGWVi7BpJYx98HiLojahqpMeswg/TkGt82lic4rohm5jlTCc1lJy mDpvq0a3b56yTpvlNc2LELiGaiF4Uhnhzo8daymxhgbPYjD5At0Zuxv1rNaygliySZhb PiYveRyqo0deiKVzwVKQocrqHNY+uPewG6m+sPKo3rnF7u/3EWPdQQdpe9IphEhnUW5w M1plSuhAC7+7X5ueylNV9wF2q6lfpRA19b2gnmmMrS6/HNCCdgNxRFZOvmjre3geI/rS Lc99Ner9PyKFLXwWp61Gw+u0cdZaS12OZYoNUfHxaRaTB739tjFWKFLJ64Hgt7o6zorh Ocvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769970831; x=1770575631; 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=HE8QDa+6YuW+XTKb20xWh2n+IRJ7xpzuDbFeuNPC7Q4=; b=Vqu3zUffPNAWN4PWXx+AnNuyQfQ6LXxq4UBqAEIakFYNeZjPXVBAq2A7+mWwV7mL1W vU/ywE08o/K8Mn5ipONcDDLzheFwq16riHNKOi3S9E5Ax2ntQnkTVgqFzFXjLy8OzxMW lPO88GSz/MilpPT6SN/pzeC9kBh+YoxBFeKB3V5kjXMLUegbVGXhyBuwzFbaEsKNQkFb IgYAOXNr5wLJIROfEEN2m11DhybCp+jm9jxii6T3F5/zAo9gYu6fwr8hpD+kHzPuurUH 5mtyrn96kqXQC9cedJfw9HHw40aK9pp+tTXQJ0Ps6FfIm6Ry8uusD9i2dXKuIdWDnW/p S74g== X-Forwarded-Encrypted: i=1; AJvYcCWs9+gykxwtJqIMvWy6yUW9MXiQMYX4FgNyPDvAL4wgBFSu06ubABjt/cvm+uJmcQNyj4EB4fsgOMYOPZw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5l2EjUYBC1mFAg3LwG2f/laIZAsQbUu6Kx8/23z2FLR9/cn2A NNP4F/7HQ2fBV4lnvXzxw4QGwyAJDCml0JgxSLtGfKCV9Wa/+rPFK3jC X-Gm-Gg: AZuq6aLwRaZOIRgFEI6CR20uHyj9MMfxVKw3V6Z/6pHqCXzKZ+s2VQpauy89bs/4M0T DOl+etC4+mqUmUIB9taLnjlG7nqMLljkQ8THU3PLdysFk1i8uHUf++NlJxg1Zg9q9i2EXflzvQK Pa8an9AIQmHvnYlaB4Cto5fVg1JfaERKMDxdX1cpXm+0DlG2h9IDPajiYslpA0PkdhO3lVxwbut I4CPv3v2FXWVDBmaYnSDYqBBJfjCp3htd5lSVtMNTCeGGTFpX566yHTlR6kAzd4edsPShfblZaj JK0JV9hqlSfwbS3WyGV329EQqGoj26RhFn0VpmEzA4Z1Uh0Qv+GmlvxSTaawCkAfmeL5g+jrlox rULfxbVjyrE5WQprUOWyac6rdyphSmGZM5KXhWaxKJBsHcwhvw57uVmAOMTJyGSGL1aL5LsFmlc NUP5PXgX0ZzGdjiZPJs41h1q3Zx10wbZl/C70C1Quk5MTz5Q== X-Received: by 2002:a05:6000:24c5:b0:435:aaba:b904 with SMTP id ffacd0b85a97d-435ea06715fmr17840324f8f.8.1769970831095; Sun, 01 Feb 2026 10:33:51 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10edf62sm41400084f8f.13.2026.02.01.10.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 10:33:50 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: jic23@kernel.org Cc: me@brighamcampbell.com, skhan@linuxfoundation.org, linux-kernel-mentees-archive@lists.linuxfoundation.org, rdunlap@infradead.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, corbet@lwn.net, lars@metafoo.de, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v2 4/4] docs: iio: adxl345: update math and examples for scaling Date: Sun, 1 Feb 2026 13:33:13 -0500 Message-ID: <20260201183320.27023-5-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260201183320.27023-1-0rayn.dev@gmail.com> References: <20260201183320.27023-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 inscale 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 actual SI unit (m/s^2) values reported by the driver. - Add 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 | 41 +++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/Documentation/iio/adxl345.rst b/Documentation/iio/adxl345.rst index 41d209a4dccf..2f51a2a4fbd0 100644 --- a/Documentation/iio/adxl345.rst +++ b/Documentation/iio/adxl345.rst @@ -13,7 +13,11 @@ 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 @@ -98,23 +102,28 @@ listed. +---------------------------------------------+---------------------------= ------------------+ | 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 | +| | 0.612915 m/s^2/LSB = | +---------------------------------------------+---------------------------= ------------------+ | 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_value | Inactivity threshold value= in | +| | 0.612915 m/s^2/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_falling_value | AC coupled inactivity thre= shold in 62.5/LSB | +| in_accel_mag_adaptive_falling_value | AC coupled inactivity thre= shold in | +| | 0.612915 m/s^2/LSB = | +---------------------------------------------+---------------------------= ------------------+ -| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old in 62.5/LSB | +| in_accel_mag_adaptive_rising_value | AC coupled activity thresh= old in | +| | 0.612915 m/s^2/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_mag_rising_value | Activity threshold value i= n | +| | 0.612915 m/s^2/LSB = | +---------------------------------------------+---------------------------= ------------------+ | in_accel_x_gesture_singletap_en | Enable single tap detectio= n on X axis | +---------------------------------------------+---------------------------= ------------------+ @@ -140,8 +149,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 +279,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 +321,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_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