* [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4
@ 2025-08-11 18:32 David Lechner
2025-08-11 19:07 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: David Lechner @ 2025-08-11 18:32 UTC (permalink / raw)
To: Michael Hennerich, Nuno Sá, David Lechner, Jonathan Cameron,
Andy Shevchenko, Angelo Dureghello
Cc: Jonathan Cameron, linux-iio, linux-kernel
Add max_conversion_rate_hz to the chip info for "adaq4381-4". Without
this, the driver fails to probe because it tries to set the initial
sample rate to 0 Hz, which is not valid.
Fixes: bbeaec81a03e ("iio: ad7380: add support for SPI offload")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/ad7380.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/adc/ad7380.c b/drivers/iio/adc/ad7380.c
index 6f7034b6c266bd6075e0e2fd8d567c4490171e7b..fa251dc1aae6ab0a0d36792fa37b2cc22b99dfe6 100644
--- a/drivers/iio/adc/ad7380.c
+++ b/drivers/iio/adc/ad7380.c
@@ -873,6 +873,7 @@ static const struct ad7380_chip_info adaq4381_4_chip_info = {
.has_hardware_gain = true,
.available_scan_masks = ad7380_4_channel_scan_masks,
.timing_specs = &ad7380_4_timing,
+ .max_conversion_rate_hz = 4 * MEGA,
};
static const struct spi_offload_config ad7380_offload_config = {
---
base-commit: 80e8c3730645f6e097a79e99e658201530bc2881
change-id: 20250811-iio-adc-ad7380-fix-missing-max_conversion_rate_hs-on-ad4381-4-98e314112d71
Best regards,
--
David Lechner <dlechner@baylibre.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4
2025-08-11 18:32 [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4 David Lechner
@ 2025-08-11 19:07 ` Andy Shevchenko
2025-08-11 19:18 ` David Lechner
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-08-11 19:07 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Nuno Sá, Jonathan Cameron,
Andy Shevchenko, Angelo Dureghello, Jonathan Cameron, linux-iio,
linux-kernel
On Mon, Aug 11, 2025 at 8:32 PM David Lechner <dlechner@baylibre.com> wrote:
>
> Add max_conversion_rate_hz to the chip info for "adaq4381-4". Without
> this, the driver fails to probe because it tries to set the initial
> sample rate to 0 Hz, which is not valid.
...
> + .max_conversion_rate_hz = 4 * MEGA,
MEGA --> HZ_PER_MHZ
With that done
Reviewed-by: Andy Shevchenko <andy@kernel.org>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4
2025-08-11 19:07 ` Andy Shevchenko
@ 2025-08-11 19:18 ` David Lechner
2025-08-11 19:22 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: David Lechner @ 2025-08-11 19:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Michael Hennerich, Nuno Sá, Jonathan Cameron,
Andy Shevchenko, Angelo Dureghello, Jonathan Cameron, linux-iio,
linux-kernel
On 8/11/25 2:07 PM, Andy Shevchenko wrote:
> On Mon, Aug 11, 2025 at 8:32 PM David Lechner <dlechner@baylibre.com> wrote:
>>
>> Add max_conversion_rate_hz to the chip info for "adaq4381-4". Without
>> this, the driver fails to probe because it tries to set the initial
>> sample rate to 0 Hz, which is not valid.
>
> ...
>
>> + .max_conversion_rate_hz = 4 * MEGA,
>
> MEGA --> HZ_PER_MHZ
If we do this, we should fix up all of the other similar ones
in a separate patch. So I would leave this patch as-is.
>
> With that done
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4
2025-08-11 19:18 ` David Lechner
@ 2025-08-11 19:22 ` Andy Shevchenko
2025-08-16 13:33 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-08-11 19:22 UTC (permalink / raw)
To: David Lechner
Cc: Michael Hennerich, Nuno Sá, Jonathan Cameron,
Andy Shevchenko, Angelo Dureghello, Jonathan Cameron, linux-iio,
linux-kernel
On Mon, Aug 11, 2025 at 9:18 PM David Lechner <dlechner@baylibre.com> wrote:
> On 8/11/25 2:07 PM, Andy Shevchenko wrote:
> > On Mon, Aug 11, 2025 at 8:32 PM David Lechner <dlechner@baylibre.com> wrote:
...
> >> + .max_conversion_rate_hz = 4 * MEGA,
> >
> > MEGA --> HZ_PER_MHZ
>
> If we do this, we should fix up all of the other similar ones
> in a separate patch. So I would leave this patch as-is.
Will it happen sooner?
> > With that done
> > Reviewed-by: Andy Shevchenko <andy@kernel.org>
I leave this to Jonathan because in spite of being a fix I still think
it's better to use an appropriate multiplier (also note, MEGA appeared
in the kernel much later than HZ_PER_* constants, which sounds in my
favour).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4
2025-08-11 19:22 ` Andy Shevchenko
@ 2025-08-16 13:33 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-08-16 13:33 UTC (permalink / raw)
To: Andy Shevchenko
Cc: David Lechner, Michael Hennerich, Nuno Sá, Andy Shevchenko,
Angelo Dureghello, Jonathan Cameron, linux-iio, linux-kernel
On Mon, 11 Aug 2025 21:22:28 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Mon, Aug 11, 2025 at 9:18 PM David Lechner <dlechner@baylibre.com> wrote:
> > On 8/11/25 2:07 PM, Andy Shevchenko wrote:
> > > On Mon, Aug 11, 2025 at 8:32 PM David Lechner <dlechner@baylibre.com> wrote:
>
> ...
>
> > >> + .max_conversion_rate_hz = 4 * MEGA,
> > >
> > > MEGA --> HZ_PER_MHZ
> >
> > If we do this, we should fix up all of the other similar ones
> > in a separate patch. So I would leave this patch as-is.
>
> Will it happen sooner?
>
> > > With that done
> > > Reviewed-by: Andy Shevchenko <andy@kernel.org>
>
> I leave this to Jonathan because in spite of being a fix I still think
> it's better to use an appropriate multiplier (also note, MEGA appeared
> in the kernel much later than HZ_PER_* constants, which sounds in my
> favour).
>
I'll take this as is. A future tidy up might switch them all over.
I've always been in two minds as to whether the unit specific ones
are helpful for this case where one of the scales is 1.
Applied to the fixes-togreg branch of iio.git.
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-16 13:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 18:32 [PATCH] iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4 David Lechner
2025-08-11 19:07 ` Andy Shevchenko
2025-08-11 19:18 ` David Lechner
2025-08-11 19:22 ` Andy Shevchenko
2025-08-16 13:33 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).