Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbbKYSl5 (ORCPT ); Wed, 25 Nov 2015 13:41:57 -0500 Received: from foss.arm.com ([217.140.101.70]:41637 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755AbbKYSlt (ORCPT ); Wed, 25 Nov 2015 13:41:49 -0500 Date: Wed, 25 Nov 2015 18:41:44 +0000 From: Javi Merino To: Mark Rutland Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rui.zang@intel.com, edubezval@gmail.com, Zhang Rui , Rob Herring , Pawel Moll , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org Subject: Re: [PATCH v3 2/4] devicetree: bindings: let thermal-sensor point to other thermal zones Message-ID: <20151125184144.GA24866@e104805> References: <1448464186-26289-1-git-send-email-javi.merino@arm.com> <1448464186-26289-3-git-send-email-javi.merino@arm.com> <20151125175441.GA32343@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151125175441.GA32343@leverpostej> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3551 Lines: 81 On Wed, Nov 25, 2015 at 05:54:41PM +0000, Mark Rutland wrote: > On Wed, Nov 25, 2015 at 03:09:44PM +0000, Javi Merino wrote: > > The thermal-sensor property of the thermal zone node accepts phandles to > > thermal sensors. However, thermal zones can be created as an > > aggregation of other thermal zones. Extend the thermal-sensors property > > to allow phandles to other thermal zones. This patch also adds an > > example that showcases how a board thermal zone can be created from the > > aggregation of the cpu, gpu and lcd thermal zones. > > > > Cc: Zhang Rui > > Cc: Eduardo Valentin > > Cc: Rob Herring > > Cc: Pawel Moll > > Cc: Mark Rutland > > Cc: Ian Campbell > > Cc: Kumar Gala > > Cc: devicetree@vger.kernel.org > > Signed-off-by: Javi Merino > > --- > > > > Notes: > > Hi devicetree, > > > > Is it ok to extend the definition of the thermal-sensors property like > > this? IOW are phandles strongly typed? > > I think it's OK so long as each thermal zone has #thermal-sensor-cells > set explicitly, if used as a sensor, and we can agree on the semantics > of what it means for a thermal zone to be a sensor. > > I don't really follow why you need the zone to be a sensor, and can't > simply refer to the sensor from two zones. Are you trying to imply an > ordering of trip points (e.g. that the sub-zones' trips should be taken > into account first)? No, it doesn't affect the ordering of trip points. This came out of a discussion at LPC. Currently thermal zones can only have on thermal sensor associated with them. After some discussion, Mike Turquette suggested that we could use an approach similar to what it's done with power domains and stack them. > > .../devicetree/bindings/thermal/thermal.txt | 154 ++++++++++++++++++++- > > 1 file changed, 151 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt > > index 41b817f7b670..52b7e9ae3b4d 100644 > > --- a/Documentation/devicetree/bindings/thermal/thermal.txt > > +++ b/Documentation/devicetree/bindings/thermal/thermal.txt > > @@ -145,9 +145,12 @@ Required properties: > > Size: one cell > > > > - thermal-sensors: A list of thermal sensor phandles and sensor specifier > > - Type: list of used while monitoring the thermal zone. > > - phandles + sensor > > - specifier > > + Type: list of used while monitoring the thermal zone. The phandles > > + phandles + sensor can point to thermal sensors or other thermal zone > > + specifier nodes. If it points to other thermal zone > > + nodes you should omit the sensor specifier > > + and set #thermal-sensor-cells to 0 for the > > + thermal zone. > > The example misses #thermal-sensor-cells = <0> for each of the zones. You're right, I'll fix it for the next version > Can a zone normal have multiple sensors? If so, what is the aggregate > value if a zone is used as a sensor? Max? Min? Scaled by contribution > somehow? No, currently a thermal zone can only specify one sensor in its thermal-sensors property Cheers, Javi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/