mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Alexandre Bailon <abailon@baylibre.com>,
	rafael@kernel.org, rui.zhang@intel.com, amitk@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	ben.tseng@mediatek.com, khilman@baylibre.com, mka@chromium.org
Subject: Re: [PATCH v4 RESEND 1/2] dt-bindings: Add DT bindings for the DT-based virtual sensor driver
Date: Fri, 4 Feb 2022 09:08:10 +0100	[thread overview]
Message-ID: <59897307-042e-932e-6b02-257cabacaaa4@linaro.org> (raw)
In-Reply-To: <20220111103346.2660639-2-abailon@baylibre.com>

On 11/01/2022 11:33, Alexandre Bailon wrote:
> This adds the DT bindings for the DT-based virtual sensor driver.
> This driver provides a way, using DT, to aggregate the temperature
> of multiple thermal zones and get some useful data from it.
> 
> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
> ---

[ ... ]

> +description: |
> +  The virtual thermal sensor device provides a way to aggregate the temperature
> +  from multiple thermal zones. Basically, this could be used to get the
> +  maximum, minimum or average temperature.
> +
> +allOf:
> +  - $ref: thermal-sensor.yaml#
> +
> +properties:
> +  compatible:
> +    const: virtual,thermal-sensor
> +
> +  aggregation-function:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Used to select the operations to perform on the sensors to get the virtual
> +      sensor temperature.
> +    enum:
> +      - VIRTUAL_THERMAL_SENSOR_MIN_VAL
> +      - VIRTUAL_THERMAL_SENSOR_MAX_VAL
> +      - VIRTUAL_THERMAL_SENSOR_AVG_VAL
> +
> +  thermal-sensors:
> +    $ref: /schemas/types.yaml#/definitions/string-array
> +    description:
> +      The names of the thermal zone to aggregate.

IMO this is not correct. We are dealing with virtual sensor in order to 
aggregate a group of sensors in a thermal zone. But actually this 
description aggregates the thermal zones.

I recalled a detail about the binding from the old 'txt' format from [1].

"- thermal-sensors: A list of thermal sensor phandles and sensor specifier

    Type: list of phandles + sensor specifier used while monitoring the 
thermal zone."

This information was lost in the conversion to yaml with commit 
1202a442a31fd

In addition, the "coefficients" property tells the 'thermal-sensors' 
property can have multiple sensors.

So actually, the bindings should be fixed as part of the information was 
lost during of the txt -> yaml conversion.

And the multiple sensors per thermal zone could be implemented as that 
was something planned since a while.

I realize we initially asked to create a virtual sensor but that is not 
the most adequate ATM. Doing the multiple sensors support makes more 
sense to me, especially it does not require any extra binding except an 
attribute tell what kind of temperature aggregation we do. Defaulting to 
max should suffice when no aggregation method is set.

   -- Daniel

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/thermal/thermal.txt?h=v4.5#n147



-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2022-02-04  8:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 10:33 [PATCH v4 RESEND 0/2] Add a generic virtual thermal sensor Alexandre Bailon
2022-01-11 10:33 ` [PATCH v4 RESEND 1/2] dt-bindings: Add DT bindings for the DT-based virtual sensor driver Alexandre Bailon
2022-02-04  8:08   ` Daniel Lezcano [this message]
2022-01-11 10:33 ` [PATCH v4 RESEND 2/2] thermal: add a virtual sensor to aggregate temperatures Alexandre Bailon
2022-01-24 16:58 ` [PATCH v4 RESEND 0/2] Add a generic virtual thermal sensor Kevin Hilman
2022-01-24 18:52   ` Rafael J. Wysocki
2022-01-24 21:23     ` Kevin Hilman
2022-01-28 19:34       ` Rafael J. Wysocki
2022-02-01 18:43         ` Kevin Hilman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59897307-042e-932e-6b02-257cabacaaa4@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=abailon@baylibre.com \
    --cc=amitk@kernel.org \
    --cc=ben.tseng@mediatek.com \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®