From patchwork Fri Mar 3 23:18:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 9603673 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 E4688602B4 for ; Fri, 3 Mar 2017 23:20:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA3A6285B8 for ; Fri, 3 Mar 2017 23:20:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC45C2861C; Fri, 3 Mar 2017 23:20:07 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD224285B8 for ; Fri, 3 Mar 2017 23:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=LQtuMFm8YmIJemdS4lFdZaWHPhQGtJJSPCNYaxKoAyA=; b=tcTm1+g/ZW91OvT90L22dZ9z0a DDM24NVz2UG4f7IR3oJ1/d4x4HhljtMtQgBa5QUhSoorgyRV232gFUlaQ5GcpTZgyXEJb2UlsxuOz ueoX+0hmj5eSUMdi6muSlj1yyumOf3/6dnpjrrXYPXhwsm2xr5iCRacmLYSR3Evckw7/Y2q3daI1S j6wEbEsZtp5zWxEwvu6oYjd7D4LCNh62nKCUpH/x25qqsUc7jHTyKFVpDxr8/YM+N9G2TSJWiimAX rtFmppM6f9xQv/32cqWvCOYOnBnV56ZL9zupugLfxbebU+7NVlX1oTLdrzKwhz9rEYuAmSekLBUIU 9DyqltaA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cjwUV-0001iS-D1; Fri, 03 Mar 2017 23:20:03 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjwU5-0001ew-16; Fri, 03 Mar 2017 23:19:39 +0000 Received: from localhost.localdomain ([95.91.4.8]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LrmfO-1cIkZe3RVO-013eIs; Sat, 04 Mar 2017 00:19:01 +0100 From: Stefan Wahren To: Eric Anholt , Zhang Rui , Eduardo Valentin Subject: [PATCH V10 2/6] thermal: of-thermal: Implement signed coefficient support Date: Fri, 3 Mar 2017 23:18:45 +0000 Message-Id: <1488583129-4159-3-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1488583129-4159-1-git-send-email-stefan.wahren@i2se.com> References: <1488583129-4159-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K0:UeGEXIzVlbbDUIHREbp5ygNfoQ+w+QAVUyW9I4h72gLscQ6Qjys PLDa0QrdQmMxiK+/esttfmTDTbYGXRoxRIpOsWTdd5Gwpe41yhmwNS3qfn/zy4d/aSC/qJ6 HO0lGK7gtQg0RTg2lXtu2ucxlFfyC46uSWWWMaGnQN4TPnBHJm6ulc2LU+UMrqzttFNprKX +42StQ3KYuFdML17WQBAA== X-UI-Out-Filterresults: notjunk:1; V01:K0:XjLEM/oZhso=:PVDwWAvDLctAVXtEy0S05M wiYtJJQ1cysaWr2QR257nl+buRpn9FBXsljzzRNKQ6tOzfpIQ8yfYwv1tPaZNlwwWWc8khcK8 TuEq48TJB03f/jc705FGoeF66fXvMuqOQsQr89HavltJkxo4H3pxDMWkSZ2J4O7LpIVoKCukJ RsRlXWBIGbWtEDNlQ+AjIPn3RxLbkBOrFFf1/K9gz8vYYur7y4VEl2n56yQLWsy640HwbYLNT 7k9lwPY41ssI+HTP3UrzLdzaBee0354bnrlL27CmAXUfOoY3X/XJItWQ2cEX+rmSc1ttCVt9+ d2lAGVYH116cBec1SeO/bys+HBzLkGa/6nz3vNMrjrApF9reMU1g55g8ZR1YRuv8RuUcmoueo FWddusOsXsZM7flVPypzps8hr+DgvYQoHZUKmXqRxJIiF47abIVta4SfRRjcTWKKWkz84Pkr7 mAHX94zlhWqs1lnfjnbxb/PvwxEwpnByBVtgmBLQcXUOzWA1X+I5rrzGVOxdna5WnmN3dSExO ZBrsNbbl7eyQGhqv4v2dH2ADDLN2rl++brcsvL1+JwP9wFrI2EwP96R46hRLzotXKOj9WKM0G Y4UIC2kN8A+z+qRkrZM4KBopQa9gGFReoFKUeBqKWBKLZNRWqyeg9djSpsfaN7jAmfmSFxUIG SBZeLE+gHDlcO8Ir6SbmY1OwTJbHsyAXi3U26xwVUesbUmwiZCBiLW2wr/mW/TkmWn84= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170303_151937_424723_EE7B63C4 X-CRM114-Status: UNSURE ( 8.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Wahren , devicetree@vger.kernel.org, Florian Fainelli , linux-pm@vger.kernel.org, Catalin Marinas , Will Deacon , Rob Herring , linux-rpi-kernel@lists.infradead.org, Martin Sperl , Frank Rowand , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 --- 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];