public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Gustavo Silva <gustavograzs@gmail.com>
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
Date: Sun, 2 Jun 2024 12:27:33 +0100	[thread overview]
Message-ID: <20240602122733.5935da67@jic23-huawei> (raw)
In-Reply-To: <20240529001504.33648-4-gustavograzs@gmail.com>

On Tue, 28 May 2024 21:14:21 -0300
Gustavo Silva <gustavograzs@gmail.com> wrote:

> ENS160 supports a data ready interrupt. Use it in combination with
> triggered buffer for continuous data readings.
> 
> Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
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 <linux/bitfield.h>
>  #include <linux/iio/iio.h>
> +#include <linux/iio/trigger.h>
> +#include <linux/iio/trigger_consumer.h>
> +#include <linux/iio/triggered_buffer.h>
>  #include <linux/module.h>
>  #include <linux/regmap.h>
>  
> @@ -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;
>  };


  reply	other threads:[~2024-06-02 11:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  0:14 [PATCH v2 1/6] dt-bindings: vendor-prefixes: add ScioSense Gustavo Silva
2024-05-29  0:14 ` [PATCH v2 2/6] dt-bindings: iio: chemical: add ENS160 sensor Gustavo Silva
2024-05-29  1:42   ` Rob Herring (Arm)
2024-05-29 16:36   ` Conor Dooley
2024-05-29 16:37     ` Conor Dooley
2024-05-31 22:33       ` Gustavo Silva
2024-05-29  0:14 ` [PATCH v2 3/6] iio: chemical: add driver for " Gustavo Silva
2024-06-02 11:24   ` Jonathan Cameron
2024-05-29  0:14 ` [PATCH v2 4/6] iio: chemical: ens160: add triggered buffer support Gustavo Silva
2024-06-02 11:27   ` Jonathan Cameron [this message]
2024-05-29  0:14 ` [PATCH v2 5/6] iio: chemical: ens160: add power management support Gustavo Silva
2024-05-29  0:14 ` [PATCH v2 6/6] MAINTAINERS: Add ScioSense ENS160 Gustavo Silva
2024-05-29  7:29 ` [PATCH v2 1/6] dt-bindings: vendor-prefixes: add ScioSense Krzysztof Kozlowski
2024-05-29 16:34   ` Conor Dooley
2024-05-31 22:22   ` Gustavo Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240602122733.5935da67@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gustavograzs@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox