diff mbox series

[v3,1/2] dt-bindings: hwmon: ti,ina2xx: Add INA233 device

Message ID 20250115015519.950795-2-leo.yang.sy0@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series hwmon: Add support for INA233 | expand

Commit Message

Leo Yang Jan. 15, 2025, 1:55 a.m. UTC
Add TI INA233 Current and Power Monitor bindings.

Signed-off-by: Leo Yang <leo.yang.sy0@gmail.com>
---
 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)

Comments

Krzysztof Kozlowski Jan. 15, 2025, 9:42 a.m. UTC | #1
On Wed, Jan 15, 2025 at 09:55:20AM +0800, Leo Yang wrote:
> @@ -75,12 +76,40 @@ properties:
>        the alert polarity to active-high.
>      $ref: /schemas/types.yaml#/definitions/flag
>  
> +  ti,current-lsb-microamp:
> +    description: |
> +      This value depends on the maximum current that can be expected to be
> +      measured by ina233 in your circuit, divide Maximum Expected Current
> +      by 2^15 and express it in microamps.

No, express here maximum expected current. Otherwise what is here?
Define the physical property, not the value used by your driver.

> +
> +      This value will be used to calculate the current/power coefficient for
> +      the pmbus and to calibrate the IC.
> +    minimum: 0x1

s/0x1/1/

maximum?
default?

> +
>  required:
>    - compatible
>    - reg

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 05a9cb36cd82..097b3d7d9e4b 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -27,6 +27,7 @@  properties:
       - ti,ina226
       - ti,ina230
       - ti,ina231
+      - ti,ina233
       - ti,ina237
       - ti,ina238
       - ti,ina260
@@ -75,12 +76,40 @@  properties:
       the alert polarity to active-high.
     $ref: /schemas/types.yaml#/definitions/flag
 
+  ti,current-lsb-microamp:
+    description: |
+      This value depends on the maximum current that can be expected to be
+      measured by ina233 in your circuit, divide Maximum Expected Current
+      by 2^15 and express it in microamps.
+
+      This value will be used to calculate the current/power coefficient for
+      the pmbus and to calibrate the IC.
+    minimum: 0x1
+
 required:
   - compatible
   - reg
 
 allOf:
   - $ref: hwmon-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - silergy,sy24655
+              - ti,ina209
+              - ti,ina219
+              - ti,ina220
+              - ti,ina226
+              - ti,ina230
+              - ti,ina231
+              - ti,ina237
+              - ti,ina238
+              - ti,ina260
+    then:
+      properties:
+        ti,current-lsb-microamp: false
 
 unevaluatedProperties: false