[v4,5/8] ARM: dts: Add properties to use pwm-fan device as a cooling device in Odroid U3
diff mbox

Message ID 1424254056-5904-6-git-send-email-l.majewski@samsung.com
State Changes Requested
Delegated to: Eduardo Valentin
Headers show

Commit Message

Lukasz Majewski Feb. 18, 2015, 10:07 a.m. UTC
With those bindings it is possible to use pwm-fan device available in
Odroid U3 as a cooling device.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
---
Changes for v2:
- Rename cooling-pwm-values property to cooling-levels
Changes for v3:
- Change patch's topic to "ARM dts"
- Reduce maximal cooling-level to 230 from 255
Changes for v4:
- None
---
 arch/arm/boot/dts/exynos4412-odroidu3.dts | 33 ++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

Comments

Eduardo Valentin Feb. 24, 2015, 7:37 p.m. UTC | #1
On Wed, Feb 18, 2015 at 11:07:33AM +0100, Lukasz Majewski wrote:
> With those bindings it is possible to use pwm-fan device available in
> Odroid U3 as a cooling device.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> ---
> Changes for v2:
> - Rename cooling-pwm-values property to cooling-levels
> Changes for v3:
> - Change patch's topic to "ARM dts"
> - Reduce maximal cooling-level to 230 from 255
> Changes for v4:
> - None
> ---
>  arch/arm/boot/dts/exynos4412-odroidu3.dts | 33 ++++++++++++++++++++++++++++++-
>  1 file changed, 32 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts
> index 60bd1e4..3e5df3e 100644
> --- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
> +++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
> @@ -32,11 +32,42 @@
>  		};
>  	};
>  
> -	pwm-fan {
> +	fan0: pwm-fan {
>  		compatible = "pwm-fan";
>  		pwms = <&pwm 0 10000 0>;
> +		cooling-min-state = <0>;
> +		cooling-max-state = <3>;
> +		#cooling-cells = <2>;
> +		cooling-levels = <0 102 170 230>;
>  		status = "okay";
>  	};
> +
> +	thermal-zones {
> +		cpu_thermal: cpu-thermal {


This thermal zone misses the mandatory properties as per 
 Documentation/devicetree/bindings/thermal/thermal.txt

> +			cooling-maps {
> +				map0 {
> +				     trip = <&cpu_alert1>;
> +				     cooling-device = <&cpu0 7 7>;
> +				};
> +				map1 {
> +				     trip = <&cpu_alert2>;
> +				     cooling-device = <&cpu0 13 13>;
> +				};
> +				map2 {
> +				     trip = <&cpu_alert0>;
> +				     cooling-device = <&fan0 0 1>;
> +				};
> +				map3 {
> +				     trip = <&cpu_alert1>;
> +				     cooling-device = <&fan0 1 2>;
> +				};
> +				map4 {
> +				     trip = <&cpu_alert2>;
> +				     cooling-device = <&fan0 2 3>;
> +				};
> +			};
> +		};
> +	};
>  };
>  
>  &pwm {
> -- 
> 2.0.0.rc2
>
Lukasz Majewski Feb. 25, 2015, 1:28 p.m. UTC | #2
Hi Eduardo,

> On Wed, Feb 18, 2015 at 11:07:33AM +0100, Lukasz Majewski wrote:
> > With those bindings it is possible to use pwm-fan device available
> > in Odroid U3 as a cooling device.
> > 
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > ---
> > Changes for v2:
> > - Rename cooling-pwm-values property to cooling-levels
> > Changes for v3:
> > - Change patch's topic to "ARM dts"
> > - Reduce maximal cooling-level to 230 from 255
> > Changes for v4:
> > - None
> > ---
> >  arch/arm/boot/dts/exynos4412-odroidu3.dts | 33
> > ++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1
> > deletion(-)
> > 
> > diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts
> > b/arch/arm/boot/dts/exynos4412-odroidu3.dts index 60bd1e4..3e5df3e
> > 100644 --- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
> > +++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
> > @@ -32,11 +32,42 @@
> >  		};
> >  	};
> >  
> > -	pwm-fan {
> > +	fan0: pwm-fan {
> >  		compatible = "pwm-fan";
> >  		pwms = <&pwm 0 10000 0>;
> > +		cooling-min-state = <0>;
> > +		cooling-max-state = <3>;
> > +		#cooling-cells = <2>;
> > +		cooling-levels = <0 102 170 230>;
> >  		status = "okay";
> >  	};
> > +
> > +	thermal-zones {
> > +		cpu_thermal: cpu-thermal {
> 
> 
> This thermal zone misses the mandatory properties as per 
>  Documentation/devicetree/bindings/thermal/thermal.txt

Following mandatory properties:
		thermal-sensors = <&tmu 0>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		trips {

		}

are defined in exynos4-cpu-thermal.dtsi included by this file.

In this patch only device dependent changes are stated.

> 
> > +			cooling-maps {
> > +				map0 {
> > +				     trip = <&cpu_alert1>;
> > +				     cooling-device = <&cpu0 7 7>;
> > +				};
> > +				map1 {
> > +				     trip = <&cpu_alert2>;
> > +				     cooling-device = <&cpu0 13
> > 13>;
> > +				};
> > +				map2 {
> > +				     trip = <&cpu_alert0>;
> > +				     cooling-device = <&fan0 0 1>;
> > +				};
> > +				map3 {
> > +				     trip = <&cpu_alert1>;
> > +				     cooling-device = <&fan0 1 2>;
> > +				};
> > +				map4 {
> > +				     trip = <&cpu_alert2>;
> > +				     cooling-device = <&fan0 2 3>;
> > +				};
> > +			};
> > +		};
> > +	};
> >  };
> >  
> >  &pwm {
> > -- 
> > 2.0.0.rc2
> >
Eduardo Valentin Feb. 25, 2015, 6:30 p.m. UTC | #3
On Wed, Feb 25, 2015 at 02:28:15PM +0100, Lukasz Majewski wrote:
> Hi Eduardo,
> 
> > On Wed, Feb 18, 2015 at 11:07:33AM +0100, Lukasz Majewski wrote:
> > > With those bindings it is possible to use pwm-fan device available
> > > in Odroid U3 as a cooling device.
> > > 
> > > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > > ---
> > > Changes for v2:
> > > - Rename cooling-pwm-values property to cooling-levels
> > > Changes for v3:
> > > - Change patch's topic to "ARM dts"
> > > - Reduce maximal cooling-level to 230 from 255
> > > Changes for v4:
> > > - None
> > > ---
> > >  arch/arm/boot/dts/exynos4412-odroidu3.dts | 33
> > > ++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1
> > > deletion(-)
> > > 
> > > diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts
> > > b/arch/arm/boot/dts/exynos4412-odroidu3.dts index 60bd1e4..3e5df3e
> > > 100644 --- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
> > > +++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
> > > @@ -32,11 +32,42 @@
> > >  		};
> > >  	};
> > >  
> > > -	pwm-fan {
> > > +	fan0: pwm-fan {
> > >  		compatible = "pwm-fan";
> > >  		pwms = <&pwm 0 10000 0>;
> > > +		cooling-min-state = <0>;
> > > +		cooling-max-state = <3>;
> > > +		#cooling-cells = <2>;
> > > +		cooling-levels = <0 102 170 230>;
> > >  		status = "okay";
> > >  	};
> > > +
> > > +	thermal-zones {
> > > +		cpu_thermal: cpu-thermal {
> > 
> > 
> > This thermal zone misses the mandatory properties as per 
> >  Documentation/devicetree/bindings/thermal/thermal.txt
> 
> Following mandatory properties:
> 		thermal-sensors = <&tmu 0>;
> 		polling-delay-passive = <0>;
> 		polling-delay = <0>;
> 		trips {
> 
> 		}
> 
> are defined in exynos4-cpu-thermal.dtsi included by this file.
> 
> In this patch only device dependent changes are stated.

OK. I missed that.



> 
> > 
> > > +			cooling-maps {
> > > +				map0 {
> > > +				     trip = <&cpu_alert1>;
> > > +				     cooling-device = <&cpu0 7 7>;
> > > +				};
> > > +				map1 {
> > > +				     trip = <&cpu_alert2>;
> > > +				     cooling-device = <&cpu0 13
> > > 13>;
> > > +				};
> > > +				map2 {
> > > +				     trip = <&cpu_alert0>;
> > > +				     cooling-device = <&fan0 0 1>;
> > > +				};
> > > +				map3 {
> > > +				     trip = <&cpu_alert1>;
> > > +				     cooling-device = <&fan0 1 2>;
> > > +				};
> > > +				map4 {
> > > +				     trip = <&cpu_alert2>;
> > > +				     cooling-device = <&fan0 2 3>;
> > > +				};
> > > +			};
> > > +		};
> > > +	};
> > >  };
> > >  
> > >  &pwm {
> > > -- 
> > > 2.0.0.rc2
> > > 
> 
> 
> 
> -- 
> Best regards,
> 
> Lukasz Majewski
> 
> Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

Patch
diff mbox

diff --git a/arch/arm/boot/dts/exynos4412-odroidu3.dts b/arch/arm/boot/dts/exynos4412-odroidu3.dts
index 60bd1e4..3e5df3e 100644
--- a/arch/arm/boot/dts/exynos4412-odroidu3.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidu3.dts
@@ -32,11 +32,42 @@ 
 		};
 	};
 
-	pwm-fan {
+	fan0: pwm-fan {
 		compatible = "pwm-fan";
 		pwms = <&pwm 0 10000 0>;
+		cooling-min-state = <0>;
+		cooling-max-state = <3>;
+		#cooling-cells = <2>;
+		cooling-levels = <0 102 170 230>;
 		status = "okay";
 	};
+
+	thermal-zones {
+		cpu_thermal: cpu-thermal {
+			cooling-maps {
+				map0 {
+				     trip = <&cpu_alert1>;
+				     cooling-device = <&cpu0 7 7>;
+				};
+				map1 {
+				     trip = <&cpu_alert2>;
+				     cooling-device = <&cpu0 13 13>;
+				};
+				map2 {
+				     trip = <&cpu_alert0>;
+				     cooling-device = <&fan0 0 1>;
+				};
+				map3 {
+				     trip = <&cpu_alert1>;
+				     cooling-device = <&fan0 1 2>;
+				};
+				map4 {
+				     trip = <&cpu_alert2>;
+				     cooling-device = <&fan0 2 3>;
+				};
+			};
+		};
+	};
 };
 
 &pwm {