Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1452954pxm; Thu, 24 Feb 2022 03:33:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzp0qanKnikCNdiXkQGyPLmsJgW55qKCiZdZXCwzgwLSGj0y0wFt9JOPb9g4W/2i5m/I+vx X-Received: by 2002:a50:cccf:0:b0:410:ba4e:65fd with SMTP id b15-20020a50cccf000000b00410ba4e65fdmr1864757edj.31.1645702381597; Thu, 24 Feb 2022 03:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645702381; cv=none; d=google.com; s=arc-20160816; b=TgUmtysBPkNBGiQlm6zPAy+i9UyaE0YMXt4YJIF6McgbUaOq47YN/1HeP0q+VJBLL7 wdGm9a78NELxe88UGLuUJsGfoqlC0090DrSdXwukD3AiSHYktq7LLEd8vZdTearDONFR tlOTJAAYl459XLprxPfgoxL8SahjUbhBPL87XRnzad/oVGhz19unUPBRknGFA8fD3qNE VBCgrBf9uY8gAfadA6JAXPPBunEpuw/4lxe0OVQp+Rb9kQiIgFh/etuIj6cAPjRrYkb3 T83pyr/HIzafP58ncbyJa4W+mjtjuq5rggeUD4qbOLUI7e/7kbx49uAhCT5ksIVhej4O njcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cvKgWT75YNWCz545dId4xR2Ur4aFE/XebHBrnqe+U5o=; b=hTT+lbRSNyBiaIOJu+/Sc9LG6SZdf3cK/TFLgG1KdwJsj3CZ5V6yuBmIO9wXBQnZgG BAZ1qX8lYdTqM90/n/Q/15Uw0IxDsBmxsqgweHGOXxFIYzk6zOV6icjmvRsEYPOg55Pw XDbqs65iHd10tdlxU956+Zh4ZtUFc8Q/z/CJLNqABnI4mccu6l5Nt4CrtkNN4y9yocjB 8c04vqGhZhnSHAKGWmIck+QjdGJBRIjbnPJB4+mp3VCapVQfbDZ2OZz2oekUzslSKlgE DAAoX9kXZK6Qk1xtAn99fANt74oKzZaLg+YQT1Ou9x/t4lhmIaap4A2F7L4nTLEtMZB9 Rbjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QS46/JJp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a26si1324328eje.227.2022.02.24.03.32.37; Thu, 24 Feb 2022 03:33:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QS46/JJp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233093AbiBXKAr (ORCPT + 99 others); Thu, 24 Feb 2022 05:00:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbiBXKAq (ORCPT ); Thu, 24 Feb 2022 05:00:46 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 040DD14994E for ; Thu, 24 Feb 2022 02:00:17 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id c192so771832wma.4 for ; Thu, 24 Feb 2022 02:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=cvKgWT75YNWCz545dId4xR2Ur4aFE/XebHBrnqe+U5o=; b=QS46/JJpgvK0E9Hksyx9FuwMUJYpWc0wFaEzvUDevpX6J5/9e3jyF+Kc876uNdhQHr Wqmret9M+dr7YxkPMZy+eAYFPgczqqm98JU7kYv5gLwiyeJxj6YgXoaiWHunDJu+pMHc aIDn+T0cTm3Ks/tuRRIikq4ZzBHdVO0/l9Cv2czGpWun8b/7dBqlEAzqYrD24wVjEtG0 AGfm5Xrt3cxYO3u1vFvKyJI8cRHgR0clKJ/b0Anc0Wk6TIAY8jdutUsGH4C4QofALEqY cJy6ReFUBlU0JpEAwEHxxCLZ/SwjXwX9CHM1n3qGpQIyEnPSCBKxgfsFPb8gGxpOJA30 b4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=cvKgWT75YNWCz545dId4xR2Ur4aFE/XebHBrnqe+U5o=; b=dTbvDVvMXRD8+BIvfzPt9SE7Q8TxArfc4xcQ5E5GrN6ENMg4gxZJy7WCi+6jCAwidX hS8d7vJUfcV0t0RryJ8rP99FZNxTgTdy9JzmnwIcpptritiAqBaS6JqcYfvaTAuhRJRm /WrugJnKNJXZkLbgF499EIweWT16OFqQRy0BV69Tpco5rs0wn9cfJ/mnSiSQaCp12cgQ ts7lv1B3pNAI+y9IOdVTSnD4lVBskY/d0tjspNS9H3k1zukeWjAM9fxELxbPzlQ9QnHW yY8tRW+b/3wZydm0EFU/dxk7Wb66gEHtsVdA44ROMltzLncZcEwk/elaG5ACj5OVAk+b 4xCA== X-Gm-Message-State: AOAM533Lnlgbryjh2HChv5J793pe94mGmz1Cl14zuInl7A9qlbfh47/S GnbWj3fU0AmqtOS+8eBsTLkdpw== X-Received: by 2002:a05:600c:692:b0:37b:c64f:a66d with SMTP id a18-20020a05600c069200b0037bc64fa66dmr11054638wmn.165.1645696815426; Thu, 24 Feb 2022 02:00:15 -0800 (PST) Received: from ?IPV6:2a01:e34:ed2f:f020:aa9c:55a2:dfa7:adcf? ([2a01:e34:ed2f:f020:aa9c:55a2:dfa7:adcf]) by smtp.googlemail.com with ESMTPSA id 7sm2776349wrb.43.2022.02.24.02.00.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 02:00:14 -0800 (PST) Message-ID: Date: Thu, 24 Feb 2022 11:00:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 1/2] dt-bindings: thermal: Update the bindings to support multiple sensors Content-Language: en-US To: Alexandre Bailon , 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 References: <20220218084604.1669091-1-abailon@baylibre.com> <20220218084604.1669091-2-abailon@baylibre.com> From: Daniel Lezcano In-Reply-To: <20220218084604.1669091-2-abailon@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, thanks for your series On 18/02/2022 09:46, Alexandre Bailon wrote: > This adds two optionals properties and update the thermal-sensors > property description to support multiple sensors with a thermal zone. I think it would make sense to first send a patch fixing the missing attribute from txt -> yaml translation with the Fixes tag which was: "A list of thermal sensor phandles and sensor specifier Type: list of used while monitoring the thermal zone" And add in the description if there are more than one sensor, then the max value will be returned. Then provide the code to get the max value. The second series of changes would be the other aggregations and the implementation. > --- > .../bindings/thermal/thermal-zones.yaml | 30 +++++++++++++++++-- > 1 file changed, 27 insertions(+), 3 deletions(-) > > diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml > index 2d34f3ccb2572..9f944c2364589 100644 > --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml > +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml > @@ -77,10 +77,24 @@ patternProperties: > > thermal-sensors: > $ref: /schemas/types.yaml#/definitions/phandle-array > - maxItems: 1 > description: > - The thermal sensor phandle and sensor specifier used to monitor this > - thermal zone. > + An array of thermal sensor phandle and sensor specifier used to > + monitor this thermal zone. > + If the array contains more than one sensor then the returned value > + is the maximum unless aggregation-min or aggregation-avg properties > + are set. > + > + aggregation-min: > + type: boolean > + description: > + Return the minimum temperature when the thermal monitor multiple > + sensors. > + > + aggregation-avg: > + type: boolean > + description: > + Return the average temperature when the thermal monitor multiple > + sensors. Maybe 'aggregation' could be a string? aggregation = "max"; aggregation = "min"; aggregation = "avg"; It should be in the optional section and probably a conditional if thermal-sensors has more than one item > coefficients: > $ref: /schemas/types.yaml#/definitions/uint32-array > @@ -338,5 +352,15 @@ examples: > }; > }; > }; > + > + /* ... */ > + > + soc-max-thermal { > + polling-delay-passive = <250>; > + polling-delay = <1000>; > + thermal-sensors = <&tsens0 5>, <&tsens0 11>; > + trips {}; > + cooling-maps {}; > + }; > }; > ... -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog