From patchwork Mon Apr 20 22:21:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 462927 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 24F411402E1 for ; Tue, 21 Apr 2015 08:21:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=DeJSGvp4; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbbDTWVi (ORCPT ); Mon, 20 Apr 2015 18:21:38 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:34575 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbbDTWVi (ORCPT ); Mon, 20 Apr 2015 18:21:38 -0400 Received: by iedfl3 with SMTP id fl3so759673ied.1; Mon, 20 Apr 2015 15:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=NlR5bS3/uGQVVaj93do2iSuNjX5Hg6y4HTsCH+v4+NY=; b=DeJSGvp4ngfDKpM59qESUSaNZVyvwCzE3FxFOV25iAQF3IotBsJXnAJwnVn53m1Wi+ UsRm3zjMdrylVvaP8ywseCDxuvkuMqTN+VQdhUIdfQar2UsFS6niwtwyD/tBJpomq4E6 tqsnD2VOAgnnoO6mmITd7dvanHLwl2JAZlqHhwHsd0ZkN25gxXaf2wzolyKmw/PnZDZf ud9/X20xbjI2JXZ5l5ONCTdko1VxuAotqkEvL/604QHHhEZaXnRG34tcMmkJ66OE9XnL hhtYCEecB55a2CU7lZgVVE8IFbai7ctptmm5W47hWBVeYscUaof8qlxP3f4hk9wl1H44 UjKg== X-Received: by 10.107.148.144 with SMTP id w138mr25173372iod.12.1429568495358; Mon, 20 Apr 2015 15:21:35 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:b4a4:15d2:d9fe:1711]) by mx.google.com with ESMTPSA id qo11sm193462igb.17.2015.04.20.15.21.33 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 20 Apr 2015 15:21:34 -0700 (PDT) Date: Mon, 20 Apr 2015 15:21:31 -0700 From: Dmitry Torokhov To: Eduardo Valentin Cc: Rob Herring , Zhang Rui , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: allow creating hwmon for thermal zones on OF systems Message-ID: <20150420222131.GA6077@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Current implementation forcibly suppresses creation of hwmon instances for thermal zones defined in device tree data. Let's add a new property, "linux,hwmon" to allow marking certain thermal zones as needing generic hwmon interface. Signed-off-by: Dmitry Torokhov --- Documentation/devicetree/bindings/thermal/thermal.txt | 4 ++++ drivers/thermal/of-thermal.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index 8a49362..0106f8f 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -174,6 +174,10 @@ Optional property: 2000mW, while on a 10'' tablet is around 4500mW. +- linux,hwmon: A boolean property that instructs Linux thermal core + to create an instance of hwmon device representing + this thermal zone. + 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 9e8c614..7b7a70c 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -891,8 +891,11 @@ int __init of_parse_thermal_zones(void) goto exit_free; } - /* No hwmon because there might be hwmon drivers registering */ - tzp->no_hwmon = true; + /* + * Do not attach hwmon device unless explicitly requested, + * since there might be dedicated hwmon drivers registering. + */ + tzp->no_hwmon = !of_property_read_bool(child, "linux,hwmon"); if (!of_property_read_u32(child, "sustainable-power", &prop)) tzp->sustainable_power = prop;