diff mbox series

[1/2] dt-binding: iio: Add optional label property

Message ID 1566876924-63608-2-git-send-email-preid@electromag.com.au (mailing list archive)
State New, archived
Headers show
Series iio: core: Add optional symbolic label to device attributes | expand

Commit Message

Phil Reid Aug. 27, 2019, 3:35 a.m. UTC
This optional property defines a symbolic name for the device.

Signed-off-by: Phil Reid <preid@electromag.com.au>
---
 Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michal Simek Aug. 27, 2019, 6:10 a.m. UTC | #1
On 27. 08. 19 5:35, Phil Reid wrote:
> This optional property defines a symbolic name for the device.
> 
> Signed-off-by: Phil Reid <preid@electromag.com.au>
> ---
>  Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> index 68d6f8ce063b..ffeae5aad8b5 100644
> --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
> +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> @@ -18,12 +18,17 @@ Required properties:
>  		   with a single IIO output and 1 for nodes with multiple
>  		   IIO outputs.
>  
> +Optional properties:
> +label:		   A symbolic name for the device.
> +
> +
>  Example for a simple configuration with no trigger:
>  
>  	adc: voltage-sensor@35 {
>  		compatible = "maxim,max1139";
>  		reg = <0x35>;
>  		#io-channel-cells = <1>;
> +		label = "adc_voltage_sensor";
>  	};
>  
>  Example for a configuration with trigger:
> 

Suggested-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
Michal Simek Aug. 28, 2019, 6:09 a.m. UTC | #2
On 27. 08. 19 5:35, Phil Reid wrote:
> This optional property defines a symbolic name for the device.
> 
> Signed-off-by: Phil Reid <preid@electromag.com.au>
> ---
>  Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> index 68d6f8ce063b..ffeae5aad8b5 100644
> --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
> +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> @@ -18,12 +18,17 @@ Required properties:
>  		   with a single IIO output and 1 for nodes with multiple
>  		   IIO outputs.
>  
> +Optional properties:
> +label:		   A symbolic name for the device.
> +
> +
>  Example for a simple configuration with no trigger:
>  
>  	adc: voltage-sensor@35 {
>  		compatible = "maxim,max1139";
>  		reg = <0x35>;
>  		#io-channel-cells = <1>;
> +		label = "adc_voltage_sensor";
>  	};
>  
>  Example for a configuration with trigger:
> 

Just for the record. This patch has been created based on initial
discussion about label property. And Rob had not problem with using
label in connection to ina226. https://lkml.org/lkml/2019/8/27/1213

Thanks,
Michal
Rob Herring (Arm) Aug. 29, 2019, 11:02 p.m. UTC | #3
On Wed, Aug 28, 2019 at 08:09:19AM +0200, Michal Simek wrote:
> On 27. 08. 19 5:35, Phil Reid wrote:
> > This optional property defines a symbolic name for the device.
> > 
> > Signed-off-by: Phil Reid <preid@electromag.com.au>
> > ---
> >  Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> > index 68d6f8ce063b..ffeae5aad8b5 100644
> > --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
> > +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> > @@ -18,12 +18,17 @@ Required properties:
> >  		   with a single IIO output and 1 for nodes with multiple
> >  		   IIO outputs.
> >  
> > +Optional properties:
> > +label:		   A symbolic name for the device.
> > +
> > +
> >  Example for a simple configuration with no trigger:
> >  
> >  	adc: voltage-sensor@35 {
> >  		compatible = "maxim,max1139";
> >  		reg = <0x35>;
> >  		#io-channel-cells = <1>;
> > +		label = "adc_voltage_sensor";
> >  	};
> >  
> >  Example for a configuration with trigger:
> > 
> 
> Just for the record. This patch has been created based on initial
> discussion about label property. And Rob had not problem with using
> label in connection to ina226. https://lkml.org/lkml/2019/8/27/1213

I didn't, but based on the name here I'm less convinced. 'label' is 
supposed to be for needing to distinguish between more than 1 of 
something. A name like 'adc_voltage_sensor' doesn't really.

Rob
Phil Reid Aug. 30, 2019, 1:01 a.m. UTC | #4
On 30/08/2019 07:02, Rob Herring wrote:
> On Wed, Aug 28, 2019 at 08:09:19AM +0200, Michal Simek wrote:
>> On 27. 08. 19 5:35, Phil Reid wrote:
>>> This optional property defines a symbolic name for the device.
>>>
>>> Signed-off-by: Phil Reid <preid@electromag.com.au>
>>> ---
>>>   Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
>>> index 68d6f8ce063b..ffeae5aad8b5 100644
>>> --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
>>> +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
>>> @@ -18,12 +18,17 @@ Required properties:
>>>   		   with a single IIO output and 1 for nodes with multiple
>>>   		   IIO outputs.
>>>   
>>> +Optional properties:
>>> +label:		   A symbolic name for the device.
>>> +
>>> +
>>>   Example for a simple configuration with no trigger:
>>>   
>>>   	adc: voltage-sensor@35 {
>>>   		compatible = "maxim,max1139";
>>>   		reg = <0x35>;
>>>   		#io-channel-cells = <1>;
>>> +		label = "adc_voltage_sensor";
>>>   	};
>>>   
>>>   Example for a configuration with trigger:
>>>
>>
>> Just for the record. This patch has been created based on initial
>> discussion about label property. And Rob had not problem with using
>> label in connection to ina226. https://lkml.org/lkml/2019/8/27/1213
> 
> I didn't, but based on the name here I'm less convinced. 'label' is
> supposed to be for needing to distinguish between more than 1 of
> something. A name like 'adc_voltage_sensor' doesn't really.
> 
> Rob
> 
> 

That's the problem we're try to solve. Having multiple devices and try to
determine which device is which.
eg: Mutliple adc's.
For example I have the same dac chip on multiple boards that do different
things, it's difficult to id them.

so label examples could be:
label = "current_control_group1";
label = "voltage_control_group1";

Are you totally against this or is it a problem with me not being clear
with the problem and the wording of the commit message or the example?
Rob Herring (Arm) Aug. 30, 2019, 12:34 p.m. UTC | #5
On Thu, Aug 29, 2019 at 8:01 PM Phil Reid <preid@electromag.com.au> wrote:
>
> On 30/08/2019 07:02, Rob Herring wrote:
> > On Wed, Aug 28, 2019 at 08:09:19AM +0200, Michal Simek wrote:
> >> On 27. 08. 19 5:35, Phil Reid wrote:
> >>> This optional property defines a symbolic name for the device.
> >>>
> >>> Signed-off-by: Phil Reid <preid@electromag.com.au>
> >>> ---
> >>>   Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
> >>>   1 file changed, 5 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>> index 68d6f8ce063b..ffeae5aad8b5 100644
> >>> --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>> +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>> @@ -18,12 +18,17 @@ Required properties:
> >>>                with a single IIO output and 1 for nodes with multiple
> >>>                IIO outputs.
> >>>
> >>> +Optional properties:
> >>> +label:                A symbolic name for the device.
> >>> +
> >>> +
> >>>   Example for a simple configuration with no trigger:
> >>>
> >>>     adc: voltage-sensor@35 {
> >>>             compatible = "maxim,max1139";
> >>>             reg = <0x35>;
> >>>             #io-channel-cells = <1>;
> >>> +           label = "adc_voltage_sensor";
> >>>     };
> >>>
> >>>   Example for a configuration with trigger:
> >>>
> >>
> >> Just for the record. This patch has been created based on initial
> >> discussion about label property. And Rob had not problem with using
> >> label in connection to ina226. https://lkml.org/lkml/2019/8/27/1213
> >
> > I didn't, but based on the name here I'm less convinced. 'label' is
> > supposed to be for needing to distinguish between more than 1 of
> > something. A name like 'adc_voltage_sensor' doesn't really.
> >
> > Rob
> >
> >
>
> That's the problem we're try to solve. Having multiple devices and try to
> determine which device is which.
> eg: Mutliple adc's.
> For example I have the same dac chip on multiple boards that do different
> things, it's difficult to id them.
>
> so label examples could be:
> label = "current_control_group1";
> label = "voltage_control_group1";
>
> Are you totally against this or is it a problem with me not being clear
> with the problem and the wording of the commit message or the example?

It's just the example is less than ideal. But it's just an example, so:

Reviewed-by: Rob Herring <robh@kernel.org>

Feel free to update the example if you respin.

Rob
Phil Reid Aug. 31, 2019, 10:19 a.m. UTC | #6
On 30/08/2019 20:34, Rob Herring wrote:
> On Thu, Aug 29, 2019 at 8:01 PM Phil Reid <preid@electromag.com.au> wrote:
>>
>> On 30/08/2019 07:02, Rob Herring wrote:
>>> On Wed, Aug 28, 2019 at 08:09:19AM +0200, Michal Simek wrote:
>>>> On 27. 08. 19 5:35, Phil Reid wrote:
>>>>> This optional property defines a symbolic name for the device.
>>>>>
>>>>> Signed-off-by: Phil Reid <preid@electromag.com.au>
>>>>> ---
>>>>>    Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
>>>>>    1 file changed, 5 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
>>>>> index 68d6f8ce063b..ffeae5aad8b5 100644
>>>>> --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
>>>>> +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
>>>>> @@ -18,12 +18,17 @@ Required properties:
>>>>>                 with a single IIO output and 1 for nodes with multiple
>>>>>                 IIO outputs.
>>>>>
>>>>> +Optional properties:
>>>>> +label:                A symbolic name for the device.
>>>>> +
>>>>> +
>>>>>    Example for a simple configuration with no trigger:
>>>>>
>>>>>      adc: voltage-sensor@35 {
>>>>>              compatible = "maxim,max1139";
>>>>>              reg = <0x35>;
>>>>>              #io-channel-cells = <1>;
>>>>> +           label = "adc_voltage_sensor";
>>>>>      };
>>>>>
>>>>>    Example for a configuration with trigger:
>>>>>
>>>>
>>>> Just for the record. This patch has been created based on initial
>>>> discussion about label property. And Rob had not problem with using
>>>> label in connection to ina226. https://lkml.org/lkml/2019/8/27/1213
>>>
>>> I didn't, but based on the name here I'm less convinced. 'label' is
>>> supposed to be for needing to distinguish between more than 1 of
>>> something. A name like 'adc_voltage_sensor' doesn't really.
>>>
>>> Rob
>>>
>>>
>>
>> That's the problem we're try to solve. Having multiple devices and try to
>> determine which device is which.
>> eg: Mutliple adc's.
>> For example I have the same dac chip on multiple boards that do different
>> things, it's difficult to id them.
>>
>> so label examples could be:
>> label = "current_control_group1";
>> label = "voltage_control_group1";
>>
>> Are you totally against this or is it a problem with me not being clear
>> with the problem and the wording of the commit message or the example?
> 
> It's just the example is less than ideal. But it's just an example, so:
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> 
> Feel free to update the example if you respin.
> 
Thanks Rob,

I'll update the example if the series gets a respin.
Jonathan Cameron Sept. 8, 2019, 12:14 p.m. UTC | #7
On Sat, 31 Aug 2019 18:19:53 +0800
Phil Reid <preid@electromag.com.au> wrote:

> On 30/08/2019 20:34, Rob Herring wrote:
> > On Thu, Aug 29, 2019 at 8:01 PM Phil Reid <preid@electromag.com.au> wrote:  
> >>
> >> On 30/08/2019 07:02, Rob Herring wrote:  
> >>> On Wed, Aug 28, 2019 at 08:09:19AM +0200, Michal Simek wrote:  
> >>>> On 27. 08. 19 5:35, Phil Reid wrote:  
> >>>>> This optional property defines a symbolic name for the device.
> >>>>>
> >>>>> Signed-off-by: Phil Reid <preid@electromag.com.au>
> >>>>> ---
> >>>>>    Documentation/devicetree/bindings/iio/iio-bindings.txt | 5 +++++
> >>>>>    1 file changed, 5 insertions(+)
> >>>>>
> >>>>> diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>>>> index 68d6f8ce063b..ffeae5aad8b5 100644
> >>>>> --- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>>>> +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
> >>>>> @@ -18,12 +18,17 @@ Required properties:
> >>>>>                 with a single IIO output and 1 for nodes with multiple
> >>>>>                 IIO outputs.
> >>>>>
> >>>>> +Optional properties:
> >>>>> +label:                A symbolic name for the device.
> >>>>> +
> >>>>> +
> >>>>>    Example for a simple configuration with no trigger:
> >>>>>
> >>>>>      adc: voltage-sensor@35 {
> >>>>>              compatible = "maxim,max1139";
> >>>>>              reg = <0x35>;
> >>>>>              #io-channel-cells = <1>;
> >>>>> +           label = "adc_voltage_sensor";
> >>>>>      };
> >>>>>
> >>>>>    Example for a configuration with trigger:
> >>>>>  
> >>>>
> >>>> Just for the record. This patch has been created based on initial
> >>>> discussion about label property. And Rob had not problem with using
> >>>> label in connection to ina226. https://lkml.org/lkml/2019/8/27/1213  
> >>>
> >>> I didn't, but based on the name here I'm less convinced. 'label' is
> >>> supposed to be for needing to distinguish between more than 1 of
> >>> something. A name like 'adc_voltage_sensor' doesn't really.
> >>>
> >>> Rob
> >>>
> >>>  
> >>
> >> That's the problem we're try to solve. Having multiple devices and try to
> >> determine which device is which.
> >> eg: Mutliple adc's.
> >> For example I have the same dac chip on multiple boards that do different
> >> things, it's difficult to id them.
> >>
> >> so label examples could be:
> >> label = "current_control_group1";
> >> label = "voltage_control_group1";
> >>
> >> Are you totally against this or is it a problem with me not being clear
> >> with the problem and the wording of the commit message or the example?  
> > 
> > It's just the example is less than ideal. But it's just an example, so:
> > 
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > 
> > Feel free to update the example if you respin.
> >   
> Thanks Rob,
> 
> I'll update the example if the series gets a respin.

Please do respin some more 'example' suited names :)

Thanks,

Jonathan

> 
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt
index 68d6f8ce063b..ffeae5aad8b5 100644
--- a/Documentation/devicetree/bindings/iio/iio-bindings.txt
+++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt
@@ -18,12 +18,17 @@  Required properties:
 		   with a single IIO output and 1 for nodes with multiple
 		   IIO outputs.
 
+Optional properties:
+label:		   A symbolic name for the device.
+
+
 Example for a simple configuration with no trigger:
 
 	adc: voltage-sensor@35 {
 		compatible = "maxim,max1139";
 		reg = <0x35>;
 		#io-channel-cells = <1>;
+		label = "adc_voltage_sensor";
 	};
 
 Example for a configuration with trigger: