Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: inv.git-commit@tdk.com
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
	Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Subject: Re: [PATCH 2/4] iio: imu: inv_mpu6050: add WoM event inside accel channels
Date: Sun, 3 Mar 2024 16:58:34 +0000	[thread overview]
Message-ID: <20240303165834.4db9ffdc@jic23-huawei> (raw)
In-Reply-To: <20240225160027.200092-3-inv.git-commit@tdk.com>

On Sun, 25 Feb 2024 16:00:25 +0000
inv.git-commit@tdk.com wrote:

> From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
> 
> Add WoM (mag_adaptive rising) event in accel channels for all
> chips >= MPU-6500. This requires to create new MPU-6500 channels
> as default and MPU-6050 channels for older chips.
> 
> Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Trivial comment inline - otherwise looks good beyond question of 
event type.

Jonathan

> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 132 ++++++++++++++-------
>  1 file changed, 89 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> index fca7fc1ba4e2..d2544c758815 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
> @@ -1303,23 +1303,34 @@ static const struct iio_chan_spec_ext_info inv_ext_info[] = {
>  	{ }
>  };
>  
> -#define INV_MPU6050_CHAN(_type, _channel2, _index)                    \
> -	{                                                             \
> -		.type = _type,                                        \
> -		.modified = 1,                                        \
> -		.channel2 = _channel2,                                \
> -		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
> -		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	      \
> -				      BIT(IIO_CHAN_INFO_CALIBBIAS),   \
> -		.scan_index = _index,                                 \
> -		.scan_type = {                                        \
> -				.sign = 's',                          \
> -				.realbits = 16,                       \
> -				.storagebits = 16,                    \
> -				.shift = 0,                           \
> -				.endianness = IIO_BE,                 \
> -			     },                                       \
> -		.ext_info = inv_ext_info,                             \
> +static const struct iio_event_spec inv_accel_events[] = {
> +	{
> +		.type = IIO_EV_TYPE_MAG_ADAPTIVE,
> +		.dir = IIO_EV_DIR_RISING,
> +		.mask_shared_by_type = BIT(IIO_EV_INFO_ENABLE) |
> +				       BIT(IIO_EV_INFO_VALUE),
> +	},
> +};
> +
> +#define INV_MPU6050_CHAN(_type, _channel2, _index, _events, _events_nb) \
> +	{                                                               \
> +		.type = _type,                                          \
> +		.modified = 1,                                          \
> +		.channel2 = _channel2,                                  \
> +		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),   \
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	        \
> +				      BIT(IIO_CHAN_INFO_CALIBBIAS),     \
> +		.event_spec = _events,                                  \
> +		.num_event_specs = _events_nb,                          \
> +		.scan_index = _index,                                   \
> +		.scan_type = {                                          \
> +				.sign = 's',                            \
Maybe take opportunity to tidy up these intents. One tab is enough.
			.sign = 's',

> +				.realbits = 16,                         \
> +				.storagebits = 16,                      \
> +				.shift = 0,                             \
> +				.endianness = IIO_BE,                   \
> +			     },                                         \
		},
> +		.ext_info = inv_ext_info,                               \
>  	}



  reply	other threads:[~2024-03-03 16:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-25 16:00 [PATCH 0/4] Add WoM feature as an IIO event inv.git-commit
2024-02-25 16:00 ` [PATCH 1/4] iio: imu: inv_mpu6050: add WoM (Wake-on-Motion) sensor inv.git-commit
2024-03-03 16:56   ` Jonathan Cameron
2024-03-04 10:57     ` Jean-Baptiste Maneyrol
2024-02-25 16:00 ` [PATCH 2/4] iio: imu: inv_mpu6050: add WoM event inside accel channels inv.git-commit
2024-03-03 16:58   ` Jonathan Cameron [this message]
2024-02-25 16:00 ` [PATCH 3/4] iio: imu: inv_mpu6050: add new interrupt handler for WoM events inv.git-commit
2024-03-03 17:10   ` Jonathan Cameron
2024-03-04 11:11     ` Jean-Baptiste Maneyrol
2024-03-09 17:38       ` Jonathan Cameron
2024-02-25 16:00 ` [PATCH 4/4] iio: imu: inv_mpu6050: add WoM suspend wakeup with low-power mode inv.git-commit
2024-03-03 16:44 ` [PATCH 0/4] Add WoM feature as an IIO event Jonathan Cameron
2024-03-04 10:50   ` Jean-Baptiste Maneyrol

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=20240303165834.4db9ffdc@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=inv.git-commit@tdk.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.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