Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755998AbbHGHSp (ORCPT ); Fri, 7 Aug 2015 03:18:45 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:33142 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754766AbbHGHSn convert rfc822-to-8bit (ORCPT ); Fri, 7 Aug 2015 03:18:43 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 7 Aug 2015 16:18:41 +0900 X-Google-Sender-Auth: RC0hNFOB_U8Znp42EOpD_sYqKDI Message-ID: Subject: Re: [PATCH] thermal: of: Introduce governor selection in dts From: Krzysztof Kozlowski To: =?UTF-8?B?Q2h1bmctWWloIFdhbmcgKOeOi+W0h+aHvyk=?= Cc: linux-kernel@vger.kernel.org, Zhang Rui , Eduardo Valentin , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linux-pm@vger.kernel.org, devicetree@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3721 Lines: 90 2015-08-07 16:09 GMT+09:00 Chung-Yih Wang (王崇懿) : > As there could be more thermal zones on a system and > more variety in thermal governors provided in kernel, > this patch provides flexibility of governor selection > for a thermal zone declared in device tree. How is this a property of a hardware, of a board? > > Change-Id: Ie4a75d762709cbbe9f1806dae325d13f71982e78 This tag should not go to upstream. Best regards, Krzysztof > Signed-off-by: Chung-yih Wang > --- > Documentation/devicetree/bindings/thermal/thermal.txt | 9 +++++++++ > drivers/thermal/of-thermal.c | 10 ++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt > b/Documentation/devicetree/bindings/thermal/thermal.txt > index 8a49362..30a5d41 100644 > --- a/Documentation/devicetree/bindings/thermal/thermal.txt > +++ b/Documentation/devicetree/bindings/thermal/thermal.txt > @@ -174,6 +174,13 @@ Optional property: > 2000mW, while on a 10'' tablet is around > 4500mW. > > +- thermal-governor-name: The name of governor used to control the > + thermal zone instead of the default one > + specified in kernel config. For reference, if > + default governor is step_wise, one could > + select power_allocator for cpu_thermal zone > + in dts. > + > 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 > @@ -555,6 +562,8 @@ thermal-zones { > > sustainable-power = <2500>; > > + thermal-governor-name = "power_allocator"; > + > 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 b295b2b..45570ac 100644 > --- a/drivers/thermal/of-thermal.c > +++ b/drivers/thermal/of-thermal.c > @@ -882,6 +882,7 @@ int __init of_parse_thermal_zones(void) > } > > for_each_child_of_node(np, child) { > + const char *governor_name; > struct thermal_zone_device *zone; > struct thermal_zone_params *tzp; > int i, mask = 0; > @@ -909,6 +910,15 @@ int __init of_parse_thermal_zones(void) > goto exit_free; > } > > + /* Select a preferred governor if declared */ > + if (!of_property_read_string(child, > + "thermal-governor-name", > + &governor_name)) { > + strncpy(tzp->governor_name, > + governor_name, > + sizeof(tzp->governor_name) - 1); > + } > + > /* No hwmon because there might be hwmon drivers registering */ > tzp->no_hwmon = true; > > -- > 2.1.2 > -- > To unsubscribe from this list: send the line "unsubscribe linux-pm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- 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/