From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 C443A366814 for ; Sun, 10 May 2026 08:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778401565; cv=none; b=N7Befr1aIpoY+DrWnfxFMIL9DxKI1gpStkF0EnYRuIKGalInbJzeDBjTJ82/1gaYvoeafkZsCPOrqssugaErumwVZepdScxFPf2M6tmrWWH08kYXVCa4Xh+JpnFal44UhzBzTki7/VKyjoq7CD0d6tMND1ONAaRaWKwkW+nBXrk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778401565; c=relaxed/simple; bh=/x8yYbpJKuFACZr2NaIUxjohn8P9suLpI69BQXCqbko=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ub5SF/07MLRCCZnA0ROl8mxGPOA79OMMuQEI8VamQwYiqFSneAn7Ml3zK0BX+4DGcMJX7B5MwloWR7iwMhAMwfV8HVPZLIFLO22vlCDg2Oszp6vLdJqw4AsKliCxH8UCtj+IppYFJitf5Zh/SOFX4/AtxCoo+ZJKml0vwSqpDos= 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=Ga1pONqy; arc=none smtp.client-ip=209.85.208.173 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="Ga1pONqy" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-3939d2bd7ecso27007871fa.0 for ; Sun, 10 May 2026 01:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778401562; x=1779006362; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tmcewcrX9GIgVhKItKjFv/3O69vRNyFoSMe5QXyQeZQ=; b=Ga1pONqywb8Gh+t7X/Z1hxhQ3k3srhCa0Sr0PW2mAzXp0onDW56/9fCL5Oci8Mj7Se gk9xuoOmOYvaaBnMyNTpJrHLNmNunQt2Y46V1/AP0LglnrbYMoYA1jNv1t2Z6YY4HniY EqjJAV165Kx4dylxAt3JwNdNE7Gdxqsc+/911yOInpWYl0nG0PXXcPWuHLa+ixtS7nhQ WfaSO/khdSJbIu8C0SnB5N+yURJ8/hJL7XeF41dZaASTznKk0rvP8Pa+O4HEuy0hrkmC vjLcFUstYn7olUd/6MGXxf3xtxezgta7aLVI3NVBpWjN8qWuKWyYCMpz9V5gX0VqqfOh mn3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778401562; x=1779006362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tmcewcrX9GIgVhKItKjFv/3O69vRNyFoSMe5QXyQeZQ=; b=hZPeAObS8X8hka7gQeZDwQmhl+ZD0lkHHu0Lv/0F8HpgNwczQ1DYuHAB0OM3eUfj54 QuajzYGwelXYoKe85yLJf+9yDGIew/ENY3sH8owLCHvnzA5tTRqFc5qtKQ7TS4fvWNh6 vnsZGaH8aXqMOesSqodkQBeTXILG1e6Sx973etX5q65q7ENlSupGRcedQHd6XefGZv/F +hKRTXlnwFMhx6TnQrNIEn4q1q3KMn1DDV4JJyJRFXcZ6lg3P3j8Gj1otr7/AtvDPTBp V+Hn8XMNmiCcQMJU7lG6mMUo12jZ6yE8FKbjfPc4N/NT9ydigh5oi8Wb+pF5dHF+5Nlk 8YqQ== X-Forwarded-Encrypted: i=1; AFNElJ8H/i84657FD7DbMaU31nMDWTeWizxrmtJv7KGQNYMDxvCQvvWdFzmT1s3swZ5Breun2wBScOtFyxl7RCM=@vger.kernel.org X-Gm-Message-State: AOJu0YyLaQUxPmyumQAR+q+hE/anhpGem4ahH+iuNZ76RwXPcaMH94Iu 5d+PJJ8Yd95FTwt5PGsw1F00j/V6H867T562Cs6HMzuvHNvKyz+dql36 X-Gm-Gg: Acq92OEWrlHc5Q0MgPnICY+S96/ALIzMIQl3uhiHgXajhDKvgnTs20M7GfzEcRphqJQ Jiaw8n/dbR6IZvB8F5E+nqKsJEV3V5zPeywRx8ryKr3Q9ig/k0KTaAuE+8ST8kcfpuXogh6QuPJ tQrXlMKh+LPk8gzo1XgLg/cLoK9D2Ui5XsD51gxbuajYU/3RIQZt9u/aWeZ56wedDLUTEYGPkpP ShU9ouNTwnUfHFwQHzHpEug1yB6gMXpk5I1moZ6t8UMXHVYapD+YAjWKDkXbnSIxwOIvXRw13da S0hDT7kxPGwx8TU4dvBpAs29BNjZ5LVkzuqqEhNPrx3vPua0gj5CJX6xHdvW1ueUCWGM9G17BPw Rho38Vthb7Lsq4uN9UksuVybgtKLCs1ICEYaqwW/YTARKEaRKItajR5p3jnsNRYll8/uM1yLQs/ YMsHUYjhpSijOic2PeRf1sc89swaRezjFZgu3w+9O1mCe/OW8rRslrZG628h2XdsyqzQZFHFhVs aZ2FBt5FvG+AQ== X-Received: by 2002:a05:651c:1141:b0:394:46f:ef18 with SMTP id 38308e7fff4ca-3940470583emr19268251fa.12.1778401561674; Sun, 10 May 2026 01:26:01 -0700 (PDT) Received: from Shofiq (87-92-218-151.rev.dnainternet.fi. [87.92.218.151]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f60db4dasm17810681fa.20.2026.05.10.01.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2026 01:26:00 -0700 (PDT) From: Md Shofiqul Islam To: jic23@kernel.org Cc: lars@metafoo.de, Michael.Hennerich@analog.com, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Md Shofiqul Islam Subject: [PATCH 0/5] iio: accel: adxl3xx: Add timestamps to FIFO data Date: Sun, 10 May 2026 11:25:51 +0300 Message-ID: <20260510082556.3867-1-shofiqtest@gmail.com> X-Mailer: git-send-email 2.54.0.windows.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Five ADXL-family accelerometer drivers (ADXL313, ADXL345, ADXL367, ADXL372, ADXL380) push buffered samples using iio_push_to_buffers(), which does not attach a hardware timestamp to the scan data. Userspace consumers therefore receive samples with no timing information. This series adds timestamp support uniformly across the family: - A scan buffer struct with an aligned_s64 ts field is added to each driver's state struct. The struct layout ensures the timestamp field sits at an 8-byte aligned offset as required by iio_push_to_buffers_with_timestamp(). - In the FIFO push loop, FIFO data is copied into scan.channels via memcpy(), then iio_push_to_buffers_with_timestamp() is called with a single timestamp captured once per interrupt with iio_get_time_ns(). Using one timestamp per IRQ is consistent with the existing approach in the same handlers for event timestamps. - For ADXL367, the helper adxl367_push_fifo_data() gains a s64 ts parameter so the timestamp captured in the IRQ handler is passed through instead of calling iio_get_time_ns() a second time. - For ADXL372 and ADXL380, where the IRQ handler already called iio_get_time_ns() for the event push, the same captured timestamp is now also passed to the FIFO push, removing the duplicate call. The ADXL313 and ADXL345 drivers always scan all three axes together (available_scan_masks contains only the full X|Y|Z mask), so their scan buffer layout is fixed. The ADXL367, ADXL372, and ADXL380 drivers support variable scan masks; fifo_set_size tracks the number of enabled channels per sample set and is used as the memcpy length. Md Shofiqul Islam (5): iio: accel: adxl372: Add timestamp to FIFO data iio: accel: adxl380: Add timestamp to FIFO data iio: accel: adxl367: Add timestamp to FIFO data iio: accel: adxl313: Add timestamp to FIFO data iio: accel: adxl345: Add timestamp to FIFO data drivers/iio/accel/adxl313.h | 4 ++++ drivers/iio/accel/adxl313_core.c | 8 ++++++-- drivers/iio/accel/adxl345_core.c | 12 ++++++++++-- drivers/iio/accel/adxl367.c | 17 +++++++++++++---- drivers/iio/accel/adxl372.c | 13 +++++++++++-- drivers/iio/accel/adxl380.c | 15 ++++++++++++--- 6 files changed, 56 insertions(+), 13 deletions(-) -- 2.54.0.windows.1