diff mbox series

[1/4] dt-bindings: thermal: Introduce monitor-falling parameter to thermal trip point binding

Message ID 1568859503-19725-2-git-send-email-thara.gopinath@linaro.org
State New
Headers show
Series thermal: Introduce support for monitoring falling temperatures. | expand

Commit Message

Thara Gopinath Sept. 19, 2019, 2:18 a.m. UTC
Introduce a new binding parameter to thermal trip point description
to indicate whether the temperature level specified by the trip point
is monitored for a rise or fall in temperature.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

---
 Documentation/devicetree/bindings/thermal/thermal.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.1.4

Comments

Thara Gopinath Oct. 9, 2019, 12:54 p.m. UTC | #1
Hi Rob,
Thanks for the review.

On 10/01/2019 06:09 PM, Rob Herring wrote:
> On Wed, Sep 18, 2019 at 10:18:20PM -0400, Thara Gopinath wrote:

>> Introduce a new binding parameter to thermal trip point description

>> to indicate whether the temperature level specified by the trip point

>> is monitored for a rise or fall in temperature.

> 

> What if it is both?

> 

> When do you need this? Seems like you'd always want to monitor both 

> directions to undo any action done on rising temp. Unless you want a 

> hysteresis, but this doesn't seem like the best way to implement that.

> 


The thermal framework is designed in such a manner that I cannot think
of a use case for both.
The framework takes care of removing the warming/cooling action when the
trip point is crossed in the opposite direction. It only needs an
indication on when to start implementing the
action.
For eg. When the temperature crosses/increases above 90 degree, the
framework will start the cooling action and will continue monitoring
till the temperature falls below 90 and the cooling action is removed.
Vice versa when the temperature decreases below say 5 degree, the
framework should  initiate the warming action and monitor till the
temperature rises above and remove the warming action.

So the trip point is really an indication of the temperature crossing a
threshold in the specified direction.

Now this parameter is needed to indicate whether the thermal framework
has to start implementing the warming/cooling action when the
temperature  rises above the trip point or falls below the trip point.

Till now the framework was always assuming that the cooling action had
to be implemented when temperature rises above the trip point.

-- 
Warm Regards
Thara
Amit Kucheria Dec. 3, 2019, 4:53 p.m. UTC | #2
On Thu, Sep 19, 2019 at 7:48 AM Thara Gopinath
<thara.gopinath@linaro.org> wrote:
>

> Introduce a new binding parameter to thermal trip point description

> to indicate whether the temperature level specified by the trip point

> is monitored for a rise or fall in temperature.

>

> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>

> ---

>  Documentation/devicetree/bindings/thermal/thermal.txt | 8 ++++++++

>  1 file changed, 8 insertions(+)

>

> diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt

> index ca14ba9..849a2a9 100644

> --- a/Documentation/devicetree/bindings/thermal/thermal.txt

> +++ b/Documentation/devicetree/bindings/thermal/thermal.txt

> @@ -90,6 +90,14 @@ Required properties:

>         "critical":     Hardware not reliable.

>    Type: string

>

> +Optional property:

> +- monitor-falling:     Indicate whether the system action is kick


Stray space after :

> +  Type: boolean                started when the temperature falls below or rises


Unnecessary tab after boolean (I'll fix up the rest of the file in the
yaml conversion)

I suggest not making this boolean. Just use the property as a flag by
itself to denote a falling trip point. No need to deal with true/false
values.

Similarly, the sysfs file would show up only in case of a trip that
sets this flag and just contain a 1, for example.

> +                       above the trip temperature level indicated in

> +                       "temperature".If true, the trip point is monitored


Add space after full stop.


> +                       for falling temperature else the trip point is

> +                       monitored for rising temperature.

> +

>  * Cooling device maps

>

>  The cooling device maps node is a node to describe how cooling devices

> --

> 2.1.4

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt
index ca14ba9..849a2a9 100644
--- a/Documentation/devicetree/bindings/thermal/thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/thermal.txt
@@ -90,6 +90,14 @@  Required properties:
 	"critical":	Hardware not reliable.
   Type: string
 
+Optional property:
+- monitor-falling: 	Indicate whether the system action is kick
+  Type: boolean		started when the temperature falls below or rises
+			above the trip temperature level indicated in
+			"temperature".If true, the trip point is monitored
+			for falling temperature else the trip point is
+			monitored for rising temperature.
+
 * Cooling device maps
 
 The cooling device maps node is a node to describe how cooling devices