[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241019161855.32078709@jic23-huawei>
Date: Sat, 19 Oct 2024 16:18:55 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Nuno Sá <noname.nuno@...il.com>
Cc: David Lechner <dlechner@...libre.com>, Angelo Dureghello
<adureghello@...libre.com>, Nuno Sá <nuno.sa@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>, Michael Hennerich
<Michael.Hennerich@...log.com>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Olivier
Moysan <olivier.moysan@...s.st.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, Mark Brown
<broonie@...nel.org>
Subject: Re: [PATCH v6 7/8] iio: dac: ad3552r: add high-speed platform
driver
> > >
> > > >
> > > > Re: the other recent discussions about getting too many
> > > > callbacks. Instead of a dedicated function like this, we
> > > > could make a set of generic functions:
> > > >
> > > > iio_backend_{g,s}et_property_{s,u}(8, 16, 32, 64}()
> > > >
> > >
> > > Hmm interesting approach. I don't dislike it. Kind of a generic getter/setter
> > > thingy.
> > > We could then still have optional inline helpers that would call the generic
> > > functions with the proper enum value.
> > >
> > > > that take an enum parameter for the property. This way,
> > > > for each new property, we just have to add an enum member
> > > > instead of creating a get/set callback pair.
> > > >
> > > > Unrelated to this particular case, but taking the idea even
> > > > farther, we could also do the same with enable/disable
> > > > functions. We talked before about cutting the number of
> > > > callbacks in half by using a bool parameter instead of
> > > > separate enable/disable callbacks. But we could cut it down
> > > > even more by having an enum parameter for the thing we are
> > > > enabling/disabling.
> > >
> > > If we don't get too strict about types it could even fall into the above u8
> > > category.
> > >
> > > Instead of lot of new simple ops we just grow an enum.
> >
> > Sure. For that matter, maybe try to just stick with 32-bit
> > for everything to keep it simple. Probably will eventually
> > need 64-bit for some things, but might be able to get away
> > with avoiding 8 and 16-bit.
> >
>
> Agreed. Anyways, nothing that I will take care in the near future (I would first like
> for things to stabilize a bit). That said, if you want (or anybody else), feel free
> to send the patches :)
Definitely don't do the many size versions. Large signed integers
are nice and flexible. Maybe just go s64 from the start.
Jonathan
>
> - Nuno Sá
>
Powered by blists - more mailing lists