Re: [PATCH v2] iio: imu: inv_icm42600: add buffer hwfifo watermark attributes
From: Andy Shevchenko
Date: Wed Jun 24 2026 - 07:48:22 EST
On Wed, Jun 24, 2026 at 10:25:46AM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:
> Add hwfifo_watermark/min/max/enabled buffer attributes.
> Hardware FIFO is always enabled and used.
...
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
> #include <linux/pm_runtime.h>
> #include <linux/regmap.h>
> #include <linux/delay.h>
> +#include <linux/stringify.h>
>
> #include <linux/iio/buffer.h>
> #include <linux/iio/common/inv_sensors_timestamp.h>
> #include <linux/iio/iio.h>
> +#include <linux/iio/sysfs.h>
Since I have another comment below, I would note that the list of inclusions
perhaps needs a preparatory patch to be sorted and regrouped a bit:
<linux/*.h>
...blank line...
<linux/iio/*.h>
...blank line...
<linux/iio/common/inv_*.h> // since it's quite custom but world visible header.
...blank line...
"*.h"
...
> +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1");
> +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max,
> + __stringify(INV_ICM42600_FIFO_WATERMARK_MAX_SAMPLES));
> +static IIO_DEVICE_ATTR(hwfifo_watermark, 0444, inv_icm42600_buffer_get_watermark,
> + NULL, 0);
So, why not IIO_DEVICE_ATTR_RO()?
> +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_enabled, "1");
--
With Best Regards,
Andy Shevchenko