Re: IIO device indexing issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

On Thursday, November 05, 2015 07:13:41 PM Jonathan Cameron wrote:
> On 04/11/15 18:53, Vesa Jääskeläinen wrote:
> > To continue from this "label" property idea I was wondering if we
> > would add it as new optional(?) file node for IIO devices.> 
> > One could then specify it like:
> > 
> > tscadc: tscadc@44e0d000 {
> >     compatible = "ti,am3359-tscadc";
> > ...
> >     am335x_adc: adc {
> >         compatible = "ti,am3359-adc";
> > ...
> >         label = "Port A";
> >     };
> > };
> > 
> > And this would generate file /sys/bus/iio/iio:deviceX/label with
> > contents of "Port A".
> > 
> > Then during the application startup it would just need to scan all
> > devices under /sys/bus/iio and determine what labelled device it
> > wants to use.
> > 
> > It would be up to device's developer to determine what labels to use
> > in their designs. This would not break ABI and would be just an
> > extension for it.
> > 
> > One could also auto-assign label "am335x_adc" in this case too. But
> > if you include existing arch device tree then changing label in top
> > level is kinda a bit annoying as you would then need to duplicate all
> > properties with another label and disable arch device tree's
> > settings. Could cause also conflict if there are references elsewhere
> > to existing arch nodes.
> > 
> > Having following in device's device tree file would allow one to
> > override label or just only specify that.
> > 
> > #include "am33xx.dtsi"
> > 
> > &tscadc {
> >     status = "okay";
> > 
> >     adc {
> >         ti,adc-channels = <4 5 6 7>;
> > 
> >         label = "Port A";
> >     };
> > };
> > 
> > I think this "label" model would be simple to understand.
> > 
> > Whether this needs to be implemented as per device driver feature or
> > could be implemented as generic IIO functionality I do not know.
> The principal looks good to me.  It's not however only an IIO issue
> so perhaps we should expand the discussion to include other subsystems
> likely to have similar issues (though perhaps to a lesser degree) such as
> hwmon and input?  Any others?
> 
> We could also autobuild the label from other sources such as ACPI
> to uniquely describe the instance of the device (afterall all we really
> care about is that it always has the same name on the same hardware, 
> being able to assign meaningful simple names would just be the icing
> on the cake!)

There is a similar discussion for the new character device GPIO interface.[1]

Simple labels have the problem that they could be the same for two devicetree
overlays or chips that are connected via SPI.

Best Regards,

Markus


[1] http://thread.gmane.org/gmane.linux.kernel.gpio/11475

> 
> Jonathan
> > Thanks,
> > Vesa Jääskeläinen
> > 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux