Devicetree
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: "Michael Hennerich" <michael.hennerich@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Petre Rodan" <petre.rodan@subdimension.ro>,
	"Jorge Marques" <jorge.marques@analog.com>,
	"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] iio: accel: adxl372: introduce chip_info structure
Date: Fri, 13 Mar 2026 16:01:16 +0200	[thread overview]
Message-ID: <abQYrLTQvceBCalD@ashevche-desk.local> (raw)
In-Reply-To: <20260313115525.85435-2-antoniu.miclaus@analog.com>

On Fri, Mar 13, 2026 at 01:54:54PM +0200, Antoniu Miclaus wrote:
> Introduce a chip_info structure to parameterize device-specific
> properties such as ODR/bandwidth frequency tables, activity/inactivity
> timer scale factors, and the maximum ODR value. This refactors the
> driver to use chip_info lookups instead of hardcoded values, preparing
> the driver to support multiple device variants.
> 
> The sampling_frequency and filter_low_pass_3db_frequency available
> attributes are switched from custom sysfs callbacks to read_avail()
> based handling via info_mask_shared_by_type_available. This enforces
> consistent formatting through the IIO framework and makes the values
> accessible to in-kernel consumers.
> 
> The SPI/I2C probe functions are updated to pass a chip_info pointer
> instead of a device name string.
> 
> No functional change intended.

...

> enum adxl372_odr {

>  	ADXL372_ODR_1600HZ,
>  	ADXL372_ODR_3200HZ,
>  	ADXL372_ODR_6400HZ,
> +	ADXL372_ODR_NUM,

No comma for the terminator entry.

>  };

...

> static const struct iio_event_spec adxl372_events[] = {

>  	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |		\
>  				    BIT(IIO_CHAN_INFO_SAMP_FREQ) |	\
>  		BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY),	\

Consider at some point making the above consistent by style with the below

	.info_mask_shared_by_type =
		BIT(IIO_CHAN_INFO_SCALE) |				\
		BIT(IIO_CHAN_INFO_SAMP_FREQ) |				\
		BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY),	\

> +	.info_mask_shared_by_type_available =				\
> +		BIT(IIO_CHAN_INFO_SAMP_FREQ) |				\
> +		BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY),	\
>  	.scan_index = index,						\

>  };

...

> +	chip_info = i2c_get_match_data(client);

> +	if (!chip_info)
> +		return -ENODEV;

It is an agreement to avoid adding a dead code such as above check.

...

> +	chip_info = spi_get_device_match_data(spi);
> +	if (!chip_info)
> +		return -ENODEV;

Ditto.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-13 14:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 11:54 [PATCH v3 0/4] iio: accel: adxl372: add ADXL371 support Antoniu Miclaus
2026-03-13 11:54 ` [PATCH v3 1/4] iio: accel: adxl372: introduce chip_info structure Antoniu Miclaus
2026-03-13 14:01   ` Andy Shevchenko [this message]
2026-03-13 11:54 ` [PATCH v3 2/4] dt-bindings: iio: accel: adi,adxl372: add ADXL371 compatible Antoniu Miclaus
2026-03-13 11:54 ` [PATCH v3 3/4] iio: accel: adxl372: factor out buffer and trigger setup Antoniu Miclaus
2026-03-13 14:03   ` Andy Shevchenko
2026-03-13 11:54 ` [PATCH v3 4/4] iio: accel: adxl372: add support for ADXL371 Antoniu Miclaus
2026-03-13 14:05   ` Andy Shevchenko

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=abQYrLTQvceBCalD@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=jorge.marques@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=michael.hennerich@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=petre.rodan@subdimension.ro \
    --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