Hello, On Sat, Mar 15, 2025 at 02:18:40PM +0100, David Heidelberg wrote: > On 14/03/2025 21:57, Sakari Ailus wrote: > > Thanks for converting this to YAML. > > > > On Fri, Mar 14, 2025 at 08:58:27PM +0100, David Heidelberg via B4 Relay wrote: > > > From: David Heidelberg <david@xxxxxxx> > > > > > > Convert the Analog Devices ad5820 to DT schema format. > > > > > > Add the previously undocumented io-channel-cells property, > > > which can be omitted. If present, it must be set to 0, > > > as the device provides only one channel. > > > > What's the purpose of this property? The driver doesn't use it nor I think > > it provides any information on the hardware either. The above description > > also appears to be saying it's redundant. > > Hello Sakari, > > from my understanding, you're right. > > I would prefer to drop it, see [1]. > > Anyway from reading of documentation I understood it may be right to have > the property empty, but also may be omitted. I saw both approaches in the > code. > > If you choose not liking this redudancy, I push [1] and drop the property > here. > > David > > [1] https://patchwork.kernel.org/project/linux-omap/patch/20250213203208.93316-1-david@xxxxxxx/ Like all DT properties starting with #, this is not about hardware, but about parsing the device tree itself and used by core DT code: $ git grep io-channels drivers/of/property.c drivers/of/property.c:DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells") Have a look at the following example DT: iio_device1: iio-provider1 { #io-channel-cells = <2>; }; iio_device2: iio-provider2 { #io-channel-cells = <1>; }; iio_device3: iio-provider3 { #io-channel-cells = <0>; }; example-iio-user { my-iio-reference = <&iio_device1 AREA0 CHANNEL2>, <&iio_device3>, <&iio_device2 CHAN0>; }; While you can easily understand that without the io-channel-cells, please have a look what it looks like after sending it through the DT compiler. You will get something like this: iio-provider1 { #io-channel-cells = <2>; phandle = <23>; }; iio-provider2 { #io-channel-cells = <1>; phandle = <10>; }; iio-provider3 { #io-channel-cells = <0>; phandle = <37>; }; example-iio-user { my-iio-reference = <23 42 13 37 10 0>; }; But you can safely drop it, when there are no references to the IIO device. So it's obviously not required in all cases. I hope I could explain the purpose well enough :) Greetings, -- Sebastian
Attachment:
signature.asc
Description: PGP signature