From patchwork Thu Feb 26 19:00:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 5895691 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 52DC39F37F for ; Thu, 26 Feb 2015 19:02:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA886203AA for ; Thu, 26 Feb 2015 19:02:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C09F32039C for ; Thu, 26 Feb 2015 19:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932358AbbBZTBy (ORCPT ); Thu, 26 Feb 2015 14:01:54 -0500 Received: from foss.arm.com ([217.140.101.70]:41785 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932213AbbBZTBx (ORCPT ); Thu, 26 Feb 2015 14:01:53 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7630620DF; Thu, 26 Feb 2015 11:02:07 -0800 (PST) Received: from collaborate-mta1.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTP id A03253F24F; Thu, 26 Feb 2015 11:01:52 -0800 (PST) Received: from e104805.cambridge.arm.com (e104805.cambridge.arm.com [10.2.131.108]) by collaborate-mta1.arm.com (Postfix) with SMTP id 0563F13F61A; Thu, 26 Feb 2015 13:01:48 -0600 (CST) Received: by e104805.cambridge.arm.com (sSMTP sendmail emulation); Thu, 26 Feb 2015 19:01:48 +0000 From: Javi Merino To: edubezval@gmail.com, rui.zhang@intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, punit.agrawal@arm.com, broonie@kernel.org, tixy@linaro.org Subject: [PATCH v2 6/7] of: thermal: Introduce sustainable power for a thermal zone Date: Thu, 26 Feb 2015 19:00:32 +0000 Message-Id: <1424977233-15965-7-git-send-email-javi.merino@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424977233-15965-1-git-send-email-javi.merino@arm.com> References: <1424977233-15965-1-git-send-email-javi.merino@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 9 +++++++++ drivers/thermal/of-thermal.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index 29fe0bfae38e..8a49362dea6e 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -167,6 +167,13 @@ 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 at the desired + Size: one cell control temperature. For reference, the + sustainable power of a 4'' phone is typically + 2000mW, while on a 10'' tablet is around + 4500mW. + 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 @@ -546,6 +553,8 @@ thermal-zones { */ coefficients = <1200 -345 890>; + sustainable-power = <2500>; + trips { /* Trips are based on resulting linear equation */ cpu_trip: cpu-trip { diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index c606b85ea9f4..705b21d01f1c 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -866,6 +866,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; /* Check whether child is enabled or not */ if (!of_device_is_available(child)) @@ -892,6 +893,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,