diff mbox

[1/2] devicetree: xilinx-xadc: Add optional xlnx, extend-name property

Message ID 1431038644-41600-1-git-send-email-xander.huff@ni.com
State New, archived
Headers show

Commit Message

Xander Huff May 7, 2015, 10:44 p.m. UTC
To better facilitate user-mode access to optional aux channels, allow
device trees to specify a custom extended name for defined channels.

Signed-off-by: Xander Huff <xander.huff@ni.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Josh Cartwright <joshc@ni.com>
--
Natinst-ReviewBoard-ID: 97119
---
 Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jonathan Cameron May 8, 2015, 6:43 p.m. UTC | #1
On 07/05/15 18:44, Xander Huff wrote:
> To better facilitate user-mode access to optional aux channels, allow
> device trees to specify a custom extended name for defined channels.
> 
> Signed-off-by: Xander Huff <xander.huff@ni.com>
> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
> Reviewed-by: Josh Cartwright <joshc@ni.com>
> --
> Natinst-ReviewBoard-ID: 97119
Interesting idea. I'd like to let this sit for a fair while to see what
comments it gets.  If it makes sense for this driver, it probably makes
sense for a lot of others.  As such we may well want to have a general
binding for this, rather than one for just this part.

Thanks,

Jonathan
> ---
>  Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt b/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
> index d71258e..4c5a60b 100644
> --- a/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
> @@ -68,6 +68,8 @@ Optional properties:
>  			  Note each channel number should only be used at most
>  			  once.
>  		Optional properties:
> +			* xlnx,extend-name: Custom extended name for the
> +			  channel.
>  			* xlnx,bipolar: If set the channel is used in bipolar
>  			  mode.
>  
> @@ -107,6 +109,7 @@ Examples:
>  			#size-cells = <0>;
>  			channel@0 {
>  				reg = <0>;
> +				xlnx,extend-name = "vin_v";
>  				xlnx,bipolar;
>  			};
>  		};
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lars-Peter Clausen May 19, 2015, 5:53 p.m. UTC | #2
On 05/08/2015 12:44 AM, Xander Huff wrote:
> To better facilitate user-mode access to optional aux channels, allow
> device trees to specify a custom extended name for defined channels.

Hi,

'extend-name' is kind of a IIO specific term. I think a better name in the 
devicetree context would be 'label'. That's used everywhere else when giving 
a short description string to a node.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonathan Cameron May 23, 2015, 11:23 a.m. UTC | #3
On 19/05/15 18:53, Lars-Peter Clausen wrote:
> On 05/08/2015 12:44 AM, Xander Huff wrote:
>> To better facilitate user-mode access to optional aux channels, allow
>> device trees to specify a custom extended name for defined channels.
> 
> Hi,
> 
> 'extend-name' is kind of a IIO specific term. I think a better name in the devicetree context would be 'label'. That's used everywhere else when giving a short description string to a node.
> 
Hi Lars,

What do you think of the general idea?  I'm unconvinced we want to do this in channel naming.
Perhaps we want an additional attribute giving access to this sort of 'semantic' information?

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lars-Peter Clausen May 26, 2015, 9:38 a.m. UTC | #4
On 05/23/2015 01:23 PM, Jonathan Cameron wrote:
> On 19/05/15 18:53, Lars-Peter Clausen wrote:
>> On 05/08/2015 12:44 AM, Xander Huff wrote:
>>> To better facilitate user-mode access to optional aux channels, allow
>>> device trees to specify a custom extended name for defined channels.
>>
>> Hi,
>>
>> 'extend-name' is kind of a IIO specific term. I think a better name in the devicetree context would be 'label'. That's used everywhere else when giving a short description string to a node.
>>
> Hi Lars,
>
> What do you think of the general idea?  I'm unconvinced we want to do this in channel naming.
> Perhaps we want an additional attribute giving access to this sort of 'semantic' information?

I'm not convinced about it either. My gut feeling is that this is not the 
right approach, but I don't really have any better ideas at the moment.

Xander can you give a short description of how this information will be used 
by an application? Would having a label property for the channel also work 
for you (e.g. in_voltage0_label)?

- Lars

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Xander Huff May 26, 2015, 7:05 p.m. UTC | #5
On 5/26/2015 4:38 AM, Lars-Peter Clausen wrote:
> On 05/23/2015 01:23 PM, Jonathan Cameron wrote:
>> On 19/05/15 18:53, Lars-Peter Clausen wrote:
>>> On 05/08/2015 12:44 AM, Xander Huff wrote:
>>>> To better facilitate user-mode access to optional aux channels, allow
>>>> device trees to specify a custom extended name for defined channels.
>>>
>>> Hi,
>>>
>>> 'extend-name' is kind of a IIO specific term. I think a better name in the
>>> devicetree context would be 'label'. That's used everywhere else when giving
>>> a short description string to a node.
>>>
>> Hi Lars,
>>
>> What do you think of the general idea?  I'm unconvinced we want to do this in
>> channel naming.
>> Perhaps we want an additional attribute giving access to this sort of
>> 'semantic' information?
>
> I'm not convinced about it either. My gut feeling is that this is not the right
> approach, but I don't really have any better ideas at the moment.
>
> Xander can you give a short description of how this information will be used by
> an application? Would having a label property for the channel also work for you
> (e.g. in_voltage0_label)?
>
> - Lars
>
We use 10 of the optional aux channels available in the XADC and have them wired 
up to specific power supplies. For example, channel 9 is connected to the 
current of a 6V power supply and channel 12 is connected to the voltage of that 
same supply, channel 4 is connected to the current of a 3.3V power supply and 
channel 5 is connected to its voltage.

Without adding extended names to distinguish these aux channels, the handles 
available inside /sys/bus/iio/devices/[device] are generic: in_voltage10_raw, 
in_voltage10_scale, for example. If I added the label 'user5v_v', then these 
handles would be in_voltage10_user5v_v_raw and in_voltage10_user5v_v_scale. This 
makes it a lot easier to get started and let the handles describe themselves, 
rather than having to look up which channels are connected to which things.

As far as using 'label' instead of 'extend-name', that's fine with me. I've 
already sent out a v2 using 'label' instead.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt b/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
index d71258e..4c5a60b 100644
--- a/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt
@@ -68,6 +68,8 @@  Optional properties:
 			  Note each channel number should only be used at most
 			  once.
 		Optional properties:
+			* xlnx,extend-name: Custom extended name for the
+			  channel.
 			* xlnx,bipolar: If set the channel is used in bipolar
 			  mode.
 
@@ -107,6 +109,7 @@  Examples:
 			#size-cells = <0>;
 			channel@0 {
 				reg = <0>;
+				xlnx,extend-name = "vin_v";
 				xlnx,bipolar;
 			};
 		};