From patchwork Mon Jul 10 11:51:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tatarinov X-Patchwork-Id: 9832799 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E8BDC60318 for ; Mon, 10 Jul 2017 11:52:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7EA326212 for ; Mon, 10 Jul 2017 11:52:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB189274D2; Mon, 10 Jul 2017 11:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D088926212 for ; Mon, 10 Jul 2017 11:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753681AbdGJLwP (ORCPT ); Mon, 10 Jul 2017 07:52:15 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34641 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753224AbdGJLwO (ORCPT ); Mon, 10 Jul 2017 07:52:14 -0400 Received: by mail-lf0-f67.google.com with SMTP id g21so10040150lfk.1 for ; Mon, 10 Jul 2017 04:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YYW2F1Nv4Hw3O5KgXFQKQoO1k8A/cN0UykfIZYttxbo=; b=S4xzcfZ0l5YVGIN08Z7ppKTERLAFWu2QGPSl7tgzAw4YywA2EnI2em1JNk1ZeE+hTe S7mTBzvLGFgPqy4AnCjWv7LzMV0FKxI9ZKlEePoUY1VKRVsfNrIfB+4P09z3+K/V4wiR 7xyowVXywhD47qZ+55o1isGrt/2dyGy7xNvX4vxFsqjy3EcyglLQT5l7sYsqtmPwjxKp 5bGcEiGilx+jEiLw5RkRXha5hC1kv2VYDxCjTnmU3fEwWyfMSYXV3gjmfiPkyRaFt/NF +9ORpOLu6QCqE3ab23UXyHIrLD56cPvTRYdCNK1oiUfDg84QLyqAlPqgB8oVSeQHafXz tYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YYW2F1Nv4Hw3O5KgXFQKQoO1k8A/cN0UykfIZYttxbo=; b=YtQf2GT62Gz7nAUToxF0lNVtW46JPpZqx7kamGeI+7e1Mq9fd/3MKxElaK6UFUc5tJ d+9ErGaejUlbb6y2kdKoE44xdlA+/lQctKCyVKOsLueP5p7gtnmTed4bZm1ksvrCSdb5 WHP1dPs4TpTede9Oef2lM+Tz8O67qNqJKsnCbvEssDzK/c7KTAUcvEVNmHhCfQJe5Z7v DqzheqIYbB/X+8QmN1kUKErf8Oa9eOnKgbI1ldLw5BjrLAxBfrNjJ822FeSk3+QAdGfA xY2Oe0O1btBjYZAlED+ZLpL89yS8t78Wwu6uC+x1+q04wfNMhXxCJvlWkUFlmo2PEH+Q 4kZg== X-Gm-Message-State: AIVw112FdP1+q8iFbj3cFjpkbNfXr6GcQ96bho7gsMVF1iXRCnJEMAkE I0+9eEVzlDkKnQapnn4= X-Received: by 10.25.20.212 with SMTP id 81mr1066792lfu.116.1499687532811; Mon, 10 Jul 2017 04:52:12 -0700 (PDT) Received: from n3331.dd.vaz.ru (pluto.dd.vaz.ru. [195.144.198.58]) by smtp.gmail.com with ESMTPSA id 10sm2314494ljo.27.2017.07.10.04.52.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 04:52:12 -0700 (PDT) From: Michael Tatarinov To: linux-pm@vger.kernel.org Cc: Michael Tatarinov , Zhang Rui , Eduardo Valentin Subject: [PATCH] of: thermal: Introduce "hwmon" optional property Date: Mon, 10 Jul 2017 15:51:46 +0400 Message-Id: <20170710115146.27313-1-kukabu@gmail.com> X-Mailer: git-send-email 2.9.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce an optional property called, hwmon, which enable registration in hwmon subsystems. Cc: Zhang Rui Cc: Eduardo Valentin Signed-off-by: Michael Tatarinov --- Documentation/devicetree/bindings/thermal/thermal.txt | 6 ++++++ drivers/thermal/of-thermal.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index 88b6ea1ad290..4e51fbd4efa2 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -175,6 +175,10 @@ Optional property: 2000mW, while on a 10'' tablet is around 4500mW. +- hwmon: Register the thermal zone in hwmon subsystems + Type: boolean (requires CONFIG_THERMAL_HWMON). + 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 @@ -556,6 +560,8 @@ thermal-zones { sustainable-power = <2500>; + hwmon; + 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 d04ec3b9e5ff..ce580a57313b 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -994,8 +994,7 @@ int __init of_parse_thermal_zones(void) goto exit_free; } - /* No hwmon because there might be hwmon drivers registering */ - tzp->no_hwmon = true; + tzp->no_hwmon = !of_property_read_bool(child, "hwmon"); if (!of_property_read_u32(child, "sustainable-power", &prop)) tzp->sustainable_power = prop;