[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241123150101.1c5ce5c8@jic23-huawei>
Date: Sat, 23 Nov 2024 15:01:01 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Lars-Peter Clausen <lars@...afoo.de>, Michael Hennerich
<Michael.Hennerich@...log.com>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] iio: adc: ad7124: Don't create more channels than
the hardware is capable of
On Mon, 11 Nov 2024 08:21:45 -0600
David Lechner <dlechner@...libre.com> wrote:
> On 11/11/24 6:08 AM, Uwe Kleine-König wrote:
> > [dropped Mircea Caprioru from Cc: as their address bounces.]
> >
> > Hello David,
> >
> > On Fri, Nov 08, 2024 at 12:52:35PM -0600, David Lechner wrote:
> >> On 11/8/24 12:18 PM, Uwe Kleine-König wrote:
> >>> The ad7124-4 and ad7124-8 both support 16 channel registers. Don't
> >>> accept more (logical) channels from dt than that.
> >>
> >> Why should the devicetree be limited by the number of channel
> >> registers? Channel registers are a resource than can be
> >> dynamically assigned, so it doesn't seem like the devicetree
> >> should be specifying that assignment.
> >
> > Note the device tree isn't limited as I didn't adapt the binding. It's
> > just that the driver doesn't bind if too many channels are specified.
> > And while your statement about the channels being a dynamic resource is
> > right, currently the driver doesn't cope and allocates resources
> > statically, and happily assumes there is a CHANNEL_16 register if the
> > device tree specifies 17 (or more) logical channels and writes to
> > CONFIG_0 then which very likely results in strange effects.
> >
> > So as long as the driver doesn't implement this (possible) dynamic
> > mapping to the CHANNEL registers, it's IMHO right to refuse to bind (or
> > alternatively only use the 16 first logical channels).
> >
> > Best regards
> > Uwe
>
> Understood. It would be nice to implement such dynamic allocation
> in the future but as a fix to backport to stable kernels, this makes
> sense.
Agreed. We do have other drivers that have internal allocators
for constrained sequencer resources, but they are complex so not
fix material!
Jonathan
Powered by blists - more mailing lists