Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp411085lqj; Sun, 2 Jun 2024 04:27:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX195huk3lT+01JifGSd6hOtehuWnnFmtZ2nqvPjpEjMUHDo5zBwP4ay0jndHEgczqKs31XxHgrH6iB8Cs6fzX5W9J9sP5I7rFdaRVltQ== X-Google-Smtp-Source: AGHT+IGeUaQht2q45etSoHVtWT8OtgdCmFqcu7gYWyCeQ+7aKtrnMTcz/7YifnWl0nEtWNKVyLBO X-Received: by 2002:a05:6602:3fc8:b0:7e1:7a0b:309e with SMTP id ca18e2360f4ac-7eaffe970e0mr878695439f.4.1717327679246; Sun, 02 Jun 2024 04:27:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717327679; cv=pass; d=google.com; s=arc-20160816; b=TgM99nCL3HEtVbA1QHdq+YXX0GNJNoqiYWX2VfDjzZNacby8Y9kfEm24uvQH8ovFTd JEMxteALOiE4jqJv56K0bEoEohLJ9QuECXapIhXfetSs40UQ2tViVd7DnGFcQqZt+cLZ H+auR9RxRJbzhb+u1vpfUDhxulLquDEiwcUiMZmNs0i83in72/Y/saJaWgWxKLKhW9aY q7/cUF3C8MoErggkLdaWZ9JFXXLXeb8cDnCqDu5NaGeDho+UUrx/cIyxb4MN2LJc5Azq v+kSqZ03QtL0AQXdoz03Ot1p5cQGMmpKCms7kMf2XM9v0vb9Ndfu7EdCnrRkDCxMxW1N GDhQ== 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=jY9Dnt5XyI6YLKGlZDtCgflPF/4fBcFFz+VhxEJTSog=; fh=gIRTlJ9wiarARgGEYwVds5qcWU4SR7fhnTOxezDmIt0=; b=JvazSHppx26goPuiss5YZku25IxPVh519XuovFJ03iwC/T9Qp5ZT4UmwFIhcxWhSbK dxeIyrA6Bfd+IE/11MVt1Rt1jpOCqnzVU547K7a3+wSh3S9w464IRUNn/x3lVfSV94lt kr91lDbrszXjMrEzHOKeTjAuKJZiS+HOw43kVTu1FIv9zWrWMZnCsN/EPHPfzJLDPwsv VsxbMBK9KXtRO8U46iORBx5DK6kB+VnDhH/tQzius8wx4CAP6A/LiFTBLfLSverxhPji dU0pxTtHr+JBNmV+3+d75QoGq4kVLkh0cdJhyma9raVjqOqgEwyfmMTS5su7CpTjVk8Z sELg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FxteHi9a; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35b40c733si4487146a12.605.2024.06.02.04.27.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 04:27:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FxteHi9a; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198209-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 11A88B21397 for ; Sun, 2 Jun 2024 11:27:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBBDF383BF; Sun, 2 Jun 2024 11:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FxteHi9a" 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 1913A2574D; Sun, 2 Jun 2024 11:27:46 +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=1717327667; cv=none; b=u4QTKROV5BMFSEU3t4Uq4FPVe0HNVtHlaJUeRlbShk1SwFFActH1zsV+EaRJx40eVVKM01skzgLcf6yv+/7Ff4cId3mbZps43MIn6/bKkAh0fVwNkzNCdTAWqkA7swiYZaFjCrk3AaQ8yAbrMmCc+Bq/MYuCDS+Yf7YpvM1BD0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717327667; c=relaxed/simple; bh=Lwha5IB5hh3/aivFQ6QRrrVvxlZpn4aDHhuG6j1fiLg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TUiWhyRuPnCQ1AmvDlWf9elTlGrvrHFDkZUXxu36WTNwONjN1Fum9yPsiyjWWS+PSabOfMgBBSdtbrEWs61ROmF2t4Af3hReSU9/Sp6RPg85yBDe1ph4c8nld1s0wmNS4oU7wfXY9zbcYVxpCpeaG5f7CnZOU7TlVRkJpZY03R0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FxteHi9a; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BFCAC2BBFC; Sun, 2 Jun 2024 11:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717327666; bh=Lwha5IB5hh3/aivFQ6QRrrVvxlZpn4aDHhuG6j1fiLg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FxteHi9aVxAg7eNJqwBtC5wRZJh+Qupe4klOk81L4hCTTbJbnyRqY+1+LKjkfxT6c UJLvyjoKrDfleEQNaF7/d3NOLV3Y/5yjaN4i2+Pd+8Q6xPVQUWG7k+2ifh6rS+3vSg FUFVs4K+1ixX/H0ZQcHpXezLEC3UYoktLn5kbRx2js04siUTusFY+nzzRdCcpe/saE oR2D39eU7UgIURlGzNdidh00Wl8A/UwW8Tue7QqzmaGpX/dJd8Sr6Y1EWIqY9mEm0J xYIvp3iHop+R+qc7PnyvPa25/lf5V6tA1zf7gcH6vuMEpOXm0XAI2V0UJ9YwYuB+Hq W4GU9vxzK0k4Q== Date: Sun, 2 Jun 2024 12:27:33 +0100 From: Jonathan Cameron To: Gustavo Silva Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lars@metafoo.de, christophe.jaillet@wanadoo.fr, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/6] iio: chemical: ens160: add triggered buffer support Message-ID: <20240602122733.5935da67@jic23-huawei> In-Reply-To: <20240529001504.33648-4-gustavograzs@gmail.com> References: <20240529001504.33648-1-gustavograzs@gmail.com> <20240529001504.33648-4-gustavograzs@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; 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 Tue, 28 May 2024 21:14:21 -0300 Gustavo Silva wrote: > ENS160 supports a data ready interrupt. Use it in combination with > triggered buffer for continuous data readings. > > Signed-off-by: Gustavo Silva A couple of really minor comments inline. Thanks, Jonathan > #endif > diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c > index a535f62c4..74ef7f150 100644 > --- a/drivers/iio/chemical/ens160_core.c > +++ b/drivers/iio/chemical/ens160_core.c > @@ -10,6 +10,9 @@ > > #include > #include > +#include > +#include > +#include > #include > #include > > @@ -19,9 +22,14 @@ > > #define ENS160_BOOTING_TIME_MS 10U > > -#define ENS160_REG_PART_ID 0x00 move this in earlier patch so no need to realign here. > +#define ENS160_REG_PART_ID 0x00 > > -#define ENS160_REG_OPMODE 0x10 > +#define ENS160_REG_OPMODE 0x10 > + > +#define ENS160_REG_CONFIG 0x11 > +#define ENS160_REG_CONFIG_INTEN BIT(0) > +#define ENS160_REG_CONFIG_INTDAT BIT(1) > +#define ENS160_REG_CONFIG_INT_CFG BIT(5) > > #define ENS160_REG_MODE_DEEP_SLEEP 0x00 > #define ENS160_REG_MODE_IDLE 0x01 > @@ -48,7 +56,12 @@ > > struct ens160_data { > struct regmap *regmap; > - u8 fw_version[3] __aligned(IIO_DMA_MINALIGN); > + struct mutex mutex; Mutex needs a comment to say what data it is protecting. > + struct { > + __le16 chans[2]; > + s64 timestamp __aligned(8); > + } scan __aligned(IIO_DMA_MINALIGN); > + u8 fw_version[3]; > __le16 buf; > };