From nobody Tue Feb 10 04:23:43 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 5914F35DD0B for ; Sun, 8 Feb 2026 15:05:32 +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=1770563132; cv=none; b=d5eUsJwzDBoeclMzuGtHx2wABNedLb48llefxjYaUY4+G/NuDjmcYZb30+YngtLgBICn5xGexpaRtCIeNamUNA05GZLusGZPuMuth2pjCd8zKPFRZA68o8yQgSpuzHSHf8jj2r0O7F+6WcDA/vXjWDKB2MudueWagMnmukKpAhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770563132; c=relaxed/simple; bh=jygn9hfhuwiAljKBRe7Yu0fCo7DdMqIwgB/WQt9+uSw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CSMrpvBmPBN4CBhzkjhwE1gJW+mIDGkLQFOD8IDLg7jyq5VmPlW6lSv3rXKjRB5ZtgJQEcqyCdAUpr976PEZa787CpoFKNVClGt5sxXNQYVla21fZmKJOxSOqY4mXhS3c2HNErcRrhmPLulyEXB4NKK6AhlN8HuBVGR1QDrlDJw= 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=WoU4LkkE; 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="WoU4LkkE" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4806fbc6bf3so25483185e9.2 for ; Sun, 08 Feb 2026 07:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770563131; x=1771167931; 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=WoU4LkkEKKjdgz4uUELhdJzj8gV+vqhZ+BTYOpTj1N6cpjakp48L2e7ajZ8Tdj/KLn Z6Jsp/Psl3g8H1Fk64g9puPTOX1zqRR9DNn6c2nMKbddq/lfWQ9ox0Qye6YazrnEDKXS K+2Sw2COoIMuC4jOPfepglULfIAabNsl+FOeA6BiX0WVxiHQAe1BJCZY/JsuBIv6gp6/ WCz5cWrBUhDrN6BqfcLMBxiDDyMSQN0ItrUkudhuBMcQIoFeOQK7ge0A3yiUTEFX4DSb MsUdejKjtHptIFddK/d5L7BLd6OwFNsuM245TeHpGJYq7TTapUi6N/ovx+R36xhgmJHl Ai2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770563131; x=1771167931; 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=TosngAADOmP9Ma6zFMwqIQzsCk2N/0l03xbaQD9UKb2aYJeJViBjhAO8P6MFjI+Oqk Si6oGa95T8Pmp+U75cmkEHQiU9f3lESRx3FxVGo2T59HjZpMcD81W0v1Sz/Jr7e+o4Uf tzXF+CuPKOIayLRWpo5EvB19N2kgT9pzZGq88yK/aIlE16+QtIVp5k7mBuGDuuhwhWOS UNv2Ft5w5shUZ5vSdrXbsYp4FN6z/unQbqXfe2+bwWaYrEGa3qzjRAQjdEq9V+epGiSi Ug0djK2P7U3tHNd+LvLrjblufOot+0uYFxageJIgWpXFE61huOC6wYE+/KaWfQjyj+Ry MRBw== X-Forwarded-Encrypted: i=1; AJvYcCXkafC/E83ynBXIafKtOrALmsA64Axd8agKVDfM/VUA+XIMf0ZSDGA6FfKnrGYGoGuMiVlWEwg9J4wNCl8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/waOx5lWsHNef4wUuvEyBSGQZjKNI+fXc0WtVPZs7eY/7C6B7 uDkRqkchzFtTJf09ZzE4fXnKGsWqWz2t+ZkED3IbCM3mNFpPP8Mj/mST X-Gm-Gg: AZuq6aJmwxwsrIWwNzGjh216/wD03qwlUTAAeSeP97AtiTLMHo031da0KZqnR5+e5KB ZpUKUDShyafWddoUy9SVHGACIk/8qUb5BluN9SkEXFKogD1bCeZJJJeEVgGYutiv0ttG+fdTJpz NqI5+G7jDD2jKQ/to6NGWfH8ASiBtOjRR3rYi0vX+HQC+12CDJ/8HZPDgWPzbgZi4q3d+5GMijQ tkSI2BgNXtB5Kak1Jwj1mmQRFliuEKDNm/AK+/mb3AxkdvBBfLj3JHW0EfQu+nemS2GQ0+yfh3o 250zx4KEl9rNWJfe5T0+KL+eBgqUZxEKUzPdqfPNeHEO1uj9svZt2HrRKa+IxyTcMjEo4VsaNqS 7RTIWKus1vzDD0EyaFH88NNNVPxaPD0ivhLRxVEUZZVFlDspMG+x8qXnfgG/zN6BbceHOYWO0ih 4pJxzEADbVOIX8+KeqijS/q8LF7kM4qyyT68rsbEnJNi8i9tK9fg== X-Received: by 2002:a05:600c:6094:b0:483:a21:7744 with SMTP id 5b1f17b1804b1-4832021e967mr128737845e9.26.1770563130612; Sun, 08 Feb 2026 07:05:30 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483206cc7d3sm179326255e9.5.2026.02.08.07.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Feb 2026 07:05:30 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: 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-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v3 1/4] docs: iio: adxl345: fix typos and grammar Date: Sun, 8 Feb 2026 10:05:02 -0500 Message-ID: <20260208150515.14798-2-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260208150515.14798-1-0rayn.dev@gmail.com> References: <20260208150515.14798-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 Tue Feb 10 04:23:43 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 5401135DCFE for ; Sun, 8 Feb 2026 15:05:34 +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=1770563134; cv=none; b=aIjpv252TZ8Jbdxmt6FWbfejjLmJ3nKZ7g/lDuI/KHGzocrJGL6zx5R0CqSC3C4pUqnQ88BZDrwZLIxyAz09j1dTPYWiMiZ+8fL50Qc3KAPg3fy9s5kMM2rSaigld6ZKwbf8bd9374dP5vVNOKgj0LUdFX1KancF/8RhxlckyWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770563134; c=relaxed/simple; bh=9/7QTpM9w9CetgDRp3W/v439sqmC/gELVsuHbq2pmD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZyE/holckd+nnVIrlCCXODz4AcTBZ7G2yKXPocz6ung5tzGpN/FvMN5d4oXt9eVLWXZhxGhik4VaDU364ccXPyJn5SPa1amOQRKJdpRPuV7slXNjdXbxFiN7oXvk40044IsCxq0enbwCD7COmDraEHy+uIhOpgodhvzGrrgaN0s= 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=Ch0kBBNH; 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="Ch0kBBNH" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4806f3fc50bso24826305e9.0 for ; Sun, 08 Feb 2026 07:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770563133; x=1771167933; 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=Ch0kBBNH62QY6YYQ+nxagFaqOws5iBgV8VtSs7Yinh6wqmZPlGR/eZ5hTCGfhj8TWb K3VFuFKnMPs5vvKEkY3wvyavbJKR449xduffrSInJsPYdFqAXTynWY90yeofNDE7ELfc FGz6mCrfjf+GFSbLlgd/uoDPxEHvR/TnonqptpQDQKaoWBL4RC2dk7jbRNSNa8wjD5Hg HrMLNgcKnzXEHGyFbmvGuIAjGu7fPtJ/DKg2JuPb2cXpsTKUxLc7FiwE6MdMmA32AIyb e8Cby9oI2r8Mx+K2iD8AJuPoWmEaJ4ltpT48IBER5im/4R5HmMlxwfIyhADYtL4RW0eu IMFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770563133; x=1771167933; 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=mYZ6uxn+g7EfMUWoQwXL+YwzUIhqFygPp4MliArS5p0aTYOKLCOnwypS2DVn5J6epx 8T/I8advURMsOeow2j7en4SfKncDISvP+HC8qw8eOaAqNiwzzDNQQ+RANKAVpWmWYUIN AdPhxdXrNVf2yOrmgX3WBVicRaLxGVuW/Puhxx0ja32I9azwumDZcZcEXNb9uqmVGsce Ydq/HjsdQ5blXvIfLTHt5En9W739Hr6ZTyl86XvHUQxW7xckrs2e1dZXK0t5j7uGgGuu R0g7i0oSVlAIhdX3+286yT1CkjBqijLAThcrhvWedFPySPN7nHJepYy5kRaDxGH2BcLv 8t4g== X-Forwarded-Encrypted: i=1; AJvYcCUV6b8f4WuvSfnJ1arrSuswSci+VFTcALep+6rezdcoO6iJ/o26olZhomLTMzabP1g2dOLZhDy2tPZsCyY=@vger.kernel.org X-Gm-Message-State: AOJu0YxJBpdtKkJ0Ce1Tf2N0dVa/I05/RCK5Vk1/ZgPAYoyhM0F4N4EV bZkWIh9vWIpPQbQmursc7OLyDdIA86BIV98vhi57ni8YtVGMblSTPY+f X-Gm-Gg: AZuq6aKVuvyLIwxEB/WWDynqvLdXMaBepo0SuMu4S3PuEszpqIU3o9KV+/e2loH/RM8 bWtuEzHFi8lETeR21UvAyWpXGQYXG88mc8bSHLvXE/RPW4vDjFJC9IGIxNLDlzWUAV2N6xQJPLU I7umy7Yf3jd8EGlvROhHgalRh767t+FVbwma1FtJdY4yMwS+C90c3kcM1NtBxLgy0owjiM8tIPA M29qJUHok/17pkF7P5ZvERGF/g9M2vQ6hxyWjHRRbnf6I50YoFWdZIc7ZNXbCGUJ2tKDVoxA2HB LqZuowBt35pGc2jBiMoB0+zmxRR9p+EuSeqRlEBNT89m4BS2plEfIEajkd9i0Fv9cTO+LBAHegE TwDTHbr22sOcFnpEHgLNf7UyFybPB5gAkN+/oLwEOUoMjUXYqIj5danisTslt4cA3gE3tx9eHYc FkUZqnQ/L7MArSTnJRsED8H9MlnH90k/Uj6fy5TBcHU4+O86cWJA== X-Received: by 2002:a05:600c:3553:b0:477:9976:9e1a with SMTP id 5b1f17b1804b1-483201dc5bamr123026275e9.6.1770563132478; Sun, 08 Feb 2026 07:05:32 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483206cc7d3sm179326255e9.5.2026.02.08.07.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Feb 2026 07:05:32 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: 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-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v3 2/4] iio: core: Add IIO_EV_INFO_SCALE to event info Date: Sun, 8 Feb 2026 10:05:03 -0500 Message-ID: <20260208150515.14798-3-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260208150515.14798-1-0rayn.dev@gmail.com> References: <20260208150515.14798-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 Tue Feb 10 04:23:43 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 150602857F0 for ; Sun, 8 Feb 2026 15:05:35 +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=1770563138; cv=none; b=kd3IHY8Id7Z4a/1xI8U3c83lZEdTprvq3Pip6LHXdDoK2J2RN3/LkW6ni+TW19/ipqOw9XYsoUEIh1dQqN0GBd8SrJoyjgCGrM6NhHh3xETTmbIjusecvopIrf0sk3OpEQeEilcg0oghIZ0WrWstLx9aECahCweiNS5PGkvv6l0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770563138; c=relaxed/simple; bh=IUjmltrTFO4YbZQalOEcuCS0vZJiq0YFeUYJfges9VM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pvWm8Ae9qVB7IltadqbnqcHfwM0njObUkYeb6TfpU6ldOvqx2xHCHsK5a9O9EHzmCnziaZb/2YnJjTWRRCRXh8Flj9dgCg+uR8go7NGoxiG2eHlY2tkx6tNB6VKpLcXYoQC1bS1S3x9wfBdBqPWl7xsYOmXpKVJhc4aEACVM+6c= 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=iiA7IMYH; 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="iiA7IMYH" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-47ee76e8656so56154325e9.0 for ; Sun, 08 Feb 2026 07:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770563134; x=1771167934; 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=iiA7IMYHlTm7UsKVpJxtp0+YEd2qV0JRCY5IAXOwbKbOAr/R0twjCzQAyLSk4QCQME 24Z0iCwqUgoaTLjZkQQZDpcH21PtusRoTwYJaA9/8Bcf4FqgO4Bl7djxPPZXdFZTPbrK 9t8oUqoWm0eszeI95jBRXED9itKkSW9MiPcqZSJXmPMkT0KmbxSX3qtdXxP1MWiiWXmI +qEDNRf+dXezY0e+bkQMxPPnsjrGQcJ+N7xd+i+93fto8+skFTERlUQLN532obK0tMlm JacxDvUVnPsV3WHdYUPyJEGMe0JAI0+L9As1E8mbKa/a2fMsPcTN381xvtThLyf1gncY bgzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770563134; x=1771167934; 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=hy8dAJ/II0gONiNhnxaV/JjhC6HSKCWZv8RpxDMr0lcYjF8VWulWPBMSIetBg/SNDg YV2KmKPreBmj1Ri2kM6H7SmE1w+KbtLhHlMTq1TsjrcEZZfMrRT/KCE4C9zf42HKt7xx I8ke3elhJQJUKqP6l5YAMY2jWmRjS6bG2OB1PbAgFpYZaSiumN5DUc5/JuomC+00Z49y jNEI2oKogyN3X50crM9IARmxMdN4OKKCcnGpStqP7gAQk2mtFkzsmDmtFXPOEW1HUWZL P/Iv9jZ1eM17SbLPf6KP3a4fOs5t0vvGGoMiAYkRM8puUMr0Ev38Frg3E88/ib60g5v6 wPvQ== X-Forwarded-Encrypted: i=1; AJvYcCWWpAfvks0rOnMP9MNbUDX+N9DUCOa40O/Rr27RNvQl1J+3FxwFm4oXv46NZSAA1BOSm0Clp4DvjfMzTMA=@vger.kernel.org X-Gm-Message-State: AOJu0YztFKPM9UWmW0hzRPrQdwrJ8sSLhCEUjS1bNHAabiBV8IWkfGJ1 J7dyxJhwV6Htyvwd6c9mB8LXnCStYV4lZaacEhMj/fw4bRYhVYoAcDSx X-Gm-Gg: AZuq6aKDRePFADOnujlIrNgDUp2uXZA06eAqpOW85o5Tw935/5MaoeDSWuuJv4XvZ5/ vV5nhuVHuD6FifaMLQacLYpM8+vei7Af+z6915UUESrkUs57AmH7bVcxkYbgAVmIQNOmWbDzMrO m1nnobh+120/gK17N+JhQpmCsPBwmIQP1649jWEee4GYiGxhEg7x8vO32VMUfnpIYJJpHRaaKZh 2o2lhB9656Dwz+daquh5xdHTWRNWUBRmpiDwReLdeKiHvx/FxefRMrmqTLTAiFJd3IaqLnmIq4m Z/WBuGOS3+bPm/QWuOuga+3f7Ap1QqHEkAUgk6p827mF7q/sH/2fAlDKrgRDGHlYelx++fMka/l RJKVLQE2SY+1cerCimhczGqDdFzSw/nnLvEelP9ccc6ErsPMFB8hfKxaKbmhKRSnce/oGd6Bywc Nhfb0uD/vYJLHEnMWFGJPijXd2SD8a29FBA4wksWB3RakEBTw7Nw== X-Received: by 2002:a05:600c:1d24:b0:477:7c7d:d9b2 with SMTP id 5b1f17b1804b1-48320236b1emr108520665e9.32.1770563134446; Sun, 08 Feb 2026 07:05:34 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483206cc7d3sm179326255e9.5.2026.02.08.07.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Feb 2026 07:05:34 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: 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-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v3 3/4] iio: accel: adxl345: Implement event scaling for ABI compliance Date: Sun, 8 Feb 2026 10:05:04 -0500 Message-ID: <20260208150515.14798-4-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260208150515.14798-1-0rayn.dev@gmail.com> References: <20260208150515.14798-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 Tue Feb 10 04:23:43 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 15CD135DCEC for ; Sun, 8 Feb 2026 15:05:39 +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=1770563140; cv=none; b=KDIpJdPJhUqDROJWavmUl/TkjGAiiJoZtiMDH9HI/16Uct94VTqVFrOA/OaJtSXHTKJU2vruVb41Hrd5+UDJ0ro7fQDPqR527jwJRWjgHuRvIfUkqOoyrJdXkfRp8rQJqfDvgR4jDIG7CIfcgiWxSYTg3+smdHPtjPrQPfzDVkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770563140; c=relaxed/simple; bh=U0yREyMuA9zF5E01tEeHmGWl8udIXIY+aolKf/33vzg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i54zyJwYCnvYEo8gbFATUrrZoG1nionsjf7+/9u2gq+xQjvwRFCglmUsFxz8D+tftkNm6xPCfM+Kp02LD2HkKIeebv4O/mPaKLp8lBoX4qdLFzrfMIB6zA7CG2eXQHf63bMAlzEW6WxldZJYb5MwGygbe0M4XbK3DZR4zHTINQg= 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=lPUq4mkG; 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="lPUq4mkG" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4833115090dso9035865e9.3 for ; Sun, 08 Feb 2026 07:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770563136; x=1771167936; 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=d13IbX+Pqr5mAXxfWBXXantCifGt3HSpLvwuk8HyZUQ=; b=lPUq4mkGcr/7J0GR91QQiJZaymr0jwOb4S27tBhjuNy/yl7ht0LJt1akYK8mcTSaH1 SD98gJ858oXXo4cxQDZ0T1elWELnm0dkM7v1vou//gC3YtwyjkmxRr+4oY8l8HC+ksjN dkXoJbrIqbXA1ZiHU/UyUgo4Z0eiBhKbSp41JZV5wY3YnDuSEC1lqHyw8m+xct0ESg1d 9qiR16m1nmxqGvCAQ0bILcZfycM5/qVxE6gn1H8YE3EAy1RiE8RrghplZbw4psyDDqqD iPK40nYdRvB3ps9LRAA8fgrTja5dB9ywxUFDf8nCI5l3z3vO0Ko9/WCp0qMQTjGqmNq+ 1B5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770563136; x=1771167936; 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=d13IbX+Pqr5mAXxfWBXXantCifGt3HSpLvwuk8HyZUQ=; b=sqroj29qUn9MXKrwMGgO2tQXvxaYj2tBNbmpVCMrS4KZcop+dLofshElT1WxrLPYbV XZag8bik12OlMwT/5uWfrzyOBj5DKg4WdAoghw2kTpG2MiKCpQDA7nCVjHd2ILJCBP/4 79mYJ+MzKJdk0uomZknB3Y/YliczieYHXadtErCBjQjxxqK/exC573CPGJa6BagDXQdP oPwkmChMqEcF6O76U1tye5+RlgVV35yBqMsxCdVJM+kX8j3UOvZqVxkCKYHhRI+6MQlV g+k2UDuhM1zE3hsG6WVK6W+XCeWDAmiU9Pay3GMAiVjC9IPfKFYir/ckYYjca9SR5Ep4 RUTQ== X-Forwarded-Encrypted: i=1; AJvYcCWegTnUPp5oRZ+iG2wmd9kOV+U0Mdfb5BbMJNmapc2+Xlc4g1eTTSQhaTeTeA8A8tVK4d1aOrebYPvgNAw=@vger.kernel.org X-Gm-Message-State: AOJu0YwThLkzUCZtow+02xLaxZ3HxIx55+mYylYDaOrOKErVqvlivJI9 As5Nz0D7hUv0j0QMcmqAeBHxyN5roF3DIa6djrxS2RFo1leDoFVvsiA6 X-Gm-Gg: AZuq6aLH3QjpjvwKEKQDvIr5GGxMgPWPmrnCOAulmp5wtJYqxbso7qc+cOe9PheouFk Hyy5UdU31z/+JTyKYCO3bQaz0cmZLHgcluglHclXsuIw7aFfUv4XdyToy02e5mDGKLePTP9Qwpc aA6/+WMmpVdiQRATIRat+tEltbxodJwiX4XtFuByqURx5FwrXaM6tD12oI8wcblvPKnmAgGwAX4 aWzPpYRkC+H+HMstvmTF0rt0DF+/4F7ZQG1vXPwZa9x7DobXomssZY7GCMjC9fZtsP+Vew9o3JJ bEyNlXrkE/fwtitAxZmvIrt/BqkefUZxQdyP9RZYNOxwXww5rSfPE8vDSiLJtt9efgB1oFs7Dcn BFgUzOAL8KEUcVfQQblDkiyw538DF7xTlzDkJvP9+75s2IhFxKyCEp/1USYNpJ16tbEy2AEY2Hh RjzJEXOeBbSIX70H+yP7z2JqnEsXaW9emTBw+/SduK9JNzUYGNZQ== X-Received: by 2002:a05:600c:a10b:b0:483:361b:deff with SMTP id 5b1f17b1804b1-483361be0aemr32845895e9.14.1770563136324; Sun, 08 Feb 2026 07:05:36 -0800 (PST) Received: from DB-VM.1337.ma ([197.230.240.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483206cc7d3sm179326255e9.5.2026.02.08.07.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Feb 2026 07:05:35 -0800 (PST) From: Taha Ed-Dafili <0rayn.dev@gmail.com> To: 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-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Taha Ed-Dafili <0rayn.dev@gmail.com> Subject: [PATCH v3 4/4] docs: iio: adxl345: update math and examples for scaling Date: Sun, 8 Feb 2026 10:05:05 -0500 Message-ID: <20260208150515.14798-5-0rayn.dev@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260208150515.14798-1-0rayn.dev@gmail.com> References: <20260208150515.14798-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 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 3ca6a78feb5b..321565699817 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 @@ -98,23 +103,23 @@ 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_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_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_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_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 = | +---------------------------------------------+---------------------------= ------------------+ | in_accel_x_gesture_singletap_en | Enable single tap detectio= n on X axis | +---------------------------------------------+---------------------------= ------------------+ @@ -126,6 +131,10 @@ listed. +---------------------------------------------+---------------------------= ------------------+ | in_accel_z_gesture_singletap_en | Enable single tap detectio= n on Z axis | +---------------------------------------------+---------------------------= ------------------+ +| in_accel_gesture_scale | Tap threshold scale (0.612= 915 m/s^2). | ++---------------------------------------------+---------------------------= ------------------+ +| in_accel_mag_scale | Activity threshold scale (= 0.612915 m/s^2). | ++---------------------------------------------+---------------------------= ------------------+ =20 Please refer to the sensor's datasheet for a detailed description of this functionality. @@ -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