diff mbox

[v1] Documentation: dt-bindings: aspeed-pwm-tacho cooling device.

Message ID 20170711131827.64045-1-c_mykolak@mellanox.com
State Superseded, archived
Headers show

Commit Message

Mykola Kostenok July 11, 2017, 1:18 p.m. UTC
This binding adds description for interface supporting
aspeed-pwm-tacho driver cooling device creation.
This cooling device could be bound to a thermal zone
for the thermal control.

It adds extra level of hierarchy -  for tachometer channel
with fan subnodes and pwm channels with pwm subnodes.

Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
---
 .../devicetree/bindings/hwmon/aspeed-pwm-tacho.txt | 56 ++++++++++++++++++----
 1 file changed, 47 insertions(+), 9 deletions(-)

Comments

Rob Herring July 15, 2017, 1:33 a.m. UTC | #1
On Tue, Jul 11, 2017 at 04:18:27PM +0300, Mykola Kostenok wrote:
> This binding adds description for interface supporting
> aspeed-pwm-tacho driver cooling device creation.
> This cooling device could be bound to a thermal zone
> for the thermal control.

Bindings are for devices, not drivers.

 
> It adds extra level of hierarchy -  for tachometer channel
> with fan subnodes and pwm channels with pwm subnodes.

Why this binding was just added and now it is changing?

> 
> Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
> ---
>  .../devicetree/bindings/hwmon/aspeed-pwm-tacho.txt | 56 ++++++++++++++++++----
>  1 file changed, 47 insertions(+), 9 deletions(-)
Mykola Kostenok July 17, 2017, 11:05 a.m. UTC | #2
> -----Original Message-----
> From: Rob Herring [mailto:robh@kernel.org]
> Sent: Saturday, July 15, 2017 4:34 AM
> To: Mykola Kostenok <c_mykolak@mellanox.com>
> Cc: devicetree@vger.kernel.org; Guenter Roeck <linux@roeck-us.net>;
> Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>;
> openbmc@lists.ozlabs.org; Patrick Venture <venture@google.com>; Vadim
> Pasternak <vadimp@mellanox.com>; Ohad Oz <ohado@mellanox.com>
> Subject: Re: [patch v1] Documentation: dt-bindings: aspeed-pwm-tacho
> cooling device.
> 
> On Tue, Jul 11, 2017 at 04:18:27PM +0300, Mykola Kostenok wrote:
> > This binding adds description for interface supporting
> > aspeed-pwm-tacho driver cooling device creation.
> > This cooling device could be bound to a thermal zone for the thermal
> > control.
> 
> Bindings are for devices, not drivers.
> 
> 
> > It adds extra level of hierarchy -  for tachometer channel with fan
> > subnodes and pwm channels with pwm subnodes.
> 
> Why this binding was just added and now it is changing?
> 

Hi, Rob.
Thanks for reply.
 
This controller supports fan tacho channels and pwm channels. In the previous dts version, only tachometers channels were configurable.
We need to set pwm channels as cooling device, since we use it for the thermal control. So, these channels are added to dts as well.
And it added extra level hierarchy in dts.

For now this driver is used only by 2 two platforms: our Mellanox and Quanta (openbmc project).
We sent first this patch to openbmc first the for approval from the Quanta owners (Patrick Venture <venture@google.com> approved this change).
 
The support of this change in dts is introduce in the patch for drivers/hwmon/aspeed-pwm-tacho.c, which has been sent to hwmon maintainers.


Best regards. Mykola Kostenok.

> >
> > Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com>
> > ---
> >  .../devicetree/bindings/hwmon/aspeed-pwm-tacho.txt | 56
> > ++++++++++++++++++----
> >  1 file changed, 47 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt b/Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt
index cf4460564adb..df85aa70ed7f 100644
--- a/Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt
+++ b/Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt
@@ -23,9 +23,18 @@  Required properties for pwm-tacho node:
 - clocks : a fixed clock providing input clock frequency(PWM
 	   and Fan Tach clock)
 
+tach-channels subnode format:
+===================
+Under tach-channels subnode there can be fan child nodes.
+
+Required properties for tach-channels node:
+- #address-cells : should be 1.
+
+- #size-cells : should be 0.
+
 fan subnode format:
 ===================
-Under fan subnode there can upto 8 child nodes, with each child node
+Under fan subnode there can be upto 8 child nodes, with each child node
 representing a fan. If there are 8 fans each fan can have one PWM port and
 one/two Fan tach inputs.
 
@@ -39,6 +48,24 @@  Required properties for each child node:
 		Fan tach channel 0 and 15 indicating Fan tach channel 15.
 		Atleast one Fan tach input channel is required.
 
+pwm-channels subnode format:
+===================
+Under pwm-channels subnode there can be pwm child nodes.
+Required properties for tach-channels node:
+- #address-cells : should be 1.
+
+- #size-cells : should be 0.
+
+- #cooling-cells : should be 2;
+
+pwm subnode format:
+===================
+- reg : should be <0x00>.
+
+- cooling-levels      : PWM duty cycle values in a range from 0 to 255
+			which correspond to thermal cooling states.
+
+
 Examples:
 
 pwm_tacho_fixed_clk: fixedclk {
@@ -55,14 +82,25 @@  pwm_tacho: pwmtachocontroller@1e786000 {
 	clocks = <&pwm_tacho_fixed_clk>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;
-
-	fan@0 {
-		reg = <0x00>;
-		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
+	tach-channels {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		fan@0 {
+			reg = <0x00>;
+			aspeed,fan-tach-ch = /bits/ 8 <0x00>;
+		};
+		fan@1 {
+			reg = <0x01>;
+			aspeed,fan-tach-ch = /bits/ 8 <0x01 0x02>;
+		};
 	};
-
-	fan@1 {
-		reg = <0x01>;
-		aspeed,fan-tach-ch = /bits/ 8 <0x01 0x02>;
+	pwm-channels {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		#cooling-cells = <2>;
+		pwm@0 {
+			reg = <0x00>;
+			cooling-levels = /bits/ 8 <125 151 177 203 229 255>;
+		};
 	};
 };