From: Stefan Wahren <stefan.wahren@i2se.com>
To: Eric Anholt <eric@anholt.net>, Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
devicetree@vger.kernel.org,
Florian Fainelli <f.fainelli@gmail.com>,
linux-pm@vger.kernel.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Rob Herring <robh+dt@kernel.org>,
linux-rpi-kernel@lists.infradead.org,
Martin Sperl <kernel@martin.sperl.org>,
Frank Rowand <frowand.list@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH V10 2/6] thermal: of-thermal: Implement signed coefficient support
Date: Fri, 3 Mar 2017 23:18:45 +0000 [thread overview]
Message-ID: <1488583129-4159-3-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1488583129-4159-1-git-send-email-stefan.wahren@i2se.com>
Use the new function of_property_read_s32_array() to prepare
of-thermal for negative coefficients. These are used by
the upcoming bcm2835_thermal driver.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
drivers/thermal/of-thermal.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index d04ec3b..491d58a 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -821,7 +821,8 @@ __init *thermal_of_build_thermal_zone(struct device_node *np)
struct device_node *child = NULL, *gchild;
struct __thermal_zone *tz;
int ret, i;
- u32 prop, coef[2];
+ u32 prop;
+ s32 coef[2];
if (!np) {
pr_err("no thermal zone np\n");
@@ -851,7 +852,7 @@ __init *thermal_of_build_thermal_zone(struct device_node *np)
* one sensor per thermal zone. Thus, we are considering
* only the first two values as slope and offset.
*/
- ret = of_property_read_u32_array(np, "coefficients", coef, 2);
+ ret = of_property_read_s32_array(np, "coefficients", coef, 2);
if (ret == 0) {
tz->slope = coef[0];
tz->offset = coef[1];
--
1.7.9.5
next prev parent reply other threads:[~2017-03-03 23:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 23:18 [PATCH V10 0/6] thermal: bcm2835: add thermal driver for bcm2835 SoC Stefan Wahren
2017-03-03 23:18 ` [PATCH V10 1/6] of: base: Implement read function for s32 array Stefan Wahren
2017-03-03 23:18 ` Stefan Wahren [this message]
2017-03-03 23:18 ` [PATCH V10 3/6] dt-bindings: Add thermal zone to bcm2835-thermal example Stefan Wahren
2017-03-03 23:18 ` [PATCH V10 4/6] ARM: dts: bcm283x: Add CPU thermal zone with 1 trip point Stefan Wahren
[not found] ` <1488583129-4159-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-03-03 23:18 ` [PATCH V10 5/6] ARM64: dts: bcm2837: Define CPU thermal coefficients Stefan Wahren
2017-03-07 6:50 ` kbuild test robot
2017-03-03 23:18 ` [PATCH V10 6/6] thermal: bcm2835: add thermal driver for bcm2835 SoC Stefan Wahren
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=1488583129-4159-3-git-send-email-stefan.wahren@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=edubezval@gmail.com \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=frowand.list@gmail.com \
--cc=kernel@martin.sperl.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=will.deacon@arm.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).