mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@kernel.org>
Cc: radu.sabau@analog.com, Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Nuno Sa <nuno.sa@analog.com>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Antoniu Miclaus <antoniu.miclaus@analog.com>,
	Robert Budai <robert.budai@analog.com>,
	Ramona Gradinariu <ramona.gradinariu@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux@analog.com
Subject: Re: [PATCH v6 5/8] iio: imu: Add driver for the ADI ADIS16607
Date: Sat, 14 Nov 2026 00:52:55 +0000	[thread overview]
Message-ID: <20261114005255.0b64ec92@jic23-hlaptop> (raw)
In-Reply-To: <20261113-adis16607-v6-5-3f678719942a@analog.com>

On Fri, 13 Nov 2026 14:33:35 +0200
Radu Sabau via B4 Relay <devnull+radu.sabau.analog.com@kernel.org> wrote:

> From: Radu Sabau <radu.sabau@analog.com>
> 
> The ADIS16607 is a Precision MEMS IMU from Analog Devices with
> triaxial gyroscope and accelerometer, delta angle/velocity, and
> temperature channels, communicating over a custom SPI Half-Duplex
> protocol. ADIS16607-2 has a ±450°/s gyroscope range, ADIS16607-3
> ±2000°/s; both share a ±40g accelerometer range and an 8 kHz internal
> clock.
> 
> This is the base driver: probe, raw channel reads, sampling-frequency
> control, startup/self-test via adislib, and debugfs identity entries.
> No buffered capture, external clock sync, or calibration bias yet -
> those follow in later patches.
> 
> Self-test leaves the device's SELF_TEST register cleared on every exit
> path, not just on success, so a read failure or a failed delta check
> doesn't leave the sensor stuck in its self-test/force state until the
> next reset.
> 
> Signed-off-by: Radu Sabau <radu.sabau@analog.com>


The chan_spec in here includes buffer related stuff (scan index and
the channel type bit) + the timestamp channel in general. That should
all have been introduced in the next patch.  Thus feedback on that
patch isn't contained and I've dropped this one for now.


> diff --git a/drivers/iio/imu/adis16607.c b/drivers/iio/imu/adis16607.c
> new file mode 100644
> index 000000000000..f5dc37c54191
> --- /dev/null
> +++ b/drivers/iio/imu/adis16607.c

> +/*
> + * .address indexes adis16607_chan_regs[], .scan_index is the buffer position;
> + * both come from the same enum today but are separate fields on purpose.
> + */
> +#define ADIS16607_MOD_CHAN(_type, _mod, _idx)				       \
> +	{								       \
> +		.type = (_type),					       \
> +		.modified = 1,						       \
> +		.channel2 = (_mod),					       \
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),		       \
> +		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),	       \
> +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),       \
> +		.address = (_idx),					       \
> +		.scan_index = (_idx),					       \
> +		.scan_type = {						       \
> +			.sign = 's',					       \
> +			.realbits = 24,					       \
> +			.storagebits = 32,				       \
> +			.endianness = IIO_BE,				       \
> +		},							       \
> +	}
> +
> +#define ADIS16607_ACCEL_CHANNEL(_mod)					       \
> +	ADIS16607_MOD_CHAN(IIO_ACCEL, IIO_MOD_ ## _mod,			       \
> +			   ADIS16607_SCAN_ACCEL_ ## _mod)
> +
> +#define ADIS16607_GYRO_CHANNEL(_mod)					       \
> +	ADIS16607_MOD_CHAN(IIO_ANGL_VEL, IIO_MOD_ ## _mod,		       \
> +			   ADIS16607_SCAN_GYRO_ ## _mod)
> +
> +#define ADIS16607_MOD_CHAN_DELTA(_type, _mod, _idx)			       \
> +	{								       \
> +		.type = (_type),					       \
> +		.modified = 1,						       \
> +		.channel2 = (_mod),					       \
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),		       \
> +		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),	       \
> +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),       \
> +		.address = (_idx),					       \
> +		.scan_index = (_idx),					       \
> +		.scan_type = {						       \
> +			.sign = 's',					       \
> +			.realbits = 24,					       \
> +			.storagebits = 32,				       \
> +			.endianness = IIO_BE,				       \
> +		},							       \
> +	}
> +
> +#define ADIS16607_DELTANG_CHAN(_mod)					       \
> +	ADIS16607_MOD_CHAN_DELTA(IIO_DELTA_ANGL, IIO_MOD_ ## _mod,	       \
> +				 ADIS16607_SCAN_DELTANG_ ## _mod)
> +
> +#define ADIS16607_DELTVEL_CHAN(_mod)					       \
> +	ADIS16607_MOD_CHAN_DELTA(IIO_DELTA_VELOCITY, IIO_MOD_ ## _mod,	       \
> +				 ADIS16607_SCAN_DELTVEL_ ## _mod)
> +
> +static const struct iio_chan_spec adis16607_channels[] = {
> +	ADIS16607_ACCEL_CHANNEL(X),
> +	ADIS16607_ACCEL_CHANNEL(Y),
> +	ADIS16607_ACCEL_CHANNEL(Z),
> +	ADIS16607_GYRO_CHANNEL(X),
> +	ADIS16607_GYRO_CHANNEL(Y),
> +	ADIS16607_GYRO_CHANNEL(Z),
> +	ADIS16607_DELTVEL_CHAN(X),
> +	ADIS16607_DELTVEL_CHAN(Y),
> +	ADIS16607_DELTVEL_CHAN(Z),
> +	ADIS16607_DELTANG_CHAN(X),
> +	ADIS16607_DELTANG_CHAN(Y),
> +	ADIS16607_DELTANG_CHAN(Z),
> +	{
> +		.type = IIO_TEMP,
> +		.indexed = 1,
> +		.channel = 0,
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> +				      BIT(IIO_CHAN_INFO_SCALE) |
> +				      BIT(IIO_CHAN_INFO_OFFSET),
> +		.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
> +		.address = ADIS16607_SCAN_TEMP,
> +		.scan_index = ADIS16607_SCAN_TEMP,
> +		.scan_type = {
> +			.sign = 's',
> +			.realbits = 16,
> +			.storagebits = 16,
> +			.endianness = IIO_BE,
> +		},
> +	},
> +	IIO_CHAN_SOFT_TIMESTAMP(ADIS16607_SCAN_MAX),

Should not be here and the channels above should not 'yet' hvae
scan_type or scan_index.  Those belong in the patch adding buffered support.


> +};

  reply	other threads:[~2026-11-14  0:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 12:33 [PATCH v6 0/8] iio: imu: Add support " Radu Sabau via B4 Relay
2026-11-13 12:33 ` [PATCH v6 1/8] iio: imu: adis: Fix custom reset dispatch in adislib Radu Sabau via B4 Relay
2026-11-13 12:33 ` [PATCH v6 2/8] iio: imu: adis: Add optional self_test callback Radu Sabau via B4 Relay
2026-11-13 12:33 ` [PATCH v6 3/8] iio: imu: adis: Add optional init callback Radu Sabau via B4 Relay
2026-11-13 12:33 ` [PATCH v6 4/8] dt-bindings: iio: imu: Add bindings for ADI ADIS16607 Radu Sabau via B4 Relay
2026-11-13 12:33 ` [PATCH v6 5/8] iio: imu: Add driver for the " Radu Sabau via B4 Relay
2026-11-14  0:52   ` Jonathan Cameron [this message]
2026-11-13 12:33 ` [PATCH v6 6/8] iio: imu: adis16607: Add FIFO-based buffered capture Radu Sabau via B4 Relay
2026-11-13 14:48   ` Sabau, Radu bogdan
2026-11-14  0:57   ` Jonathan Cameron
2026-11-13 12:33 ` [PATCH v6 7/8] iio: imu: adis16607: Add external clock sync support Radu Sabau via B4 Relay
2026-11-13 12:33 ` [PATCH v6 8/8] iio: imu: adis16607: Add calibration bias support for gyro/accel Radu Sabau via B4 Relay
2026-11-13 12:41 ` [PATCH v6 0/8] iio: imu: Add support for the ADI ADIS16607 Sabau, Radu bogdan
2026-11-13 14:09   ` Andy Shevchenko
2026-11-14  0:21     ` Jonathan Cameron
2026-11-14  0:25 ` Jonathan Cameron
2026-11-14  0:49   ` Jonathan Cameron

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=20261114005255.0b64ec92@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+radu.sabau.analog.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=radu.sabau@analog.com \
    --cc=ramona.gradinariu@analog.com \
    --cc=robert.budai@analog.com \
    --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

all inboxes | Powered by JetHome®