Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips
@ 2019-10-01 17:50 Tremblay, Eric
  2019-10-01 18:37 ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Tremblay, Eric @ 2019-10-01 17:50 UTC (permalink / raw)
  To: linux-hwmon

hwmon: Add DT bindings for TMP513 driver

Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
---
 .../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 000000000000..0f61793cbf2f
--- /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.
+- shunt-resistor-uohm : The shunt resistor value in uOhm.
+
+Optional properties:
+- bus-voltage-range: 32V or 16V, default to 32V.
+- max-expected-current-ma: Maximum expected current value. Default to max possible value.
+- 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.
+- temp_hysteresis: Hystereris for temperature limits.
+
+Example:
+	tmp513@5c {
+		  compatible = "ti,tmp513";
+		  reg = <0x5C>;
+		  shunt-resistor-uohm = <330>;
+		  bus-voltage-range = <32>;
+		  pga-gain = <8>;
+		  max-expected-current-ma = <100>;
+		  temp_2_nfactor = <0x01>;
+		  temp_3_nfactor = <0x02>;
+		  temp_4_nfactor = <0x03>;
+		  temp_hysteresis = <5>;
+	};
-- 
2.17.1


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

* Re: [PATCH v2 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips
  2019-10-01 17:50 [PATCH v2 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips Tremblay, Eric
@ 2019-10-01 18:37 ` Guenter Roeck
  2019-10-01 21:36   ` Tremblay, Eric
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2019-10-01 18:37 UTC (permalink / raw)
  To: Tremblay, Eric; +Cc: linux-hwmon

On Tue, Oct 01, 2019 at 05:50:32PM +0000, Tremblay, Eric wrote:
> hwmon: Add DT bindings for TMP513 driver
> 
> Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
> ---
>  .../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 000000000000..0f61793cbf2f
> --- /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.
> +- shunt-resistor-uohm : The shunt resistor value in uOhm.
> +
> +Optional properties:
> +- bus-voltage-range: 32V or 16V, default to 32V.
> +- max-expected-current-ma: Maximum expected current value. Default to max possible value.
> +- 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.
> +- temp_hysteresis: Hystereris for temperature limits.

There is a standard sysfs attribute for hysteresis values, and I assume this
is one parameter that users might want to change at runtime. Why not use it ?

> +
> +Example:
> +	tmp513@5c {
> +		  compatible = "ti,tmp513";
> +		  reg = <0x5C>;
> +		  shunt-resistor-uohm = <330>;
> +		  bus-voltage-range = <32>;
> +		  pga-gain = <8>;
> +		  max-expected-current-ma = <100>;
> +		  temp_2_nfactor = <0x01>;
> +		  temp_3_nfactor = <0x02>;
> +		  temp_4_nfactor = <0x03>;
> +		  temp_hysteresis = <5>;
> +	};
> -- 
> 2.17.1
> 

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

* RE: [PATCH v2 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips
  2019-10-01 18:37 ` Guenter Roeck
@ 2019-10-01 21:36   ` Tremblay, Eric
  2019-10-01 22:35     ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Tremblay, Eric @ 2019-10-01 21:36 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

> On Tue, Oct 01, 2019 at 05:50:32PM +0000, Tremblay, Eric wrote:
> > hwmon: Add DT bindings for TMP513 driver
> >
> > Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
> > ---
> >  .../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 000000000000..0f61793cbf2f
> > --- /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.
> > +- shunt-resistor-uohm : The shunt resistor value in uOhm.
> > +
> > +Optional properties:
> > +- bus-voltage-range: 32V or 16V, default to 32V.
> > +- max-expected-current-ma: Maximum expected current value. Default to max possible value.
> > +- 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.
> > +- temp_hysteresis: Hystereris for temperature limits.
> 
> There is a standard sysfs attribute for hysteresis values, and I assume this is one parameter that users might want to change at
> runtime. Why not use it ?

In those sensors, the hysteresis setting is global to all channels. Is it still a standard sysfs attribute in that case ? If yes, should I name it
temp_crit_hyst to show that is a global parameter ?
> 
> > +
> > +Example:
> > +	tmp513@5c {
> > +		  compatible = "ti,tmp513";
> > +		  reg = <0x5C>;
> > +		  shunt-resistor-uohm = <330>;
> > +		  bus-voltage-range = <32>;
> > +		  pga-gain = <8>;
> > +		  max-expected-current-ma = <100>;
> > +		  temp_2_nfactor = <0x01>;
> > +		  temp_3_nfactor = <0x02>;
> > +		  temp_4_nfactor = <0x03>;
> > +		  temp_hysteresis = <5>;
> > +	};
> > --
> > 2.17.1
> >

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

* Re: [PATCH v2 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips
  2019-10-01 21:36   ` Tremblay, Eric
@ 2019-10-01 22:35     ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2019-10-01 22:35 UTC (permalink / raw)
  To: Tremblay, Eric; +Cc: linux-hwmon

On Tue, Oct 01, 2019 at 09:36:30PM +0000, Tremblay, Eric wrote:
> > On Tue, Oct 01, 2019 at 05:50:32PM +0000, Tremblay, Eric wrote:
> > > hwmon: Add DT bindings for TMP513 driver
> > >
> > > Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
> > > ---
> > >  .../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 000000000000..0f61793cbf2f
> > > --- /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.
> > > +- shunt-resistor-uohm : The shunt resistor value in uOhm.
> > > +
> > > +Optional properties:
> > > +- bus-voltage-range: 32V or 16V, default to 32V.
> > > +- max-expected-current-ma: Maximum expected current value. Default to max possible value.
> > > +- 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.
> > > +- temp_hysteresis: Hystereris for temperature limits.
> > 
> > There is a standard sysfs attribute for hysteresis values, and I assume this is one parameter that users might want to change at
> > runtime. Why not use it ?
> 
> In those sensors, the hysteresis setting is global to all channels. Is it still a standard sysfs attribute in that case ? If yes, should I name it
> temp_crit_hyst to show that is a global parameter ?

That is the case for many chips. The most common solution is to support
the attribute for all channels and make only the first channel writeable.
When doing that, add a note to the documentation indicating that writing
one attribute affects all attributes.

temp_crit_hyst doesn't help because it is non-standard and the "sensors"
command won't see it.

Guenter

> > 
> > > +
> > > +Example:
> > > +	tmp513@5c {
> > > +		  compatible = "ti,tmp513";
> > > +		  reg = <0x5C>;
> > > +		  shunt-resistor-uohm = <330>;
> > > +		  bus-voltage-range = <32>;
> > > +		  pga-gain = <8>;
> > > +		  max-expected-current-ma = <100>;
> > > +		  temp_2_nfactor = <0x01>;
> > > +		  temp_3_nfactor = <0x02>;
> > > +		  temp_4_nfactor = <0x03>;
> > > +		  temp_hysteresis = <5>;
> > > +	};
> > > --
> > > 2.17.1
> > >

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 17:50 [PATCH v2 2/2] hwmon: Add driver for Texas Instruments TMP512/513 sensor chips Tremblay, Eric
2019-10-01 18:37 ` Guenter Roeck
2019-10-01 21:36   ` Tremblay, Eric
2019-10-01 22:35     ` Guenter Roeck

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org
	public-inbox-index linux-hwmon

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git