devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
Cc: Xander Huff <xander.huff-acOepvfBmUk@public.gmane.org>,
	lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org,
	knaack.h-Mmb7MZpHnFY@public.gmane.org,
	pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ben.shelton-acOepvfBmUk@public.gmane.org,
	joe.hershberger-acOepvfBmUk@public.gmane.org
Subject: Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
Date: Sun, 14 Jun 2015 12:20:31 +0100	[thread overview]
Message-ID: <557D637F.8090206@kernel.org> (raw)
In-Reply-To: <20150608134914.GF633-ew3lsbMjNqt5wtABiV/Xjqyly8cj88Ttqxv4g6HH51o@public.gmane.org>

On 08/06/15 14:49, Josh Cartwright wrote:
> On Sun, Jun 07, 2015 at 05:49:26PM +0100, Jonathan Cameron wrote:
>> On 20/05/15 16:22, Xander Huff wrote:
>>> To better facilitate user-mode access to optional aux channels, allow
>>> device trees to specify a custom label for defined channels.
>>>
>>> Signed-off-by: Xander Huff <xander.huff-acOepvfBmUk@public.gmane.org>
>>> Reviewed-by: Joe Hershberger <joe.hershberger-acOepvfBmUk@public.gmane.org>
>>> Reviewed-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
>>> ---
>>>  drivers/iio/adc/xilinx-xadc-core.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
>>> index ce93bd8..bda4241 100644
>>> --- a/drivers/iio/adc/xilinx-xadc-core.c
>>> +++ b/drivers/iio/adc/xilinx-xadc-core.c
>>> @@ -1119,6 +1119,9 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np,
>>>  			if (ret || reg > 16)
>>>  				continue;
>>>  
>>> +			of_property_read_string(child, "label",
>>> +						&chan->extend_name);
>>> +
>>>  			if (of_property_read_bool(child, "xlnx,bipolar"))
>>>  				chan->scan_type.sign = 's';
>>>  
>>>
>> I think what Lars was suggesting was a change to the IIO side of this rather than
>> just changing the device tree binding.
> 
> I'm not so sure.  His observation was just that the typical name of
> these properties is 'label', which I think makes sense and is commonly
> used.
> 
> Naming things is hard.
> 
> Perhaps, though, an improvement may be made if we lifted this out of the
> xadc driver and moved it into the IIO core (I can't imagine that this
> driver is the only one representing each channel with a separate node in
> DT).
> 
>> Perhaps an additional per channel attribute called _label which would
>> allow for board specific labelling?
> 
> This would seem a bit odd in DT-land; if a user wanted a different label
> name for their board, they would just rename it in their device tree for
> that board.  Fortunately, with the structured dtsi include files, this
> is pretty painless to do.
I don't really mind how it is done.  From a userspace point of view in IIO
though I think these belong in their own attribute rather than in the naming
of the attributes. The extended name stuff just makes for really hideous
userspace code!

Hence you could use the device tree node naming to provide it, or some other
means, but I'd like to have it provided to userspace as say

in_voltage0_label which when read provides the name as a straightforward string.

This would obviously want to be provided by the IIO core.

As for moving the per channel DT node stuff into the IIO core, at this point
there are a few drivers doing it, but far from all, so the best bet would be
a utility function to help the drivers handle the manipulation rather than
direct support in the core.

Jonathan
> 
>   Josh
> 

  parent reply	other threads:[~2015-06-14 11:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 22:44 [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property Xander Huff
     [not found] ` <1431038644-41600-1-git-send-email-xander.huff-acOepvfBmUk@public.gmane.org>
2015-05-07 22:44   ` [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels Xander Huff
     [not found]     ` <1431038644-41600-2-git-send-email-xander.huff-acOepvfBmUk@public.gmane.org>
2015-05-19 17:53       ` Lars-Peter Clausen
     [not found]         ` <555B78A3.2030202-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2015-05-20 15:22           ` [PATCH v2 1/2] devicetree: xilinx-xadc: Add optional label property Xander Huff
     [not found]             ` <1432135352-29848-1-git-send-email-xander.huff-acOepvfBmUk@public.gmane.org>
2015-05-20 15:22               ` [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels Xander Huff
     [not found]                 ` <1432135352-29848-2-git-send-email-xander.huff-acOepvfBmUk@public.gmane.org>
2015-06-07 16:49                   ` Jonathan Cameron
     [not found]                     ` <55747616.1010901-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-06-08 13:49                       ` Josh Cartwright
     [not found]                         ` <20150608134914.GF633-ew3lsbMjNqt5wtABiV/Xjqyly8cj88Ttqxv4g6HH51o@public.gmane.org>
2015-06-14 11:20                           ` Jonathan Cameron [this message]
2015-05-23 11:23           ` [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name " Jonathan Cameron
2015-05-26  9:38             ` Lars-Peter Clausen
     [not found]               ` <55643F20.4080306-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2015-05-26 19:05                 ` Xander Huff
2015-05-08 18:43   ` [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property Jonathan Cameron

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=557D637F.8090206@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=ben.shelton-acOepvfBmUk@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=joe.hershberger-acOepvfBmUk@public.gmane.org \
    --cc=joshc-acOepvfBmUk@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org \
    --cc=xander.huff-acOepvfBmUk@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).