From: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "Vesa Jääskeläinen"
<dachaac-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Lars-Peter Clausen"
<lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: IIO device indexing issue
Date: Fri, 06 Nov 2015 10:49:49 +0100 [thread overview]
Message-ID: <5517276.dg3z7SpAvu@adelgunde> (raw)
In-Reply-To: <563BAA65.3020609-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3369 bytes --]
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> 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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-11-06 9:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5637AFC5.7080007@gmail.com>
[not found] ` <5637AFC5.7080007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-04 9:38 ` IIO device indexing issue Lars-Peter Clausen
[not found] ` <5639D22D.3050901-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2015-11-04 18:53 ` Vesa Jääskeläinen
[not found] ` <563A5412.4030102-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-05 1:25 ` Phil Reid
[not found] ` <563AB014.4030401-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2015-11-05 5:24 ` Phil Reid
2015-11-05 19:13 ` Jonathan Cameron
[not found] ` <563BAA65.3020609-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-06 9:49 ` Markus Pargmann [this message]
2015-11-07 9:03 ` Vesa Jääskeläinen
[not found] ` <563DBE5E.6060307-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-09 10:33 ` Markus Pargmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5517276.dg3z7SpAvu@adelgunde \
--to=mpa-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=dachaac-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).