Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1500835lqo; Sun, 12 May 2024 05:34:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyLZmlsZak4MsRNXy6nZi9nYza6f4knMup09i2SeLzjINps9aa4mF0/W/NUgV2BB9CBlh0Gfeu7F5juW9BRx8ZIar2gMJpua8/3cvNkg== X-Google-Smtp-Source: AGHT+IHb8Qw1qHjMP5d+XISI6j5LcwYHEIhEXkSZgPRKIzE/nqByR/ZyUFV8H1CpYySmfH6HWr1r X-Received: by 2002:a05:6e02:154c:b0:36c:c51b:8157 with SMTP id e9e14a558f8ab-36cc51b847dmr90209255ab.15.1715517269635; Sun, 12 May 2024 05:34:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715517269; cv=pass; d=google.com; s=arc-20160816; b=Y/1YbTI92dKJYgdPmZuTgklQHVRIxcvAZnYxYqBV5tuTjsReB3JohvFBbfU/22dfD2 zt6zYqz8iK0wvGzmwkekp3PGFLWdJqpip+im3goSPIeRPSFc0YvlsWkkj3zgyRZku53W FRxpDmq+7FmAbuLrBu8Y8K8tyzlP87E9nGSXWJvkp+mIyGdOeeFGfvLgVZWj6F75LGh0 gZUa4wd7C9FQf+imhybvBNmuH8IhrawJM1D+FaqsqDIGXoCCzs25jy15EyBYQ2soO+gd Bjuew+OnWg5qHvrqHgHHn09/Xjr5vEMJYZE0ICp7vqduNVBXVfd9rpaIPlUkEwuwAeBq 4+oA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=bq4uv+nBfk0uagy1dPOc4CZ+k3H66W37K0a1JZcI7rE=; fh=ULxNTxaaQIEX8Y9ih2rqqI9Lxn2bbvdaV8tkS1+QGD8=; b=JO0a5f9ddWX3hv7+mmpWiB0slce6HyCvJ/Vc5MeSQoweqqwKByyI4pqLFXtV+F4yCe 6ad10nakLe1cWZYKOLLXHXq1qbSnji81fxGPCpAy/UyLIyBYc6JXTOg8QDOiK1dUwB2E ildb/1/nICWK33sEiwy9ozrxcKoIcDxFNx7NAx+TKn+ZylBNjfPSH3X7fhictowMqNjV QF81t0qJ5wVWmVCsydbUYdZOKoIjApWq++fMaQFwQAiUWf5w6+ntrWSib1dnFa8wiIA6 0KmJFUZ3yXczVVy9rD7+vIC6mXiWeCxeeAdZhtyzCvEep2YCr3CchChQJuYQ6tqgvH/u NH4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAL2WAAq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b4bea6si7766959b3a.382.2024.05.12.05.34.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 05:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAL2WAAq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176880-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3721128140E for ; Sun, 12 May 2024 12:34:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5161220B33; Sun, 12 May 2024 12:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TAL2WAAq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 780ED9445; Sun, 12 May 2024 12:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715517261; cv=none; b=A2MBOIw8ZW+rWndEdOUerHMdbU2pnfB6VkazV/0w1B/9FHUI8VIq28h+3KOQOUSP3uhEFKlNMiF3LZXiL2duLmMFSOS1FstRxsN/QaSyIqiIGp9YIDNIw41v+0wloSyVegkzMd6BLTZoayraqDNMyublZUv9twdBsteS+ng7U9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715517261; c=relaxed/simple; bh=pPdbQD3pDbSWDMpUCx3V7YtjEDy9QOmEYjvZWgdceeA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d456EYUI33xUw228KjAgr+1F4N7DhhHLeiGgH40XaNCPr2gLEq0+Nwyg9txrBIGJgjtanBW30Md4klRPLl2LdlxKj4Zo6VCNM052YUHUg2q76FB6AqX6Y/+IOk0jvKUJ8Wjw+3KBP7swVf3stT0G4QpJjNi0o+JJJiY72eQOdB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TAL2WAAq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAC05C116B1; Sun, 12 May 2024 12:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715517260; bh=pPdbQD3pDbSWDMpUCx3V7YtjEDy9QOmEYjvZWgdceeA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TAL2WAAqaUSd3SPNARXo89NeKVpGhXPRVTFlrOq98Mrnxqq+FK1aTB2b6ZTdhifws fAkPlxCk0Uv74ABRgF0uORvLo24pMh/CjfEVVDJ53l3o4ZnN7OI2mHdO2GlT5r/puj j26uRqfBQiDnb1ycykyiijJf+VnplaFGE2xclY8zjS8SA+E3PmFzrg2+P47u9G4Wif qGloNSMcCamG1cx1DggLIpa9CGSAMOiNG/cUEEbGb2jiJexZracErZ875xMTpBiJ/P 1cgFZXmH4nHelBFt06tfEC81FYypFJUWku1tvnOCPwPIK2d2RsLMzoIvFEchbupRuA w0k6mgPFhtOLw== Date: Sun, 12 May 2024 13:34:09 +0100 From: Jonathan Cameron To: Vasileios Amoiridis Cc: lars@metafoo.de, andriy.shevchenko@linux.intel.com, ang.iglesiasg@gmail.com, mazziesaccount@gmail.com, ak@it-klinger.de, petre.rodan@subdimension.ro, phil@raspberrypi.com, 579lpy@gmail.com, linus.walleij@linaro.org, semen.protsenko@linaro.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 9/9] iio: pressure: bmp280: Add triggered buffer support Message-ID: <20240512133409.6fb350c4@jic23-huawei> In-Reply-To: <20240508165207.145554-10-vassilisamir@gmail.com> References: <20240508165207.145554-1-vassilisamir@gmail.com> <20240508165207.145554-10-vassilisamir@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 8 May 2024 18:52:07 +0200 Vasileios Amoiridis wrote: > BMP2xx, BME280, BMP3xx, and BMP5xx use continuous buffers for their > temperature, pressure and humidity readings. This facilitates the > use of burst/bulk reads in order to acquire data faster. The > approach is different from the one used in oneshot captures. > > BMP085 & BMP1xx devices use a completely different measurement > process that is well defined and is used in their buffer_handler(). > > Suggested-by: Angel Iglesias > Signed-off-by: Vasileios Amoiridis The switch to ARRAY_SIZE() for num channels will simplify this because all those values will not need to be manually updated to include the timestamp channel. Other than that, this patch and earlier ones I didn't comment on (6, 7) look good to me. Thanks, Jonathan > diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c > index 3f8144a0355b..95f56836fd86 100644 > --- a/drivers/iio/pressure/bmp280-core.c > +++ b/drivers/iio/pressure/bmp280-core.c > static const int bmp180_oversampling_temp_avail[] = { 1 }; > static const int bmp180_oversampling_press_avail[] = { 1, 2, 4, 8 }; > static const u8 bmp180_chip_ids[] = { BMP180_CHIP_ID }; > @@ -2191,7 +2464,8 @@ const struct bmp280_chip_info bmp180_chip_info = { > .regmap_config = &bmp180_regmap_config, > .start_up_time = 2000, > .channels = bmp280_channels, > - .num_channels = 2, > + .num_channels = 3, As comment on above, if this was ARRAY_SIZE(bmp280_channels) you wouldn't need to update it here. Probably best to make that change as part of the previous patch. > + .avail_scan_masks = bmp280_avail_scan_masks,