Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754014AbaGJOUP (ORCPT ); Thu, 10 Jul 2014 10:20:15 -0400 Received: from service87.mimecast.com ([91.220.42.44]:36279 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbaGJOUM (ORCPT ); Thu, 10 Jul 2014 10:20:12 -0400 From: "Javi Merino" To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: punit.agrawal@arm.com, broonie@kernel.org, Zhang Rui , Eduardo Valentin Subject: [RFC PATCH v5 10/10] of: thermal: Introduce sustainable power for a thermal zone Date: Thu, 10 Jul 2014 15:18:48 +0100 Message-Id: <1405001928-12697-11-git-send-email-javi.merino@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405001928-12697-1-git-send-email-javi.merino@arm.com> References: <1405001928-12697-1-git-send-email-javi.merino@arm.com> X-OriginalArrivalTime: 10 Jul 2014 14:20:08.0298 (UTC) FILETIME=[0D6094A0:01CF9C4A] X-MC-Unique: 114071015201006401 Content-Type: text/plain; charset=WINDOWS-1252 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id s6AEKPxu009841 From: Punit Agrawal Introduce an optional property called, sustainable-power, which represents the power (in mW) which the thermal zone can safely dissipate. If provided the property is parsed and associated with the thermal zone via the thermal zone parameters. Cc: Zhang Rui Cc: Eduardo Valentin Signed-off-by: Punit Agrawal --- Documentation/devicetree/bindings/thermal/thermal.txt | 4 ++++ drivers/thermal/of-thermal.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index f5db6b72a36f..c6eb9a8d2aed 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -167,6 +167,10 @@ Optional property: by means of sensor ID. Additional coefficients are interpreted as constant offset. +- sustainable-power: An estimate of the sustainable power (in mW) that the + Type: unsigned thermal zone can dissipate. + Size: one cell + Note: The delay properties are bound to the maximum dT/dt (temperature derivative over time) in two situations for a thermal zone: (i) - when passive cooling is activated (polling-delay-passive); and diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 04b1be7fa018..eaf81ea654b9 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -769,6 +769,7 @@ int __init of_parse_thermal_zones(void) for_each_child_of_node(np, child) { struct thermal_zone_device *zone; struct thermal_zone_params *tzp; + u32 prop; tz = thermal_of_build_thermal_zone(child); if (IS_ERR(tz)) { @@ -791,6 +792,9 @@ int __init of_parse_thermal_zones(void) /* No hwmon because there might be hwmon drivers registering */ tzp->no_hwmon = true; + if (!of_property_read_u32(child, "sustainable-power", &prop)) + tzp->sustainable_power = prop; + zone = thermal_zone_device_register(child->name, tz->ntrips, 0, tz, ops, tzp, -- 1.9.1 -- 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/