Re: [PATCH v3 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips

2019-10-04 Thread Guenter Roeck
On Thu, Oct 03, 2019 at 06:34:41PM +, Tremblay, Eric wrote:
> hwmon: Add DT bindings for TMP513 driver
> 
$subject is misleading.

> Signed-off-by: Eric Tremblay 
> ---
>  .../devicetree/bindings/hwmon/tmp513.txt  | 33 +++
>  1 file changed, 33 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/tmp513.txt
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/tmp513.txt 
> b/Documentation/devicetree/bindings/hwmon/tmp513.txt
> new file mode 100644
> index ..341c764e9173
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/tmp513.txt
> @@ -0,0 +1,33 @@
> +TMP513 system monitor sensor
> +-
> +
> +Require node properties:
> +- compatible: one of
> + "ti,tmp512"
> + "ti,tmp513"
> +- reg : the I2C address of the device. This is 0x5c, 0x5d, 0x5e, or 0x5f.
> +
> +Optional properties:
> +- shunt-resistor-uohm : 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.

If this is not mandatory, I would suggest to declare a sensible default,
such as 1 mOhm / 1000 uOhm.

> +- bus-voltage-range: 32V or 16V, default to 32V.

Question for Rob: Does this need "-volt" as part of the name ?

> +- pga-gain: The gain value for the PGA function. This is 8, 4, 2 or 1. 
> Default to 8.

It might be useful to explain "pga".

> +- temp_2_nfactor: nFactor for remote channel 1. Value according to Table 11 
> in datasheet.
> +- temp_3_nfactor: nFactor for remote channel 2. Value according to Table 11 
> in datasheet.
> +- temp_4_nfactor: nFactor for remote channel 3. Value according to Table 11 
> in datasheet,

Maybe an array and temp-nfactor, with 0x0 meaning "use default" ?

> + TMP513 only.
> +
> +Example:
> + tmp513@5c {
> +   compatible = "ti,tmp513";
> +   reg = <0x5C>;
> +   shunt-resistor-uohm = <33>;
> +   bus-voltage-range = <32>;
> +   pga-gain = <8>;
> +   temp_2_nfactor = <0x01>;
> +   temp_3_nfactor = <0x02>;
> +   temp_4_nfactor = <0x03>;
> + };
> -- 
> 2.17.1
> 


[PATCH v3 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips

2019-10-03 Thread Tremblay, Eric
hwmon: Add DT bindings for TMP513 driver

Signed-off-by: Eric Tremblay 
---
 .../devicetree/bindings/hwmon/tmp513.txt  | 33 +++
 1 file changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/tmp513.txt

diff --git a/Documentation/devicetree/bindings/hwmon/tmp513.txt 
b/Documentation/devicetree/bindings/hwmon/tmp513.txt
new file mode 100644
index ..341c764e9173
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/tmp513.txt
@@ -0,0 +1,33 @@
+TMP513 system monitor sensor
+-
+
+Require node properties:
+- compatible: one of
+   "ti,tmp512"
+   "ti,tmp513"
+- reg : the I2C address of the device. This is 0x5c, 0x5d, 0x5e, or 0x5f.
+
+Optional properties:
+- shunt-resistor-uohm : 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.
+- bus-voltage-range: 32V or 16V, default to 32V.
+- pga-gain: The gain value for the PGA function. This is 8, 4, 2 or 1. Default 
to 8.
+- temp_2_nfactor: nFactor for remote channel 1. Value according to Table 11 in 
datasheet.
+- temp_3_nfactor: nFactor for remote channel 2. Value according to Table 11 in 
datasheet.
+- temp_4_nfactor: nFactor for remote channel 3. Value according to Table 11 in 
datasheet,
+   TMP513 only.
+
+Example:
+   tmp513@5c {
+ compatible = "ti,tmp513";
+ reg = <0x5C>;
+ shunt-resistor-uohm = <33>;
+ bus-voltage-range = <32>;
+ pga-gain = <8>;
+ temp_2_nfactor = <0x01>;
+ temp_3_nfactor = <0x02>;
+ temp_4_nfactor = <0x03>;
+   };
-- 
2.17.1