All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 1/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips
@ 2019-10-22 13:33 Tremblay, Eric
  2019-10-24 22:59 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Tremblay, Eric @ 2019-10-22 13:33 UTC (permalink / raw)
  To: linux-hwmon, devicetree, linux-doc
  Cc: Jean Delvare, Guenter Roeck, robh+dt, mark.rutland, Jonathan Corbet

dt-bindings: hwmon: Add TMP512/513

Add dt-binding for TMP512/513 sensor chips

Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
---
 .../devicetree/bindings/hwmon/ti,tmp513.yaml  | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml
new file mode 100644
index 000000000000..33d880b2a887
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2018 Linaro Ltd.
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/tmp513.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TMP513/512 system monitor sensor
+
+maintainers:
+  - Eric Tremblay <etremblay@distech-controls.com>
+
+description: |
+  The TMP512 (dual-channel) and TMP513 (triple-channel) are system monitors that include
+  remote sensors, a local temperature sensor, and a high-side current shunt monitor.
+  These system monitors have the capability of measuring remote temperatures,
+  on-chip temperatures, and system voltage/power/current consumption.
+
+  Datasheets:
+  http://www.ti.com/lit/gpn/tmp513
+  http://www.ti.com/lit/gpn/tmp512
+
+
+properties:
+  compatible:
+    - enum:
+      - ti,tmp512
+      - ti,tmp513
+
+  reg:
+    maxItems: 1
+
+  ti,shunt-resistor-micro-ohms:
+    description: |
+      The shunt resistor value in uOhm. If 0, the calibration process
+      will be skiped and the current and power measurement engine will not work.
+      Temperature and voltage measurement will continue to work. The shunt value also
+      need to respect : rshunt <= pga-gain * 40 * 1000 * 1000. If not, it's not possible
+      to compute a valid calibration value.
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+    default: 1000
+
+  ti,pga-gain:
+    description: |
+      The gain value for the PGA function. This is 8, 4, 2 or 1.
+      The PGA gain affect the shunt voltage range.
+      The range will be equal to: pga-gain * 40mV
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [1, 2, 4, 8]
+    default: 8
+
+  ti,bus-voltage-range-volt:
+    description: |
+      This is the operating range of the bus voltage
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [16, 32]
+    default: 32
+
+  ti,nfactor:
+    description: |
+      Array of three(TMP513) or two(TMP512) n-Factor value for each remote
+      temperature channel.
+      See datasheet Table 11 for n-Factor range list and value interpretation.
+    allOf:
+      - $ref: /schemas/types.yaml#definitions/uint8-array
+      - minItems: 2
+        maxItems: 3
+        items:
+          default: 0
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    &i2c0 {
+        tmp513@5c {
+            compatible = "ti,tmp513";
+            reg = <0x5C>;
+            ti,shunt-resistor-micro-ohms = <330000>;
+            ti,bus-voltage-range-volts = <32>;
+            ti,pga-gain = <8>;
+            ti,nfactor = [01 F3 00];
+        };
+    }
-- 
2.17.1


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

* Re: [PATCH v5 1/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips
  2019-10-22 13:33 [PATCH v5 1/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips Tremblay, Eric
@ 2019-10-24 22:59 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2019-10-24 22:59 UTC (permalink / raw)
  To: Tremblay, Eric
  Cc: linux-hwmon, devicetree, linux-doc, Jean Delvare, Guenter Roeck,
	mark.rutland, Jonathan Corbet

On Tue, Oct 22, 2019 at 01:33:19PM +0000, Tremblay, Eric wrote:
> dt-bindings: hwmon: Add TMP512/513
> 
> Add dt-binding for TMP512/513 sensor chips
> 
> Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
> ---
>  .../devicetree/bindings/hwmon/ti,tmp513.yaml  | 90 +++++++++++++++++++
>  1 file changed, 90 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml
> new file mode 100644
> index 000000000000..33d880b2a887
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml
> @@ -0,0 +1,90 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2018 Linaro Ltd.
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/tmp513.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TMP513/512 system monitor sensor
> +
> +maintainers:
> +  - Eric Tremblay <etremblay@distech-controls.com>
> +
> +description: |
> +  The TMP512 (dual-channel) and TMP513 (triple-channel) are system monitors that include
> +  remote sensors, a local temperature sensor, and a high-side current shunt monitor.
> +  These system monitors have the capability of measuring remote temperatures,
> +  on-chip temperatures, and system voltage/power/current consumption.
> +
> +  Datasheets:
> +  http://www.ti.com/lit/gpn/tmp513
> +  http://www.ti.com/lit/gpn/tmp512
> +
> +
> +properties:
> +  compatible:
> +    - enum:
> +      - ti,tmp512
> +      - ti,tmp513
> +
> +  reg:
> +    maxItems: 1
> +
> +  ti,shunt-resistor-micro-ohms:

We have a standard property for this.

> +    description: |
> +      The shunt resistor value in uOhm. If 0, the calibration process
> +      will be skiped and the current and power measurement engine will not work.
> +      Temperature and voltage measurement will continue to work. The shunt value also
> +      need to respect : rshunt <= pga-gain * 40 * 1000 * 1000. If not, it's not possible
> +      to compute a valid calibration value.
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32

Not necessary when standard units are used.

> +    default: 1000
> +
> +  ti,pga-gain:
> +    description: |
> +      The gain value for the PGA function. This is 8, 4, 2 or 1.
> +      The PGA gain affect the shunt voltage range.
> +      The range will be equal to: pga-gain * 40mV
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [1, 2, 4, 8]
> +    default: 8

Should be under the enum (i.e. 4 more spaces).

Or the enum can be at this level.

> +
> +  ti,bus-voltage-range-volt:
> +    description: |
> +      This is the operating range of the bus voltage
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +      - enum: [16, 32]

Is this 16V or 32V?

> +    default: 32

Under the 'enum'...

> +
> +  ti,nfactor:
> +    description: |
> +      Array of three(TMP513) or two(TMP512) n-Factor value for each remote
> +      temperature channel.
> +      See datasheet Table 11 for n-Factor range list and value interpretation.
> +    allOf:
> +      - $ref: /schemas/types.yaml#definitions/uint8-array
> +      - minItems: 2
> +        maxItems: 3
> +        items:
> +          default: 0
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    &i2c0 {
> +        tmp513@5c {
> +            compatible = "ti,tmp513";
> +            reg = <0x5C>;
> +            ti,shunt-resistor-micro-ohms = <330000>;
> +            ti,bus-voltage-range-volts = <32>;
> +            ti,pga-gain = <8>;
> +            ti,nfactor = [01 F3 00];
> +        };
> +    }
> -- 
> 2.17.1
> 

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

end of thread, other threads:[~2019-10-24 22:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 13:33 [PATCH v5 1/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips Tremblay, Eric
2019-10-24 22:59 ` Rob Herring

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.