From patchwork Thu Oct 5 08:42:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tatarinov X-Patchwork-Id: 9986527 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 73EBD6029B for ; Thu, 5 Oct 2017 08:42:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 644F328AF6 for ; Thu, 5 Oct 2017 08:42:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5909828B11; Thu, 5 Oct 2017 08:42:21 +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 08A3B28AF6 for ; Thu, 5 Oct 2017 08:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbdJEImT (ORCPT ); Thu, 5 Oct 2017 04:42:19 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:52693 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbdJEImS (ORCPT ); Thu, 5 Oct 2017 04:42:18 -0400 Received: by mail-lf0-f66.google.com with SMTP id b127so16095649lfe.9 for ; Thu, 05 Oct 2017 01:42:17 -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=+Bh9Hacl84j3VvGQ/rMrGF6LH4S6Q8ls7h1Xep/u6jg=; b=UE95GOUN44//1cMm4zC+QQl0H51I86P8q+6BCLP60IS1bZcUCFG7ed/9YwbDCT/j66 rFKe6jgohtcxIdmkZnM+1K9tHqPMs4PW8ZPaJ8mSpL8Cafj/hSRxRoeq+Mmtno1eRqd7 3gnRJnBKZY8HCrRlYejg5UwzWI86vU1yaalvz9i0JhXzr6DzfpunKb6Ze3wlgrPUMd4K kkVtf2SIvkOXxy20YuY3KMQ4c54o7vNYiqfFwuGgLYiBd5ADGNM0uhoxm9TI8H5reOSw QR54vHdJfy4v3XOFwmHgQSU7AsjUU5jyleUrYXigCW8ZdIad3cdC4eWKN8dUkHWy+CsP fOrQ== 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=+Bh9Hacl84j3VvGQ/rMrGF6LH4S6Q8ls7h1Xep/u6jg=; b=Zb1WAfLNs3IVu3AvU+QwnjeRiRK4HEVtsy4b4VuMVzH34HQafasbY1SZ/SmZ5sg9FN FNm7m4IpMd5/tS3Mk81dSHIoc22yTrD4LJ9h/0t7k4UMhsrzNpdTzj+cR1PunKUjiLpP RpnlGH0fRIqXNj1KF1N7OY6+F/f7U9fYV6CpqvHobzqX3BnaBzW25EmjTyZu/X1f4X1E S8RgHBF5WjLJ36n2AKNjCVKFR4Ut1H8MSA7g+ZTv0irIu65mUSSk7ZfETL7y788RFRy3 bZWTOVSi33LcUQ8zqO0r0lFVS1RjNuzTPTU7cyfBWNGmV5lTUKXqgRxiP3vMX+Bf/tPy hrqg== X-Gm-Message-State: AMCzsaUj4qZAOgm38nffYAfwSLYF4aqkWgixhSd4c4jlugGT5wkhhtUp zv8EchRfzZHRsFAO8ku07ZVzluMq X-Google-Smtp-Source: AOwi7QAqL9UaJhcD5ggjqweo/TrSJ8rQH4ZtxZwih+YRbuyhWVfBbdKjm5BHYh58OSjh6Ncii2M29w== X-Received: by 10.25.141.196 with SMTP id p187mr7407457lfd.137.1507192936754; Thu, 05 Oct 2017 01:42:16 -0700 (PDT) Received: from n3331.dd.vaz.ru (pluto.dd.vaz.ru. [195.144.198.58]) by smtp.gmail.com with ESMTPSA id c74sm2868128lfe.49.2017.10.05.01.42.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Oct 2017 01:42:15 -0700 (PDT) From: Michael Tatarinov To: linux-pm@vger.kernel.org Cc: Michael Tatarinov , Zhang Rui , Eduardo Valentin Subject: [PATCH v2] of: thermal: Introduce "linux,hwmon" optional property Date: Thu, 5 Oct 2017 12:42:06 +0400 Message-Id: <20171005084206.2914-1-kukabu@gmail.com> X-Mailer: git-send-email 2.13.6 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 "linux,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 | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index 88b6ea1ad290..0dad55e77c7e 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. +- linux,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>; + linux,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..037ef6bb9420 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -994,8 +994,11 @@ int __init of_parse_thermal_zones(void) goto exit_free; } - /* No hwmon because there might be hwmon drivers registering */ - tzp->no_hwmon = true; + /** + * No hwmon by default because there might be 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;