From patchwork Wed Sep 12 09:52:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 146535 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4618774ljw; Wed, 12 Sep 2018 02:54:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZPmA2TQ2bGRDPpU7Jvh4EeWkOWMUOfxd0x/M+IahcRIra2Jt0gVskyvXjMV8eV+IIlIFb0 X-Received: by 2002:a62:a05:: with SMTP id s5-v6mr1313564pfi.147.1536746063407; Wed, 12 Sep 2018 02:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536746063; cv=none; d=google.com; s=arc-20160816; b=mYlXst5fjoJk7KgCbLDFWAAUc43DXpcyRYjzQ8ddAPUotL7/ABWmD68kQG3EM+R4Uq p40txL/XVOT2Y/ZXhZYuBh2Gdk2pGpsiZ/XK3CTAW3X9QasKJpqLtBqrXn1fAL9e3/y6 qakyeZE/qQeL447UZRgV9edGaONc1B1sDFhmxBtt/TPY8k9SHT5/RVyvMxbSuQwR1OSW vyvIcBL3ygRnRAuO710BEyT2nRysi2YEjr86Gc3UNSyCkKDe+do8eIlfNNf3CAgedE4F zc0KHCSLB6EvEytwHt10QrjrLwJ6JpIkP+MoS/G3FNrHWyc4he/B1JIScASU38TJaDL2 aM3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=p+l9eG3EJUvs5PqroE1oN9/c9Y5I3RjwbnuwyKuwaKQ=; b=AyHQV+J1n87NigoY2L26Dr3wqorLBSuY1bDax5yvs11Ia/+TjfaSd3x5kgALvXGUR9 L3j6QIRchpIxiEyZ5Edclwp0W9b1wXQ6pIRCkrvovGjrqb92RNEM2NmGiTtPT9KV/5r3 3yiLk0nRdbFsvaan6+jEmYpupXx7vX+WhU9Upxx5vkOP3deCRi4DTzg2l8U36oTV+0G0 SjuPW3Glv0fSQOT0/v9w9Rl08hsJ3RTi3lS2DbpLuF3eByGuC5ovmFxoYWSWnvrFd/Iv YlIUmWNeXxN3IVzMUUE1onmZQsM0mxWRmE2b+ew3cQJvHAZE2zMi4IKIv9pOwVfD10hr 0eZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J9L6R4gf; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12-v6si489834pld.362.2018.09.12.02.54.23; Wed, 12 Sep 2018 02:54:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J9L6R4gf; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727798AbeILO6I (ORCPT + 10 others); Wed, 12 Sep 2018 10:58:08 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38340 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbeILO6I (ORCPT ); Wed, 12 Sep 2018 10:58:08 -0400 Received: by mail-ed1-f65.google.com with SMTP id h33-v6so1260938edb.5 for ; Wed, 12 Sep 2018 02:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=p+l9eG3EJUvs5PqroE1oN9/c9Y5I3RjwbnuwyKuwaKQ=; b=J9L6R4gfDqVWuTaZEOBoz4A2w3TIHW5Klx19orLgDv4Sl9La0s0FWXmR7JLmcigpEW DKdX1UdAg4XCcBHHnA6xPilTPpyQPnTZrgTwqHzUH+7yNsz7VXqCYTy2XnAIoSuRiR5R Wtnd7im10Eb7dMJnSui63aISD1ETTo4synyUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=p+l9eG3EJUvs5PqroE1oN9/c9Y5I3RjwbnuwyKuwaKQ=; b=YG/0ImXE/tIVDLe9WsCbcxc0tgus8QGcRBjolc96dMkCDiEk377YvcgH6ooz+2nyls TLmZ4i3MGQH7Bfg07YZhy29tmcOrSAEzEPJaMSN4nIXmE50Lul3GX4XcmRvp/Yc5P3SQ JwQzHvUqswdbB/SD79YSyMvIs/QSUDBvEND8votcaoJ4mQJCbZtqte1Hhaj1Lx1y2f8S atXfnWhYXcQD5nOA6CilxPcWqP2rBW8/dJ7Yb4ffzgSaN97g4GFHZYEkIpEu371Yfn40 28knbVA7p9e8jFI1wjxM9XJYiA2MAPUCj9xvzmKxAbzD7rE5PFELzOZ4eews2fQvGt2Z kYlw== X-Gm-Message-State: APzg51Bc4lt1jI9UZ9Q5y5s7Vf3ojTCaizqYlz6yLdEDjYB1w34puQjz BD/MNIZG0nJHkzxqPz6lp6snWA== X-Received: by 2002:a50:de03:: with SMTP id z3-v6mr1749903edk.245.1536746060744; Wed, 12 Sep 2018 02:54:20 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id f13-v6sm690554edf.50.2018.09.12.02.54.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:54:19 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, smohanad@codeaurora.org, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 08/16] thermal: tsens: Check if the IP is correctly enabled by firmware Date: Wed, 12 Sep 2018 15:22:53 +0530 Message-Id: <140b054230a61e13995ae4b685746c8faf068d61.1536744310.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The SROT registers are initialised by the secure firmware at boot. We don't have write access to the registers. Check if the block is enabled before continuing. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-common.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 0b8a793f15f4..3be4be2e0465 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -12,6 +12,10 @@ #include #include "tsens.h" +/* SROT */ +#define TSENS_EN BIT(0) + +/* TM */ #define STATUS_OFFSET 0x30 #define SN_ADDR_OFFSET 0x4 #define SN_ST_TEMP_MASK 0x3ff @@ -119,7 +123,10 @@ int __init init_common(struct tsens_device *tmdev) { void __iomem *tm_base, *srot_base; struct resource *res; + u32 code; + int ret; struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node); + u16 ctrl_offset = tmdev->reg_offsets[SROT_CTRL_OFFSET]; if (!op) return -EINVAL; @@ -151,5 +158,15 @@ int __init init_common(struct tsens_device *tmdev) if (IS_ERR(tmdev->tm_map)) return PTR_ERR(tmdev->tm_map); + if (tmdev->srot_map) { + ret = regmap_read(tmdev->srot_map, ctrl_offset, &code); + if (ret) + return ret; + if (!(code & TSENS_EN)) { + dev_err(tmdev->dev, "tsens device is not enabled\n"); + return -ENODEV; + } + } + return 0; } From patchwork Wed Sep 12 09:52:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 146540 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4619185ljw; Wed, 12 Sep 2018 02:54:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ2HiTrbU7gq7diTdTkuPkOaLdFv1j1MoCNPbD/XC+4NvaS+A3kqNI6PtGVO8kutwgKyAYm X-Received: by 2002:a62:8559:: with SMTP id u86-v6mr1346823pfd.32.1536746094899; Wed, 12 Sep 2018 02:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536746094; cv=none; d=google.com; s=arc-20160816; b=wrvhde5KGK3EdqEwry+wJqagK5k402tbKYVJP98l/znS+oP2qaC5zEKU96tCe63+G/ AYFLS2WkSNqr0DoFRgTB+kv/Y9QZzHweHZOomwX3aiX+wAuawHN6pGKCoEZz94oiOWLj Mpr6FVyjUh2FxvrzYD1c35lA8z2DhAUG7WyH05Y4+YEu4r6/tbUt5oVQL7+xsE0o4Wka mHxNIJbK2xoVgxxSfX7LF3fqNo1L4jl8DSwPdBJZ4oyrW/8OXFXJLuByr//x8EJCWOHv /pB/nExL5j05hJ2e4xp8Cf8QQlLBSayYtMW32zIXtux31AepaZ2xBXZcKuzXCPwZ3wLS infQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=q7StzQyd+okywPPbXDjrtJCN5bAcIFHgFQlaxztz5dY=; b=pyVv0LIEOAN+T09cgRGNWVMS+yYIzIh2/L5nOZyxFFVRtTu6BCVLr4XCKGUhLXHHa4 YyMSkZeLBInr4kPKu7+e2pWBgb3o0ofgDsM/4jBQfb9DkQICKTklLMxEylGJRe8NdBqd /wlBzyqlvBTeTCvclG44xD+4pAA4QqVXy/HoxwBUzB+J//EBqrUvsfw9n6Vf/H+HTmWH 9x2F1ev7tcqIsk8+DGGKAKN7cX8aDRCT1m/NWEUHP7wmJFbFGqgab5dcEnO/eqzP2Dav 35kY7TDUKRCz1RNT/zkW8lOTqqzgADAyprJViw9LFNUB3feqy5PFUt06dtQmyCbkvqE8 y89w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bv1vaPdS; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s81-v6si553472pfk.213.2018.09.12.02.54.54; Wed, 12 Sep 2018 02:54:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bv1vaPdS; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbeILO6j (ORCPT + 10 others); Wed, 12 Sep 2018 10:58:39 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41376 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbeILO6j (ORCPT ); Wed, 12 Sep 2018 10:58:39 -0400 Received: by mail-ed1-f65.google.com with SMTP id f38-v6so1246740edd.8 for ; Wed, 12 Sep 2018 02:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=q7StzQyd+okywPPbXDjrtJCN5bAcIFHgFQlaxztz5dY=; b=bv1vaPdS27Frv9kiMDM1C8J0zLCjFcroQZ21iJ8vgCOocCsPIUyHTNVJ+Ur717+HcE +D+D1Efmfvvijv6BcOwkHJ6qhBKbVefkwuZyt9s/8oBrpDdpQcrP0HLWndHWzFixz+2X M6SiSfzreyp3uGwR0InXc1KXmJrd7kX1eW/tI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=q7StzQyd+okywPPbXDjrtJCN5bAcIFHgFQlaxztz5dY=; b=dsNre5ZBcKncTnX2TZfhAnVXzeHmqKX83P48v+a/bMNCb0ba+WXcCOheiAppNm2tWz siPqEoaiUMQlXFNMhuMsG/2Ok9fU9E7glI75PtFrmLsIA849Till1jS2HF+DeSnI098u E8/mrztKK/YVbP7HkAdjXpJW+8r+zaiGR0X34UL+oyoM5ogu/NnMrWfAMT0ERiyZLBSZ hYF1f+dVYSGGvfaXXajkBREtKLr7kdp9qQM2pUxKK+9uHQzwuniK9wW5HSCquUHS0D2B aHmim67RgAYdtob7mPMzEbsCbGh8qXBOh6ndnRXyD/0jQC+zRTsrv7rRKlHAeLQajG+D dbhg== X-Gm-Message-State: APzg51Ddztkb5S2xKa+jk4a8Bt6QPjDEuYqr5oDfNvlyLWORK1fOnsfx XzFMGoD7qP0yGxOaMqkzL4JWDA== X-Received: by 2002:a50:cb8c:: with SMTP id k12-v6mr1878289edi.171.1536746091680; Wed, 12 Sep 2018 02:54:51 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id h40-v6sm420603edh.88.2018.09.12.02.54.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:54:50 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, smohanad@codeaurora.org, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 13/16] dt-bindings: thermal: Fix a typo in documentation Date: Wed, 12 Sep 2018 15:22:58 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org c(1) + x(1) was actually meant to be c(1) * x(1). Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Acked-by: Rob Herring Reviewed-by: Bjorn Andersson --- Documentation/devicetree/bindings/thermal/thermal.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index eb7ee91556a5..ca14ba959e0d 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -152,7 +152,7 @@ Optional property: Elem size: one cell the sensors listed in the thermal-sensors property. Elem type: signed Coefficients defaults to 1, in case this property is not specified. A simple linear polynomial is used: - Z = c0 * x0 + c1 + x1 + ... + c(n-1) * x(n-1) + cn. + Z = c0 * x0 + c1 * x1 + ... + c(n-1) * x(n-1) + cn. The coefficients are ordered and they match with sensors by means of sensor ID. Additional coefficients are