From patchwork Sun Mar 12 19:07:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9619513 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 E3C4D60417 for ; Sun, 12 Mar 2017 19:08:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D79A12847B for ; Sun, 12 Mar 2017 19:08:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC33128482; Sun, 12 Mar 2017 19:08:08 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9FC0E2847B for ; Sun, 12 Mar 2017 19:08:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935094AbdCLTIH (ORCPT ); Sun, 12 Mar 2017 15:08:07 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:45634 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934142AbdCLTIG (ORCPT ); Sun, 12 Mar 2017 15:08:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From; bh=1VITjpJATzFMhXakevoKtfsukxf5fAxu0AmWH5U/xjY=; b=mwojlHPdWapBhuJ2pY/8dyyybnf++/NQCxaK7RDKa8IxphHD3xzFn6xT51wfPynKwlf2K152AeDMZRuw6rCxY/4TPMaxSoDrX0qZJ0K0b3TnGxHqCEAI2vcXL38yjcreR6WojDasxuTZCQgs2kTugPpd1hAxwfdfLezz5HrSV6A=; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:60610 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1cn8qD-0007eX-MS; Sun, 12 Mar 2017 19:07:41 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1cn8qC-0002uz-PB; Sun, 12 Mar 2017 19:07:40 +0000 From: Russell King To: Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 1/3] thermal: allow hwmon devices to be created for of-thermal zones MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Sun, 12 Mar 2017 19:07:40 +0000 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 Allow hwmon devices to be optionally created for of-thermal zones, rather than permanently denying them "in case" there is a hwmon driver duplicating the thermal driver. Signed-off-by: Russell King --- Without this, "sensors" is unable to report the temperature of the Dove SoC when it supports thermal zones. Documentation/devicetree/bindings/thermal/thermal.txt | 3 +++ arch/arm/boot/dts/dove.dtsi | 1 + drivers/thermal/of-thermal.c | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index 88b6ea1ad290..1478735fff85 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -175,6 +175,9 @@ containing trip nodes and one sub-node containing all the zone cooling maps. 2000mW, while on a 10'' tablet is around 4500mW. +- linux,hwmon: Allow Linux to create hwmon devices for the thermal + Type: bool 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/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi index 40fb98687230..00f5971cd039 100644 --- a/arch/arm/boot/dts/dove.dtsi +++ b/arch/arm/boot/dts/dove.dtsi @@ -804,6 +804,7 @@ thermal-zones { soc-thermal { + linux,hwmon; polling-delay-passive = <250>; /* ms */ polling-delay = <1000>; /* ms */ thermal-sensors = <&thermal>; diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index d04ec3b9e5ff..5cd1838405f0 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -995,7 +995,8 @@ int __init of_parse_thermal_zones(void) } /* No hwmon because there might be hwmon drivers registering */ - tzp->no_hwmon = true; + if (!of_property_read_bool(child, "linux,hwmon")) + tzp->no_hwmon = true; if (!of_property_read_u32(child, "sustainable-power", &prop)) tzp->sustainable_power = prop;