From nobody Sun Dec 14 12:14:37 2025 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (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 A22E6253925 for ; Fri, 18 Apr 2025 22:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017159; cv=none; b=WMuDmE4OG7ZRMkIB+tPat4OPhrMuHvQfGWbaOaPU6s0CM3A64X0y7o/GeGGiQW/7UGeMQuwwmImbwMeh0lGHuyJCPr4Qg3twv37+mmN00dZu3xkXCCfjktcDAO+gCMdfusFDYyS0qH+KD19Qlhhm57VGNDaxm374ZtLahq26lCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017159; c=relaxed/simple; bh=yR1qdfXVdfkGN0fnFpgmDF3GpryusLxet4K3aH/uiM0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LEdS+HDrqqDmV64l3RX0Qm3tqVQvJwOFUJCwEKREqpyPNLY48z20EMrngYXf6jsZ0lL6/Mc2KLGtVoBmu8ZV8KAFNBf+xjQM7+nnJVfLrAIPuL8Dj1gxivmBO/Yi9xCu29A+Y4mDmc/kKAWths0KDizeF8RORayuYzT0JsdTFOs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=TPuQTPt6; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="TPuQTPt6" Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-7272f9b4132so1745712a34.0 for ; Fri, 18 Apr 2025 15:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1745017155; x=1745621955; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fDNMT7Ge9Z+4YSxWHFq5/Umu+PV5vrF6xXnHGQ6evEA=; b=TPuQTPt6xO7TX1JnW/lyOBF7K5v7kVYDs7bK2DQKc3h1IsaLzjV9S/bA1y+lNWy5ZT zaJcGc0p+R3Mw2NWc/944qMNsE+1SZu7lXS3zEybb9CVYsJA7iiuhuc9KWDYnYTEVfEH Bbz7xPmKixlxaRHdg/GM8N5oDQyI6PogQciHvpJUYT5YviWz42N+BXbvdAls5kk/lHiS 55oPPTjY2NiB8EIFVSmzgfDV6xGIxvl/jiwYjXX/530wWnX/+658Bs2WGGZE37EDvwWl GWxXMTW4Ief4Bw+yqVjRdvarmKIwudEF2o6wRFih7hmsvo5Tyam3HveWVTUIHj9JSstV bokw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745017155; x=1745621955; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fDNMT7Ge9Z+4YSxWHFq5/Umu+PV5vrF6xXnHGQ6evEA=; b=mKCxiqMVcdnmyGSreviC0U/x7eli4D54n9UtyqY1pvS/GOCSKfpqA8qAekjg0TeLzj ppjEyV5HJNBa+eOLUrHxoHqkm7B5va1VkiG8N2gc5uXjbfMe72H3+pMwNhgX71LMKTAK 4saO61fPLoIwGh0MtOfOowsawBm9Bon79UKaXd4DXGXPgMzJi5XeWS3uowX3Y1kYuYS1 /4Jt7Ks5/D4FJo1ziMWlkLViqiHb1jzdodoB0ewhykp2eD1ScZGdNgGz0Ph/3/Cmdc7x /sOojc5bQGjQU4BmdLq7TZ+6R/V6KP8bEFSrPznlk0Z0H3ekVV66uVVd7eUX6baUkkmO 9USQ== X-Forwarded-Encrypted: i=1; AJvYcCVwwGaWkhUp0wh4t8yrrGik6/uw4f7RDZQuei3qpAxapIP4kshS4HvR37lEe76J3Oq0hLmxNfIwyhjduyg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/kafUXTcqNQj+k9tNILV+dVZTkgpDCq38tyW5LVNNIaGnuPvI hLcWJxyoGeFw7Eqt7J/phVz22RgOMeARPnS4mx+UPCxmN0IhoBvPxhL0/82las0= X-Gm-Gg: ASbGncum8mZoLfOhaiGrdqhFYgiBzSBA6ptuW6gQUx0PYJ3I3p1OmUiQFV2VBnf5kaW sQ3hvSeEnR+BCaGci+VY9i3eLKEqy7S3XD5oxWpLyZ6QkO1em9T4PJlL+bmcG/KmWCDj/EbAF+I XUdd05QVloKOmLGh4+2YZgQD0gfxxvS7FBx3Gu1hbVoK1L6s85C7VULwlPwHl3v2S1+dstdLG47 /eBI59wqE+YIcXBWzIvFJb3mphE0y+AC+isK5R9shOTaIdiIquUFSJdg/nyxVnHmicwpwkAo2tF M1vM5FBwmXyN0W5gEViJMDJcLuAlN2CP3McFb4OZg6QUzHS85y2XZ8DIbQ== X-Google-Smtp-Source: AGHT+IFdZWM25OSHAtQes7EmpuJa7tXiSJHLyfFyew45Pxr9CuiS609PKuCNaI5AO0LYucuoFbpSlQ== X-Received: by 2002:a05:6830:6003:b0:72b:782a:56d7 with SMTP id 46e09a7af769-7300634a804mr2571319a34.23.1745017155668; Fri, 18 Apr 2025 15:59:15 -0700 (PDT) Received: from [127.0.1.1] ([2600:8803:e7e4:1d00:dcdf:46e0:18e5:c279]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-730047ca051sm500187a34.36.2025.04.18.15.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 15:59:15 -0700 (PDT) From: David Lechner Date: Fri, 18 Apr 2025 17:58:32 -0500 Subject: [PATCH 1/4] iio: introduce IIO_DECLARE_BUFFER_WITH_TS 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 Message-Id: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-1-ee0c62a33a0f@baylibre.com> References: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> In-Reply-To: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1828; i=dlechner@baylibre.com; h=from:subject:message-id; bh=yR1qdfXVdfkGN0fnFpgmDF3GpryusLxet4K3aH/uiM0=; b=owEBbQGS/pANAwAKAcLMIAH/AY/AAcsmYgBoAtkqyXb9vDxQstUInEUU743mIZXYVXrEgfvzc ak8VdCOqC6JATMEAAEKAB0WIQTsGNmeYg6D1pzYaJjCzCAB/wGPwAUCaALZKgAKCRDCzCAB/wGP wDZFB/90kaHk9mlw5yS5cTge2wjVVMXABttc+mogszsnZWm1GtEfulL8mUuzhfYg+SWsxdkA/oH pv0LXPUHJQoQGeC7BBpLdJ3DE1G8n5PeTEfMUqGCNt0oyF2yuq6yk1MYHWuDz1Lb+sF9A7T/ZhT a+iD6i86h2EADCy/GXNzs62lqcT3Qor9HeLcFzFFMqb71N2ShhOVecLdNdVnikmy+JZfHuvSd4b YM6vJf9QO2RBccB9lLCUjyRcYNDqEAYQbtsKNf9nqCmVE2woGQTprHrMt8btY9RuB0RRKxCijMO 3wjgARlY2jxqGUNK2lpUB/pDiSxFoz+/ZAyUlhGnb3nay+j1 X-Developer-Key: i=dlechner@baylibre.com; a=openpgp; fpr=8A73D82A6A1F509907F373881F8AF88C82F77C03 Add a new macro to help with the common case of declaring a buffer that is safe to use with iio_push_to_buffers_with_ts(). This is not trivial to do correctly because of the alignment requirements of the timestamp. This will make it easier for both authors and reviewers. Signed-off-by: David Lechner --- include/linux/iio/iio.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 638cf2420fbd85cf2924d09d061df601d1d4bb2a..f523b046c627037c449170b7490= ce2a351c6b9c0 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -7,6 +7,7 @@ #ifndef _INDUSTRIAL_IO_H_ #define _INDUSTRIAL_IO_H_ =20 +#include #include #include #include @@ -770,6 +771,21 @@ static inline void *iio_device_get_drvdata(const struc= t iio_dev *indio_dev) return dev_get_drvdata(&indio_dev->dev); } =20 +/** + * IIO_DECLARE_BUFFER_WITH_TS() - Declare a buffer with timestamp + * @type: element type of the buffer + * @name: identifier name of the buffer + * @count: number of elements in the buffer + * + * Declares a buffer that is safe to use with iio_push_to_buffer_with_ts()= . In + * addition to allocating enough space for @count elements of @type, it al= so + * allocates space for a s64 timestamp at the end of the buffer and ensures + * proper alignment of the timestamp. + */ +#define IIO_DECLARE_BUFFER_WITH_TS(type, name, count) \ + type name[ALIGN((count), sizeof(s64) / sizeof(type)) \ + + sizeof(s64)/ sizeof(type)] __aligned(sizeof(s64)) + /* * Used to ensure the iio_priv() structure is aligned to allow that struct= ure * to in turn include IIO_DMA_MINALIGN'd elements such as buffers which --=20 2.43.0 From nobody Sun Dec 14 12:14:37 2025 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.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 5808D25393D for ; Fri, 18 Apr 2025 22:59:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017160; cv=none; b=uofpjPYiCXhK+3fUaQJP3m+Zgp1+J/5fY0oEAudc8aa9Ze7i9ZhyMN0JJvIHGtBaZG4bMMYX3JcUcvsYfilx4wB5y2MkWAMrRRMKrsaeCQsbJl2F0eZRBWR2ixC/V1dmzGUSmCQf08Z55rHnxsblc0TJ3hs0k044/kudj8ma4/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017160; c=relaxed/simple; bh=AhweVhEH25d8wvLOV8U3tgjVpTfYu6HqQRzrCrL17tE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AiRX/Y0keAbmSxQ5vQYE0PswdBl3HxHObUZ0JiZZ7XY7g62NE8jdZnMgtnrMlcyBDW40tPgdj+/QuxFEeGeBJKAX64Y3fHn4NwyY6Hs+TheEKpDiXqrzigt5l3Foybuo9ktMTvVO135A5W+lnUjL/Lc1RlUCumAaVYuM03mKQd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=O5NQWVHM; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="O5NQWVHM" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-605f7d3215cso878543eaf.0 for ; Fri, 18 Apr 2025 15:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1745017157; x=1745621957; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Qcd8b+sFJozfLFSGqyv9tVesse4R4meJLMxQxoDs5cY=; b=O5NQWVHMQB3pz0Hxer+nJY2ILrk4n7S9Nrd+2Lntx/1EG0BRuIeFcuCmygnie05r9z RIsKgCyizuscR5q9h3UWNxT/citM4rvNzVrY4kLwMA97s/OY85aNIXnipu3xlLf3SWmg 9sAP7ZkynEaptmX7hZy75vBWhS+IfvRzehSMzRO1i+DYb+DjCp5KdB3NFKWj1N5t2lAx btxMX3UvzH/ILh/U9xI9ZV+F7yyefdD29zJAAtot8XJhCDIAu993ZqTiphgsDa5iU9pO Lwv3v4dIGs5JjvHkO9s5J4TlIPg8LH4SuHe9gzoNhFd+4HoHU6TTHNx0P5C6MBCsiKDV s8ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745017157; x=1745621957; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qcd8b+sFJozfLFSGqyv9tVesse4R4meJLMxQxoDs5cY=; b=enlrUhqifxMvrEHttX6SNTKNN4/9Nc0UdQFR3mXLMzDvcQ1Kd8l1rb8CwphMovqrhS 4Nbxo/PLHy0KCejRhglheUvu6guyp06YblsTiHvOhvNsHZXCuc4uMby1Jeka3L3pck8b YrVgqoudeoX87BzjoEK2JMHAHQZWQvqaWydSDpgQTEfYlgl8AUKl/cyGV4l94dgoDWP0 8EHSp2A4jVE1BUO9pT57CR2p3ixoPhjQas3zEG01V5c0OuwAN0UZ8wdUWTaHJbH1pdKX sxusO3b9QQiQXkwMJyEdptfzVhTC+JZalZ/5je5VhwmA+ZMi/kEuC2UTnQEq8yjCg9+9 R7AQ== X-Forwarded-Encrypted: i=1; AJvYcCWtMmUAd2V3Hw3P12AWFEflnN0GhY8i3pv30xzpPxZEhYyFtFxF0IP3tIAyd3ppcIlEYC4tDFtxOlflIaA=@vger.kernel.org X-Gm-Message-State: AOJu0YwlLZv2pyWn85nVbHyTgv869gPpPoOzXNie3iS244fHmY1YKa01 PMppTOWDwkSxcFjhINxZiSQyNbO2ojTTYf6WcoAVDKcyzWKENyKx6Af4hBLVGGk= X-Gm-Gg: ASbGnctlbpliAj45If36Y58Fbt+0YmI5gpqlR7e5oWQMQ6XyESevt4rsuzKnwOuBMKm 4Fe6LQe3SU3XM73i7tsQGAF+yn3wrmuUzaP3HQAEy0ZNGqP0w6FfVtaGYic3XjvgM6BN/rV3aBB qJUpJrIrWaVORr6+59JX4V9F2K7lanEqc7K0bytVoqGv0KKyZgNIrVgB+M72eSUqJlNFXyUwaym mnAokjlbMFhrPpPLitLZ74BrziqrFWgxxPCl6+DHLSCOrfQDOcAeb3PkW/BxE/HTRUR9BiCGsSN CTquV9ecaF/bh4R9HJKNk3rk2NI9yEBsBCttV40yh8nPXfg= X-Google-Smtp-Source: AGHT+IEqI7qvS/d0QPEDtMVFvFJPfknYM8BmtKsJXX8Dihq16YiQi+FdZpmjzCPfTelnznsjB0NpXw== X-Received: by 2002:a05:6870:830e:b0:2d5:296d:4ed4 with SMTP id 586e51a60fabf-2d5296d5a3bmr2074062fac.28.1745017157331; Fri, 18 Apr 2025 15:59:17 -0700 (PDT) Received: from [127.0.1.1] ([2600:8803:e7e4:1d00:dcdf:46e0:18e5:c279]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-730047ca051sm500187a34.36.2025.04.18.15.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 15:59:16 -0700 (PDT) From: David Lechner Date: Fri, 18 Apr 2025 17:58:33 -0500 Subject: [PATCH 2/4] iio: adc: ad4695: use IIO_DECLARE_BUFFER_WITH_TS 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 Message-Id: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-2-ee0c62a33a0f@baylibre.com> References: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> In-Reply-To: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1621; i=dlechner@baylibre.com; h=from:subject:message-id; bh=AhweVhEH25d8wvLOV8U3tgjVpTfYu6HqQRzrCrL17tE=; b=owEBbQGS/pANAwAKAcLMIAH/AY/AAcsmYgBoAtkwbaokaUxwrPZaLomgNtqgyv4GS7ATOqORj 0P+ER/gwqaJATMEAAEKAB0WIQTsGNmeYg6D1pzYaJjCzCAB/wGPwAUCaALZMAAKCRDCzCAB/wGP wFEaB/9kNMjrqZsGk4OBPqABJHXa9sFYcNgxYZ2NRZNHahhqWZTGvAnhd3VEGXSd7fSGIRIQhga 7AXUpuemh2Vi4EfeFeqwsQpLK6tkDk/9WiU0SbUqU9T6gaZb+bRvy7ws/QEduYEBZUR6peuPa07 xs8tFTOXjWlNhf2SgeVO1YGSZmuJL+TepRK4TzmqKuH5Nzy7Z8xBHFW+T5HdV3m8lP/UbuWj/kp 6iMmxNtFOY4pCueCqHyGHG7YEL29rH+VbNfN3AZkFRyzxGFV1f7yIBwgNh8zg36Zer++S7xuzV5 ALMD9JKMw5wg4pzqXjpKFe+DQtHhh6H7vs3esTIAbsDaVsNr X-Developer-Key: i=dlechner@baylibre.com; a=openpgp; fpr=8A73D82A6A1F509907F373881F8AF88C82F77C03 Use IIO_DECLARE_BUFFER_WITH_TS to declare the buffer that gets used with iio_push_to_buffers_with_ts(). This makes the code a bit easier to read and understand. AD4695_MAX_CHANNEL_SIZE macro is dropped since it was making the line too long and didn't add that much value. AD4695_MAX_CHANNELS + 2 is changed to AD4695_MAX_CHANNELS + 1 because previously we were overallocating. AD4695_MAX_CHANNELS is the number of of voltage channels and + 1 is for the temperature channel. Signed-off-by: David Lechner --- drivers/iio/adc/ad4695.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/ad4695.c b/drivers/iio/adc/ad4695.c index 68c6625db0d75f4cade7cb029e94191118dbcaa0..9862ff99642b61db42b16b797ae= 046efd99c2811 100644 --- a/drivers/iio/adc/ad4695.c +++ b/drivers/iio/adc/ad4695.c @@ -106,8 +106,6 @@ =20 /* Max number of voltage input channels. */ #define AD4695_MAX_CHANNELS 16 -/* Max size of 1 raw sample in bytes. */ -#define AD4695_MAX_CHANNEL_SIZE 2 =20 enum ad4695_in_pair { AD4695_IN_PAIR_REFGND, @@ -162,8 +160,8 @@ struct ad4695_state { struct spi_transfer buf_read_xfer[AD4695_MAX_CHANNELS * 2 + 3]; struct spi_message buf_read_msg; /* Raw conversion data received. */ - u8 buf[ALIGN((AD4695_MAX_CHANNELS + 2) * AD4695_MAX_CHANNEL_SIZE, - sizeof(s64)) + sizeof(s64)] __aligned(IIO_DMA_MINALIGN); + IIO_DECLARE_BUFFER_WITH_TS(u8, buf, (AD4695_MAX_CHANNELS + 1) * 2) + __aligned(IIO_DMA_MINALIGN); u16 raw_data; /* Commands to send for single conversion. */ u16 cnv_cmd; --=20 2.43.0 From nobody Sun Dec 14 12:14:37 2025 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14B5B253B7C for ; Fri, 18 Apr 2025 22:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017161; cv=none; b=qp3E3sBQQa7rSAd7FuXsw8qWpG/kw5occt8RjKcW059VA+Yzjd1Pe7WsXoGxSajjUVJfcvXqnW8UaX8vc9MsyWHCzpUMoKRvWE1bR3Oabr9ExGgDC9zGzMTJ1cA11NcFG7HxRiMHTI/+0bBDdXPj4kX3W8S09DgokfEFK5/+yto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017161; c=relaxed/simple; bh=riLMNi8cTRALK+z2tdzALBzLDS506Wq4e/lftZ4Qza0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O1C0EYtL+0TB4Y7rQgY5E/x6Iu5cbbJbW/2WYrmDiT/99fGHVaVHEDCASKoqNTqlw17lqcyHfSeWDl3NA8MTmB90G+zsmlfXX4NS5xt+GjYbb3reCNOdavxGWfjapfwC3r3UxOmL3yBdP2Q5a8rC4FIzzGU2/1pUFh2/JxDgA7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=H1CTWtCn; arc=none smtp.client-ip=209.85.210.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="H1CTWtCn" Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-72c27166ab3so1470691a34.1 for ; Fri, 18 Apr 2025 15:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1745017159; x=1745621959; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hKikOgoKDd6H5VVHjKZgNHtxeK29B8IxCF5UHWIsVRU=; b=H1CTWtCnIsxSGloXteS0VxXMnL+TYx6mcDudDOJ6E4COVVDhRYx0NjEG5KdwMBDCVk hWV8PFLpp6C26Hw0ymzkZ8jfeAYkXnSUDImeXB1b4allf+6iNQrhL09nRxniaXDNyJMi b4R61orBrOo6SD5T60r6v5vdTku0cUZfn3p3tYPA7QbYfXecGO1DhbGLZlRX5AwPmr5K Xxb2heCBgY/p3EUCyLUn6x9F3jtIFWp/pfypafPm5am2LxA4nzycM3rUN5Fpx5OKxxr0 edzVokUlTP43JqGBh/xdHmrLSjakfJx/9eDorDsFoD0ybmz2qmCWZqCuFCe4uGUqMdxD T/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745017159; x=1745621959; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hKikOgoKDd6H5VVHjKZgNHtxeK29B8IxCF5UHWIsVRU=; b=DdfODjX19UhB5TPhLW3RAQXrONGQ7+BO+EdvCIQofe1Be3lP8r76LfzqPqY6wxEx/M JedLNtnTTMf+YMDKbM8kAvOeOEyvh/rhEf+XQd+JKMwxoO/+y+zYKoRmB0oZ+eMiCbEN mhNIollCJ8WcSz8uMiLCHPwhbvRgfPh8cEmn5a3aiqstUF/pyDLLonVjP3E1aQirF5bE TfQm49HtTFak79hT4lWCln7mbPuyLghxCxAfy5Fbo/EE49opExYFsOCsUYTq0IM7vYpl hNXfAG3g5UwzQqL8MjGPcLhYbp0DGwpySmLIVcT3pMphLxi3buLYRocHcdYfKrBGL1py H2cQ== X-Forwarded-Encrypted: i=1; AJvYcCVZKVPcCYlmukrC4Kn+OGsx3O6JILEBf5Ye+xZklP7yVqhnzUrcoriwOHrHw4CMX5iYKpVycTorOAd0BtU=@vger.kernel.org X-Gm-Message-State: AOJu0YzZuiefPgb+BKOi6GqwGInADe+OasA0p9zeuSg1WdLIAOFgFJwY uqFNBsGA/+JGx+CWWVwm4b7BWXQZhlFNBgK/aKfBREWeTyiThBgefnnRxHxahlkCJLq68mRCeGx 1NCg= X-Gm-Gg: ASbGnctXNS0jrOownttg6mzuDgIDRjmZbIpPXve+WeJw6Iola30cO/5oFBjVxfbVlrG Ut15lNjKZAWypjznfgHPUM0RShmQtZboPmTh2TfYPZK7ddlpKKQFxu/s1p0zv1OfFq3eAM+ciS8 YU/k1HvXB5x3Xaw3lUDVZZy29zlB0ZnKVRmWUfnMmADQRBsyHtOL7MrtHeTjxKtDZV8OpkaZ+dr g89HCcBRWAmz5ZyC8I0dMFllAqHdqGnMJteiTPEtuFilt6peyBlBygVeLvIltQ/9Hg5Dk9LRAiM 8DF3n6q4/WOPe9f0yQZerRZdS5Dv2w9zFkaLAIN7bRwFcNQ= X-Google-Smtp-Source: AGHT+IGPJokDaTAIKv/2DTkY0IrE751M1/ey6Bstj4RPUeiVBf+/tF6VXizJAmOZInWQ1epMeUepcg== X-Received: by 2002:a05:6830:6288:b0:72b:823c:8f66 with SMTP id 46e09a7af769-7300621472cmr2288047a34.9.1745017159150; Fri, 18 Apr 2025 15:59:19 -0700 (PDT) Received: from [127.0.1.1] ([2600:8803:e7e4:1d00:dcdf:46e0:18e5:c279]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-730047ca051sm500187a34.36.2025.04.18.15.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 15:59:18 -0700 (PDT) From: David Lechner Date: Fri, 18 Apr 2025 17:58:34 -0500 Subject: [PATCH 3/4] iio: adc: ad7380: use IIO_DECLARE_BUFFER_WITH_TS 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 Message-Id: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-3-ee0c62a33a0f@baylibre.com> References: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> In-Reply-To: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1021; i=dlechner@baylibre.com; h=from:subject:message-id; bh=riLMNi8cTRALK+z2tdzALBzLDS506Wq4e/lftZ4Qza0=; b=owEBbQGS/pANAwAKAcLMIAH/AY/AAcsmYgBoAtk2t7drGYkZBaTOujJackZlIDOkAakZwtlxz 7OJGnoF95eJATMEAAEKAB0WIQTsGNmeYg6D1pzYaJjCzCAB/wGPwAUCaALZNgAKCRDCzCAB/wGP wGcMB/9a4WWdbWax5eiemUVcfLr13sp47i1kakQLLayyBmRyEaMLfzx0oomjVAIf9nBSWOq991n 5EXQ2ULf0zWpWOTVcx87Ie0E1hJtkhB26kdM/H4nwFqxacPNsWcETx1LJbdq86uHMuFvW5Yvi3m mxpjVC8EkEKCV+DzOJ8Jg5N9MzDpxQ7S7oc3EBkpPTrGAIvyOW979gFe5bZOyPAI/qojBM/PJ0i hI3wlIaA3a2K/MlMTwjuqaRHwEA6MT6jjOo80ZGoj+WNT/D6XWGT4V7Y7osJUymCYHZk65cceng mi6yJ/53Usj68z70BNR31ZCpm1PMt88v8cYv/55t+gzTy4gp X-Developer-Key: i=dlechner@baylibre.com; a=openpgp; fpr=8A73D82A6A1F509907F373881F8AF88C82F77C03 Use IIO_DECLARE_BUFFER_WITH_TS to declare the buffer that gets used with iio_push_to_buffers_with_ts(). This makes the code a bit easier to read and understand. Signed-off-by: David Lechner --- drivers/iio/adc/ad7380.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad7380.c b/drivers/iio/adc/ad7380.c index f93e6c67766aa89b18c1a7dec02ae8912f65261c..f89b195c644024151c14977fd43= e279a67439fb1 100644 --- a/drivers/iio/adc/ad7380.c +++ b/drivers/iio/adc/ad7380.c @@ -909,8 +909,8 @@ struct ad7380_state { * Make the buffer large enough for MAX_NUM_CHANNELS 32-bit samples and * one 64-bit aligned 64-bit timestamp. */ - u8 scan_data[ALIGN(MAX_NUM_CHANNELS * sizeof(u32), sizeof(s64)) - + sizeof(s64)] __aligned(IIO_DMA_MINALIGN); + IIO_DECLARE_BUFFER_WITH_TS(u8, scan_data, MAX_NUM_CHANNELS * sizeof(u32)) + __aligned(IIO_DMA_MINALIGN); /* buffers for reading/writing registers */ u16 tx; u16 rx; --=20 2.43.0 From nobody Sun Dec 14 12:14:37 2025 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B108C254B05 for ; Fri, 18 Apr 2025 22:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017163; cv=none; b=px4GcB4Cn8S1r57+JdHLGQSITubFD46JMTICD67ej32VURFcA+7I8BGmomDAKww5LNWzB6vljCaKEeZ2zYZfyfPjUzul0dsy1fwHeY10UnNMio+Z1RpMrREzkTR7hpj6hyRfdcw6P3kHSs7fY3QjPHgIzZ68QrCqd/f9ETpZxBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745017163; c=relaxed/simple; bh=dE+Bh2dLzHZaDfFfGvJCuONf8Z/4uctHMsmHaIg81Wo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=te0k7EwKbLJ2p9h6IBIb4Zx+PtRTHgChGR4IyNpV0e4K5fpzNbI0d5gG43Ld9JxYxVGeIaqFuObPiprSjgzdawURRLXtOwLdpurqZ2EmmEBRXLU5yZ5Qndvi82bApitySWMF2qRjXGJnADGqJeqAOEyLz/RQmpvcKd4Uh0vFC1o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=UL/t0b9X; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="UL/t0b9X" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-72c1818c394so1373299a34.2 for ; Fri, 18 Apr 2025 15:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1745017161; x=1745621961; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uYflLc6ZtTC/uqwD8kHGOb9ooOEq6qvp2MOFP8DwFKQ=; b=UL/t0b9XNp4dht2NpEfbCUGcJDQfBf+baHZ90TzTQE6P9O7Zey3PDa/f/IvAEj1rMh 9khCcHJnKPMo4gfbpuIxUE0d/dO3dDPIdomrU9GOyDNIhFZ52lZyBVsfoqKGeW/g+F/3 aRGgR+mBPwq0lC89ZxGULUP6iRhRJQ6XWoatmxcYR8ezaRpooMHeqooR6/4iAPRy4yt7 wjisIyXTKUGLZ4/HPBHv6zBoCU9gPYDFtyOw9JZ6EHhxs8OKqAB0qPXEid75bBp86MGz itzgWUu09/hvJbCo4juE7gFgDKyTAyYa5t0srHwm2DBe8EXBl8zdGT4sEwHZp2s0e6Ph 4keg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745017161; x=1745621961; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uYflLc6ZtTC/uqwD8kHGOb9ooOEq6qvp2MOFP8DwFKQ=; b=LR0IONPif9cEkxsfi8vVTwPv9OczuWs5yHEwdaunJXuG4X2GFL/RwDDzTeBtHrx+9i 2R6zMBMHEgl4bmV0eXTwaUg5JQBOBYMf83hqqmLX/exU7ER4/i7aAsPO0mGkJE+FSWCB 0AnNnfqhH1RAOtvkkJsYbzJ6ssDXol8UQlwd9nstfCDYhZTG8ktPczhOK+2rxFtOvBRX jaRIrzvEViBy8SD/rJKZPP1c5V0jO2WyVIrZ123IfUBdOOOoQ/KFaSJSTimCXM+XbvFQ OFM6lJGAALfXDuYI3G34l5GlRXzV5VWbSul64sZ/P2ELSC2aIMOe9KERGwcVbznvKcLm baXg== X-Forwarded-Encrypted: i=1; AJvYcCX7N49iGwT2qjINcPWoelMnO/yUvaP4GFPTx4apsoYipMg0OXfQaBAZ2x0blAEExD67J7xCgA3u1erBbD8=@vger.kernel.org X-Gm-Message-State: AOJu0YyqSXn9IOTOEgS2gf03yfwiOqmPI7+xSUQTaqWyQNThNoNZEoId KGv9/0XSKqoN5k42dvL+mbS41mMBYuhQZX2H2ON9XwqcqhVp/IEcLp3EAVjnW9zjRLieUr4ona1 7+o8= X-Gm-Gg: ASbGncvKqeAfHdQw2rXs1pCRayRITqbZ1I+I+8goyIK/S00fQfmYFLDlv0rVNtYhPIz 4n/3dU9iti2l70zQKZ/Exq8PyeuUT8KMbvLmafFTuhPBuUJMVWptnxzPFjDSIcpjDicn+1Ss3v4 MXT6aHMP/foPAefv7CzErp29X5JJsyY7xpj6P4cIG68xYK9G9tgvK9s14rSZqQdb8DlrM3oXEUU qRvz675vC45cAPPCnLzItch4ec7RdK3CkBtv91XYQq4bO2ZomrrC8i8Rnmd15E/tPzjlwryCC0u 8v/XBqxCMCJac8bDVoO4aRLXHZFhBIb90RmvW/3Ej8yZr/g= X-Google-Smtp-Source: AGHT+IFyr8tL3f7/Gclxxm0qCx+apQWNKvST6w//YiaITYAopkMwLe+KpXjHV8bVZ+S3OC2Ex+Rp6w== X-Received: by 2002:a05:6830:658b:b0:72a:10ec:3637 with SMTP id 46e09a7af769-7300622918cmr2588254a34.15.1745017160817; Fri, 18 Apr 2025 15:59:20 -0700 (PDT) Received: from [127.0.1.1] ([2600:8803:e7e4:1d00:dcdf:46e0:18e5:c279]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-730047ca051sm500187a34.36.2025.04.18.15.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 15:59:20 -0700 (PDT) From: David Lechner Date: Fri, 18 Apr 2025 17:58:35 -0500 Subject: [PATCH 4/4] iio: pressure: bmp280: use IIO_DECLARE_BUFFER_WITH_TS 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 Message-Id: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-4-ee0c62a33a0f@baylibre.com> References: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> In-Reply-To: <20250418-iio-introduce-iio_declare_buffer_with_ts-v1-0-ee0c62a33a0f@baylibre.com> To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2758; i=dlechner@baylibre.com; h=from:subject:message-id; bh=dE+Bh2dLzHZaDfFfGvJCuONf8Z/4uctHMsmHaIg81Wo=; b=owEBbQGS/pANAwAKAcLMIAH/AY/AAcsmYgBoAtk7JE5s2L1ct8bmryT0sZgPM26LmpBqyZcvV sJfFqw7IoyJATMEAAEKAB0WIQTsGNmeYg6D1pzYaJjCzCAB/wGPwAUCaALZOwAKCRDCzCAB/wGP wP+MB/911j/8pWylCV/OBlqSeXb8qXnXesTzGfthr0UOUhdXRaPH4alE6i0zLQxCV9juG5aEeQ+ HIwQ/YYY4vz2o9fdKwdeeI28nPOnDaZoL/S5U+aMwQXkWQ9XNtpHKe6FGI+PMWD2KfXcWxJYddW XakmXPOQBMwiSha6+k0c0dX44Nqo3xADjw6thtb38cBoiLIMdIHGQzojL6XbOD5d4mlup+pzp0y h07zm+u/2MobSqFDb/ag7+5vJvy08cffFWILTsSFhf+SnhZVrJ0EuQci17F87JY1+b+9s7EJEOe 667j+A32xQ7dnjFQoJo/Ibb4mjTUfVJQY5gISdYggw5ZYigB X-Developer-Key: i=dlechner@baylibre.com; a=openpgp; fpr=8A73D82A6A1F509907F373881F8AF88C82F77C03 Use IIO_DECLARE_BUFFER_WITH_TS to declare the buffer that gets used with iio_push_to_buffers_with_ts(). This makes the code a bit easier to read and understand. The data type is changed so that we can drop the casts when the buffer is used. Signed-off-by: David Lechner Reviewed-by: Andy Shevchenko --- drivers/iio/pressure/bmp280-core.c | 8 ++++---- drivers/iio/pressure/bmp280.h | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp2= 80-core.c index c20cc4a98c9c494a9c8843518ba2f17b41be18a9..847340e38fd069643c3d38037da= b1bab727dcc8f 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1107,7 +1107,7 @@ static irqreturn_t bmp280_trigger_handler(int irq, vo= id *p) struct bmp280_data *data =3D iio_priv(indio_dev); u32 adc_temp, adc_press, comp_press; s32 t_fine, comp_temp; - s32 *chans =3D (s32 *)data->sensor_data; + s32 *chans =3D data->sensor_data; int ret; =20 guard(mutex)(&data->lock); @@ -1228,7 +1228,7 @@ static irqreturn_t bme280_trigger_handler(int irq, vo= id *p) struct bmp280_data *data =3D iio_priv(indio_dev); u32 adc_temp, adc_press, adc_humidity, comp_press, comp_humidity; s32 t_fine, comp_temp; - s32 *chans =3D (s32 *)data->sensor_data; + s32 *chans =3D data->sensor_data; int ret; =20 guard(mutex)(&data->lock); @@ -1903,7 +1903,7 @@ static irqreturn_t bmp380_trigger_handler(int irq, vo= id *p) struct bmp280_data *data =3D iio_priv(indio_dev); u32 adc_temp, adc_press, comp_press; s32 t_fine, comp_temp; - s32 *chans =3D (s32 *)data->sensor_data; + s32 *chans =3D data->sensor_data; int ret; =20 guard(mutex)(&data->lock); @@ -2957,7 +2957,7 @@ static irqreturn_t bmp180_trigger_handler(int irq, vo= id *p) struct iio_dev *indio_dev =3D pf->indio_dev; struct bmp280_data *data =3D iio_priv(indio_dev); int ret, comp_temp, comp_press; - s32 *chans =3D (s32 *)data->sensor_data; + s32 *chans =3D data->sensor_data; =20 guard(mutex)(&data->lock); =20 diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h index 5b2ee1d0ee464797d1d9993a014d8f84c37d5596..86ec525ae40d92cc562e998dbe9= 92f091343d88a 100644 --- a/drivers/iio/pressure/bmp280.h +++ b/drivers/iio/pressure/bmp280.h @@ -456,8 +456,7 @@ struct bmp280_data { * Data to push to userspace triggered buffer. Up to 3 channels and * s64 timestamp, aligned. */ - u8 sensor_data[ALIGN(sizeof(s32) * BME280_NUM_MAX_CHANNELS, sizeof(s64)) - + sizeof(s64)] __aligned(sizeof(s64)); + IIO_DECLARE_BUFFER_WITH_TS(s32, sensor_data, BME280_NUM_MAX_CHANNELS); =20 /* Value to hold the current operation mode of the device */ enum bmp280_op_mode op_mode; --=20 2.43.0