From: Russell King <rmk+kernel@armlinux.org.uk> To: Zhang Rui <rui.zhang@intel.com>, Eduardo Valentin <edubezval@gmail.com>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Gregory Clement <gregory.clement@free-electrons.com> 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 Date: Sun, 12 Mar 2017 19:07:40 +0000 [thread overview] Message-ID: <E1cn8qC-0002uz-PB@rmk-PC.armlinux.org.uk> (raw) 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 <rmk+kernel@armlinux.org.uk> --- 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; -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: rmk+kernel@armlinux.org.uk (Russell King) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 1/3] thermal: allow hwmon devices to be created for of-thermal zones Date: Sun, 12 Mar 2017 19:07:40 +0000 [thread overview] Message-ID: <E1cn8qC-0002uz-PB@rmk-PC.armlinux.org.uk> (raw) 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 <rmk+kernel@armlinux.org.uk> --- 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; -- 2.7.4
next reply other threads:[~2017-03-12 19:07 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-03-12 19:07 Russell King [this message] 2017-03-12 19:07 ` [PATCH RFC 1/3] thermal: allow hwmon devices to be created for of-thermal zones Russell King 2017-03-20 17:15 ` Rob Herring 2017-03-20 17:15 ` Rob Herring 2017-03-24 13:23 ` Russell King - ARM Linux 2017-03-24 13:23 ` Russell King - ARM Linux [not found] ` <20170324132312.GF7909-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org> 2017-03-24 14:40 ` Russell King - ARM Linux 2017-03-24 14:40 ` Russell King - ARM Linux [not found] ` <20170324144029.GG7909-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org> 2017-03-30 5:59 ` Eduardo Valentin 2017-03-30 5:59 ` Eduardo Valentin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=E1cn8qC-0002uz-PB@rmk-PC.armlinux.org.uk \ --to=rmk+kernel@armlinux.org.uk \ --cc=andrew@lunn.ch \ --cc=devicetree@vger.kernel.org \ --cc=edubezval@gmail.com \ --cc=gregory.clement@free-electrons.com \ --cc=jason@lakedaemon.net \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=robh+dt@kernel.org \ --cc=rui.zhang@intel.com \ --cc=sebastian.hesselbarth@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.