All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property
@ 2015-05-07 22:44 ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-07 22:44 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA,
	jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk, Xander Huff

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-acOepvfBmUk@public.gmane.org>
Reviewed-by: Joe Hershberger <joe.hershberger-acOepvfBmUk@public.gmane.org>
Reviewed-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
--
Natinst-ReviewBoard-ID: 97119
---
 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;
 			};
 		};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property
@ 2015-05-07 22:44 ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-07 22:44 UTC (permalink / raw)
  To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, jic23, knaack.h, lars, pmeerw,
	devicetree, linux-arm-kernel, linux-iio, ben.shelton, joshc,
	joe.hershberger, Xander Huff

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(+)

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;
 			};
 		};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx, extend-name property
@ 2015-05-07 22:44 ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-07 22:44 UTC (permalink / raw)
  To: linux-arm-kernel

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(+)

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 at 0 {
 				reg = <0>;
+				xlnx,extend-name = "vin_v";
 				xlnx,bipolar;
 			};
 		};
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
  2015-05-07 22:44 ` [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property Xander Huff
  (?)
@ 2015-05-07 22:44     ` Xander Huff
  -1 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-07 22:44 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA,
	jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk, Xander Huff

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-acOepvfBmUk@public.gmane.org>
Reviewed-by: Joe Hershberger <joe.hershberger-acOepvfBmUk@public.gmane.org>
Reviewed-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
--
Natinst-ReviewBoard-ID: 97119
---
 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 a221f73..cf1d2f9 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1118,6 +1118,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, "xlnx,extend-name",
+						&chan->extend_name);
+
 			if (of_property_read_bool(child, "xlnx,bipolar"))
 				chan->scan_type.sign = 's';
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-07 22:44     ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-07 22:44 UTC (permalink / raw)
  To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, jic23, knaack.h, lars, pmeerw,
	devicetree, linux-arm-kernel, linux-iio, ben.shelton, joshc,
	joe.hershberger, Xander Huff

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
---
 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 a221f73..cf1d2f9 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1118,6 +1118,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, "xlnx,extend-name",
+						&chan->extend_name);
+
 			if (of_property_read_bool(child, "xlnx,bipolar"))
 				chan->scan_type.sign = 's';
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx, extend-name as an optional argument for aux channels
@ 2015-05-07 22:44     ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-07 22:44 UTC (permalink / raw)
  To: linux-arm-kernel

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
---
 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 a221f73..cf1d2f9 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1118,6 +1118,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, "xlnx,extend-name",
+						&chan->extend_name);
+
 			if (of_property_read_bool(child, "xlnx,bipolar"))
 				chan->scan_type.sign = 's';
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property
  2015-05-07 22:44 ` [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property Xander Huff
  (?)
@ 2015-05-08 18:43     ` Jonathan Cameron
  -1 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-05-08 18:43 UTC (permalink / raw)
  To: Xander Huff, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk

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-acOepvfBmUk@public.gmane.org>
> Reviewed-by: Joe Hershberger <joe.hershberger-acOepvfBmUk@public.gmane.org>
> Reviewed-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
> --
> 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;
>  			};
>  		};
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property
@ 2015-05-08 18:43     ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-05-08 18:43 UTC (permalink / raw)
  To: Xander Huff, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, knaack.h, lars, pmeerw,
	devicetree, linux-arm-kernel, linux-iio, ben.shelton, joshc,
	joe.hershberger

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;
>  			};
>  		};
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx, extend-name property
@ 2015-05-08 18:43     ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-05-08 18:43 UTC (permalink / raw)
  To: linux-arm-kernel

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 at 0 {
>  				reg = <0>;
> +				xlnx,extend-name = "vin_v";
>  				xlnx,bipolar;
>  			};
>  		};
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
  2015-05-07 22:44     ` [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name " Xander Huff
  (?)
@ 2015-05-19 17:53         ` Lars-Peter Clausen
  -1 siblings, 0 replies; 36+ messages in thread
From: Lars-Peter Clausen @ 2015-05-19 17:53 UTC (permalink / raw)
  To: Xander Huff, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA,
	jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-19 17:53         ` Lars-Peter Clausen
  0 siblings, 0 replies; 36+ messages in thread
From: Lars-Peter Clausen @ 2015-05-19 17:53 UTC (permalink / raw)
  To: Xander Huff, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, jic23, knaack.h, pmeerw,
	devicetree, linux-arm-kernel, linux-iio, ben.shelton, joshc,
	joe.hershberger

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-19 17:53         ` Lars-Peter Clausen
  0 siblings, 0 replies; 36+ messages in thread
From: Lars-Peter Clausen @ 2015-05-19 17:53 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2 1/2] devicetree: xilinx-xadc: Add optional label property
  2015-05-19 17:53         ` Lars-Peter Clausen
  (?)
@ 2015-05-20 15:22             ` Xander Huff
  -1 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-20 15:22 UTC (permalink / raw)
  To: lars-Qo5EllUWu/uELgA04lAiVw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA,
	jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk, Xander Huff

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>
---
 Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt | 2 ++
 1 file changed, 2 insertions(+)

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

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 1/2] devicetree: xilinx-xadc: Add optional label property
@ 2015-05-20 15:22             ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-20 15:22 UTC (permalink / raw)
  To: lars, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, jic23, knaack.h, pmeerw,
	devicetree, linux-arm-kernel, linux-iio, ben.shelton, joshc,
	joe.hershberger, Xander Huff

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@ni.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Josh Cartwright <joshc@ni.com>
---
 Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt | 2 ++
 1 file changed, 2 insertions(+)

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


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 1/2] devicetree: xilinx-xadc: Add optional label property
@ 2015-05-20 15:22             ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-20 15:22 UTC (permalink / raw)
  To: linux-arm-kernel

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@ni.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Josh Cartwright <joshc@ni.com>
---
 Documentation/devicetree/bindings/iio/adc/xilinx-xadc.txt | 2 ++
 1 file changed, 2 insertions(+)

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

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
  2015-05-20 15:22             ` Xander Huff
  (?)
@ 2015-05-20 15:22                 ` Xander Huff
  -1 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-20 15:22 UTC (permalink / raw)
  To: lars-Qo5EllUWu/uELgA04lAiVw, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA,
	jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk, Xander Huff

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';
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-05-20 15:22                 ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-20 15:22 UTC (permalink / raw)
  To: lars, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, jic23, knaack.h, pmeerw,
	devicetree, linux-arm-kernel, linux-iio, ben.shelton, joshc,
	joe.hershberger, Xander Huff

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@ni.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Josh Cartwright <joshc@ni.com>
---
 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';
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-05-20 15:22                 ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-20 15:22 UTC (permalink / raw)
  To: linux-arm-kernel

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@ni.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Josh Cartwright <joshc@ni.com>
---
 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';
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
  2015-05-19 17:53         ` Lars-Peter Clausen
  (?)
@ 2015-05-23 11:23             ` Jonathan Cameron
  -1 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-05-23 11:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Xander Huff, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk

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?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-23 11:23             ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-05-23 11:23 UTC (permalink / raw)
  To: Lars-Peter Clausen, Xander Huff, robh+dt, pawel.moll,
	mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, knaack.h, pmeerw, devicetree,
	linux-arm-kernel, linux-iio, ben.shelton, joshc, joe.hershberger

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?


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-23 11:23             ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-05-23 11:23 UTC (permalink / raw)
  To: linux-arm-kernel

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?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
  2015-05-23 11:23             ` Jonathan Cameron
  (?)
@ 2015-05-26  9:38               ` Lars-Peter Clausen
  -1 siblings, 0 replies; 36+ messages in thread
From: Lars-Peter Clausen @ 2015-05-26  9:38 UTC (permalink / raw)
  To: Jonathan Cameron, Xander Huff, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak
  Cc: devicetree, joe.hershberger, linux-iio, joshc, michal.simek,
	ben.shelton, soren.brinkmann, pmeerw, knaack.h, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-26  9:38               ` Lars-Peter Clausen
  0 siblings, 0 replies; 36+ messages in thread
From: Lars-Peter Clausen @ 2015-05-26  9:38 UTC (permalink / raw)
  To: Jonathan Cameron, Xander Huff, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, knaack.h, pmeerw, devicetree,
	linux-arm-kernel, linux-iio, ben.shelton, joshc, joe.hershberger

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-26  9:38               ` Lars-Peter Clausen
  0 siblings, 0 replies; 36+ messages in thread
From: Lars-Peter Clausen @ 2015-05-26  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
  2015-05-26  9:38               ` Lars-Peter Clausen
  (?)
@ 2015-05-26 19:05                   ` Xander Huff
  -1 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-26 19:05 UTC (permalink / raw)
  To: Lars-Peter Clausen, Jonathan Cameron,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk

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.

-- 
Xander Huff
Staff Software Engineer
National Instruments

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-26 19:05                   ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-26 19:05 UTC (permalink / raw)
  To: Lars-Peter Clausen, Jonathan Cameron, robh+dt, pawel.moll,
	mark.rutland, ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, knaack.h, pmeerw, devicetree,
	linux-arm-kernel, linux-iio, ben.shelton, joshc, joe.hershberger

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.

-- 
Xander Huff
Staff Software Engineer
National Instruments

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name as an optional argument for aux channels
@ 2015-05-26 19:05                   ` Xander Huff
  0 siblings, 0 replies; 36+ messages in thread
From: Xander Huff @ 2015-05-26 19:05 UTC (permalink / raw)
  To: linux-arm-kernel

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.

-- 
Xander Huff
Staff Software Engineer
National Instruments

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
  2015-05-20 15:22                 ` Xander Huff
  (?)
@ 2015-06-07 16:49                     ` Jonathan Cameron
  -1 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-06-07 16:49 UTC (permalink / raw)
  To: Xander Huff, lars-Qo5EllUWu/uELgA04lAiVw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joshc-acOepvfBmUk, joe.hershberger-acOepvfBmUk

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.  Perhaps an additional per channel attribute
called _label which would allow for board specific labelling?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-06-07 16:49                     ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-06-07 16:49 UTC (permalink / raw)
  To: Xander Huff, lars, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak
  Cc: michal.simek, soren.brinkmann, knaack.h, pmeerw, devicetree,
	linux-arm-kernel, linux-iio, ben.shelton, joshc, joe.hershberger

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@ni.com>
> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
> Reviewed-by: Josh Cartwright <joshc@ni.com>
> ---
>  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.  Perhaps an additional per channel attribute
called _label which would allow for board specific labelling?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-06-07 16:49                     ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-06-07 16:49 UTC (permalink / raw)
  To: linux-arm-kernel

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@ni.com>
> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
> Reviewed-by: Josh Cartwright <joshc@ni.com>
> ---
>  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.  Perhaps an additional per channel attribute
called _label which would allow for board specific labelling?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
  2015-06-07 16:49                     ` Jonathan Cameron
  (?)
@ 2015-06-08 13:49                         ` Josh Cartwright
  -1 siblings, 0 replies; 36+ messages in thread
From: Josh Cartwright @ 2015-06-08 13:49 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Xander Huff, lars-Qo5EllUWu/uELgA04lAiVw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ,
	michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joe.hershberger-acOepvfBmUk

[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]

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.

  Josh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-06-08 13:49                         ` Josh Cartwright
  0 siblings, 0 replies; 36+ messages in thread
From: Josh Cartwright @ 2015-06-08 13:49 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Xander Huff, lars, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, michal.simek, soren.brinkmann, knaack.h,
	pmeerw, devicetree, linux-arm-kernel, linux-iio, ben.shelton,
	joe.hershberger

[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]

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@ni.com>
> > Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
> > Reviewed-by: Josh Cartwright <joshc@ni.com>
> > ---
> >  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.

  Josh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-06-08 13:49                         ` Josh Cartwright
  0 siblings, 0 replies; 36+ messages in thread
From: Josh Cartwright @ 2015-06-08 13:49 UTC (permalink / raw)
  To: linux-arm-kernel

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@ni.com>
> > Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
> > Reviewed-by: Josh Cartwright <joshc@ni.com>
> > ---
> >  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.

  Josh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150608/962be065/attachment.sig>

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
  2015-06-08 13:49                         ` Josh Cartwright
  (?)
@ 2015-06-14 11:20                             ` Jonathan Cameron
  -1 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-06-14 11:20 UTC (permalink / raw)
  To: Josh Cartwright
  Cc: Xander Huff, lars-Qo5EllUWu/uELgA04lAiVw,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ,
	michal.simek-gjFFaj9aHVfQT0dZR+AlfA,
	soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA, knaack.h-Mmb7MZpHnFY,
	pmeerw-jW+XmwGofnusTnJN9+BGXg, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, ben.shelton-acOepvfBmUk,
	joe.hershberger-acOepvfBmUk

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
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-06-14 11:20                             ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-06-14 11:20 UTC (permalink / raw)
  To: Josh Cartwright
  Cc: Xander Huff, lars, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, michal.simek, soren.brinkmann, knaack.h,
	pmeerw, devicetree, linux-arm-kernel, linux-iio, ben.shelton,
	joe.hershberger

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@ni.com>
>>> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
>>> Reviewed-by: Josh Cartwright <joshc@ni.com>
>>> ---
>>>  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
> 


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2 2/2] iio: adc: xilinx-xadc: Add label as an optional argument for aux channels
@ 2015-06-14 11:20                             ` Jonathan Cameron
  0 siblings, 0 replies; 36+ messages in thread
From: Jonathan Cameron @ 2015-06-14 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

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@ni.com>
>>> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
>>> Reviewed-by: Josh Cartwright <joshc@ni.com>
>>> ---
>>>  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
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2015-06-14 11:20 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 22:44 [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property Xander Huff
2015-05-07 22:44 ` [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx, extend-name property Xander Huff
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
2015-05-07 22:44     ` [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx, extend-name " Xander Huff
2015-05-07 22:44     ` [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name " Xander Huff
     [not found]     ` <1431038644-41600-2-git-send-email-xander.huff-acOepvfBmUk@public.gmane.org>
2015-05-19 17:53       ` Lars-Peter Clausen
2015-05-19 17:53         ` Lars-Peter Clausen
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
2015-05-20 15:22             ` Xander Huff
2015-05-20 15:22             ` 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
2015-05-20 15:22                 ` Xander Huff
2015-05-20 15:22                 ` Xander Huff
     [not found]                 ` <1432135352-29848-2-git-send-email-xander.huff-acOepvfBmUk@public.gmane.org>
2015-06-07 16:49                   ` Jonathan Cameron
2015-06-07 16:49                     ` Jonathan Cameron
2015-06-07 16:49                     ` Jonathan Cameron
     [not found]                     ` <55747616.1010901-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-06-08 13:49                       ` Josh Cartwright
2015-06-08 13:49                         ` Josh Cartwright
2015-06-08 13:49                         ` Josh Cartwright
     [not found]                         ` <20150608134914.GF633-ew3lsbMjNqt5wtABiV/Xjqyly8cj88Ttqxv4g6HH51o@public.gmane.org>
2015-06-14 11:20                           ` Jonathan Cameron
2015-06-14 11:20                             ` Jonathan Cameron
2015-06-14 11:20                             ` Jonathan Cameron
2015-05-23 11:23           ` [PATCH 2/2] iio: adc: xilinx-xadc: Add xlnx,extend-name " Jonathan Cameron
2015-05-23 11:23             ` Jonathan Cameron
2015-05-23 11:23             ` Jonathan Cameron
2015-05-26  9:38             ` Lars-Peter Clausen
2015-05-26  9:38               ` Lars-Peter Clausen
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-26 19:05                   ` Xander Huff
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
2015-05-08 18:43     ` [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx, extend-name property Jonathan Cameron
2015-05-08 18:43     ` [PATCH 1/2] devicetree: xilinx-xadc: Add optional xlnx,extend-name property Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.