devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property
@ 2023-12-20 13:12 Michal Simek
  2023-12-20 13:12 ` [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property Michal Simek
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Michal Simek @ 2023-12-20 13:12 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon

Add a label property to allow a custom name to be used for identifying
a device on the board. This is useful when multiple devices are present on
the same board. Similar change was done by commit ffae65fb1ae4
("dt-bindings: spi: spi-cadence: Add label property").

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

zcu102 is using this feature
---
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 378d1f6aeeb3..8e5c1935b5f4 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -32,6 +32,9 @@ properties:
   reg:
     maxItems: 1
 
+  label:
+    description: A descriptive name for this device.
+
   shunt-resistor:
     description:
       Shunt resistor value in micro-Ohm.
@@ -77,6 +80,7 @@ examples:
         power-sensor@44 {
             compatible = "ti,ina220";
             reg = <0x44>;
+            label = "vdd_3v0";
             shunt-resistor = <1000>;
             vs-supply = <&vdd_3v0>;
         };
-- 
2.36.1


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

* [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property
  2023-12-20 13:12 [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Michal Simek
@ 2023-12-20 13:12 ` Michal Simek
  2023-12-21  9:06   ` Krzysztof Kozlowski
  2024-01-17 21:23   ` Guenter Roeck
  2023-12-21  9:06 ` [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Michal Simek @ 2023-12-20 13:12 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon

There are two drivers in the Linux kernel. One is hwmon based and second
IIO. IIO version requires to define #io-channel-cells to operate.

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

zynqmp zcu102 uses this feature too.

---
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 8e5c1935b5f4..f324b627bf9c 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -32,6 +32,9 @@ properties:
   reg:
     maxItems: 1
 
+  "#io-channel-cells":
+    const: 1
+
   label:
     description: A descriptive name for this device.
 
@@ -80,6 +83,7 @@ examples:
         power-sensor@44 {
             compatible = "ti,ina220";
             reg = <0x44>;
+            #io-channel-cells = <1>;
             label = "vdd_3v0";
             shunt-resistor = <1000>;
             vs-supply = <&vdd_3v0>;
-- 
2.36.1


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

* Re: [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property
  2023-12-20 13:12 [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Michal Simek
  2023-12-20 13:12 ` [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property Michal Simek
@ 2023-12-21  9:06 ` Krzysztof Kozlowski
  2023-12-21 11:24   ` Michal Simek
  2023-12-21 12:11 ` Krzysztof Kozlowski
  2024-01-17 21:22 ` Guenter Roeck
  3 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21  9:06 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon

On 20/12/2023 14:12, Michal Simek wrote:
> Add a label property to allow a custom name to be used for identifying
> a device on the board. This is useful when multiple devices are present on
> the same board. Similar change was done by commit ffae65fb1ae4
> ("dt-bindings: spi: spi-cadence: Add label property").
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---
> 
> zcu102 is using this feature

Is the driver or driver core parsing it?

Best regards,
Krzysztof


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

* Re: [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property
  2023-12-20 13:12 ` [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property Michal Simek
@ 2023-12-21  9:06   ` Krzysztof Kozlowski
  2024-01-17 21:23   ` Guenter Roeck
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21  9:06 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon

On 20/12/2023 14:12, Michal Simek wrote:
> There are two drivers in the Linux kernel. One is hwmon based and second
> IIO. IIO version requires to define #io-channel-cells to operate.
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property
  2023-12-21  9:06 ` [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Krzysztof Kozlowski
@ 2023-12-21 11:24   ` Michal Simek
  2023-12-21 12:11     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Simek @ 2023-12-21 11:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon



On 12/21/23 10:06, Krzysztof Kozlowski wrote:
> On 20/12/2023 14:12, Michal Simek wrote:
>> Add a label property to allow a custom name to be used for identifying
>> a device on the board. This is useful when multiple devices are present on
>> the same board. Similar change was done by commit ffae65fb1ae4
>> ("dt-bindings: spi: spi-cadence: Add label property").
>>
>> Signed-off-by: Michal Simek <michal.simek@amd.com>
>> ---
>>
>> zcu102 is using this feature
> 
> Is the driver or driver core parsing it?

I see that functions to be in hwmon and iio cores.

drivers/hwmon/hwmon.c:820:   err = device_property_read_string(dev, "label", 
&label);

drivers/iio/industrialio-core.c:1914:	fwnode_property_read_string(fwnode, 
"label", &indio_dev->label);

Thanks,
Michal

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

* Re: [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property
  2023-12-21 11:24   ` Michal Simek
@ 2023-12-21 12:11     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 12:11 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon

On 21/12/2023 12:24, Michal Simek wrote:
> 
> 
> On 12/21/23 10:06, Krzysztof Kozlowski wrote:
>> On 20/12/2023 14:12, Michal Simek wrote:
>>> Add a label property to allow a custom name to be used for identifying
>>> a device on the board. This is useful when multiple devices are present on
>>> the same board. Similar change was done by commit ffae65fb1ae4
>>> ("dt-bindings: spi: spi-cadence: Add label property").
>>>
>>> Signed-off-by: Michal Simek <michal.simek@amd.com>
>>> ---
>>>
>>> zcu102 is using this feature
>>
>> Is the driver or driver core parsing it?
> 
> I see that functions to be in hwmon and iio cores.
> 
> drivers/hwmon/hwmon.c:820:   err = device_property_read_string(dev, "label", 
> &label);
> 
> drivers/iio/industrialio-core.c:1914:	fwnode_property_read_string(fwnode, 
> "label", &indio_dev->label);

I wonder why it is not in bindings/iio/common.yaml...

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property
  2023-12-20 13:12 [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Michal Simek
  2023-12-20 13:12 ` [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property Michal Simek
  2023-12-21  9:06 ` [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Krzysztof Kozlowski
@ 2023-12-21 12:11 ` Krzysztof Kozlowski
  2024-01-17 21:22 ` Guenter Roeck
  3 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 12:11 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr, michal.simek, git
  Cc: Conor Dooley, Guenter Roeck, Jean Delvare, Krzysztof Kozlowski,
	Rob Herring, devicetree, linux-hwmon

On 20/12/2023 14:12, Michal Simek wrote:
> Add a label property to allow a custom name to be used for identifying
> a device on the board. This is useful when multiple devices are present on
> the same board. Similar change was done by commit ffae65fb1ae4
> ("dt-bindings: spi: spi-cadence: Add label property").
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property
  2023-12-20 13:12 [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Michal Simek
                   ` (2 preceding siblings ...)
  2023-12-21 12:11 ` Krzysztof Kozlowski
@ 2024-01-17 21:22 ` Guenter Roeck
  3 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2024-01-17 21:22 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, michal.simek, git, Conor Dooley,
	Jean Delvare, Krzysztof Kozlowski, Rob Herring, devicetree,
	linux-hwmon

On Wed, Dec 20, 2023 at 02:12:13PM +0100, Michal Simek wrote:
> Add a label property to allow a custom name to be used for identifying
> a device on the board. This is useful when multiple devices are present on
> the same board. Similar change was done by commit ffae65fb1ae4
> ("dt-bindings: spi: spi-cadence: Add label property").
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Applied.

Guenter

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

* Re: [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property
  2023-12-20 13:12 ` [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property Michal Simek
  2023-12-21  9:06   ` Krzysztof Kozlowski
@ 2024-01-17 21:23   ` Guenter Roeck
  1 sibling, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2024-01-17 21:23 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, michal.simek, git, Conor Dooley,
	Jean Delvare, Krzysztof Kozlowski, Rob Herring, devicetree,
	linux-hwmon

On Wed, Dec 20, 2023 at 02:12:14PM +0100, Michal Simek wrote:
> There are two drivers in the Linux kernel. One is hwmon based and second
> IIO. IIO version requires to define #io-channel-cells to operate.
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Applied.

Guenter

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

end of thread, other threads:[~2024-01-17 21:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20 13:12 [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Michal Simek
2023-12-20 13:12 ` [PATCH 2/2] dt-bindings: hwmon: ina2xx: Describe #io-channel-cells property Michal Simek
2023-12-21  9:06   ` Krzysztof Kozlowski
2024-01-17 21:23   ` Guenter Roeck
2023-12-21  9:06 ` [PATCH 1/2] dt-bindings: hwmon: ina2xx: Add label property Krzysztof Kozlowski
2023-12-21 11:24   ` Michal Simek
2023-12-21 12:11     ` Krzysztof Kozlowski
2023-12-21 12:11 ` Krzysztof Kozlowski
2024-01-17 21:22 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).