From patchwork Sun Mar 12 22:11:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 9619571 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 9D45E60414 for ; Sun, 12 Mar 2017 22:11:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FB5F28343 for ; Sun, 12 Mar 2017 22:11:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81FEC2840B; Sun, 12 Mar 2017 22:11:40 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 0921A28343 for ; Sun, 12 Mar 2017 22:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935458AbdCLWLi (ORCPT ); Sun, 12 Mar 2017 18:11:38 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:52292 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933231AbdCLWLh (ORCPT ); Sun, 12 Mar 2017 18:11:37 -0400 Received: from localhost.localdomain ([95.91.4.8]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Mb5Gp-1cY06V1BPP-00Kfy3; Sun, 12 Mar 2017 23:11:20 +0100 From: Stefan Wahren To: Eduardo Valentin , Zhang Rui , kernel@martin.sperl.org Cc: Eric Anholt , Rob Herring , Frank Rowand , Florian Fainelli , linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Stefan Wahren Subject: [PATCH V11 2/6] thermal: of-thermal: Implement signed coefficient support Date: Sun, 12 Mar 2017 22:11:01 +0000 Message-Id: <1489356665-3175-3-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1489356665-3175-1-git-send-email-stefan.wahren@i2se.com> References: <1489356665-3175-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K0:fD7/k9j119RhsxcIhElOjWHzq9o/FjOx0OtLDVHGUsFLTz8HQtY pO2ISDm9RhS2mdLCdQ9AH6rwob/2rYz9m4mGLHxKNui82GegeW10shLlx/h0/iLi8Vzc0o6 uJlS68QJp+syErOxtH1NGqJEK8lIuBIx6JSOIP4HQ6ZgO99SUe+0iluXvvYhuG47NJXJQjs 4j4wKaddmNAf/jQ4ghapA== X-UI-Out-Filterresults: notjunk:1; V01:K0:5U5OsGnzkZY=:LxkONXQfT1T5jW7hPX3HHo fxrOmbzymZFOt1MlvF2PKIrwhakL06e4zMiJOXglNgBN+m0PMRWDLbMY7JQA3SVC2LMbZ/b0u sEguoxe0VMmyAd8cLZijPr9sZPet9ejtGsi9T30RBTivgqf5BmKweOwuUwrlUwfoY+h7DtwLM KNDAUBxCww4ZHSuJlstQoQrI8VqneyutXSLHRAn+pujVMZtef992IVrPoU3MvevUpElKc2NCv QwK6EQCXXZMdZt9kAfcZDafMB+WGNWAQDhmDPmj7lvZ9AnWDIoimL1KZFhVONYV9WWwxItNUz BTPlwMW7WNP/FPj648xSVmekmdBETZCiVHeA7dI5nqSoqvfTTPfcOcD7sGKGp1mPJpDo1JlbQ V3sMyTxjZN4YzdpkH5ie/aWWbCOf0ud0+vQfmyCQv3UJ7ITqaE29K0kfJW4JE+d3N8FmvrMy6 pH/MRZ8U3nxFG1qFsM9QdyPHqrsrnHCts78Z3PdaoYT3CYIKRDXcugc0/84V55FDUCTtGDkmX HCIgDhgt1hd3uCfvnf/cTGFRjyVfwHBIYB1zXtnL5yNdoxtzamwQ2GZ/Onf2sZ4akSQY2Vylt 4rFogNUDYSOWk7rkLLu38Lw3gBeEWFiLCFOAMtNq6oksb55RZ/VbWIY4QwJfcQQekzHEkI8EW kSXSGL6W2aeoRwxK2F+BOMNJVGXvpsYlp5EYThOsN3UbNoO67DWHKcKrDbhpUQQf2KvU= 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 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 Reviewed-by: Eduardo Valentin --- 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];