From patchwork Thu Jun 14 10:43:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138543 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1940621lji; Thu, 14 Jun 2018 03:43:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLqFG68hqdmz2GKF1Khzxjuu5+2Ox51YnJyNbwsu9CNoWQgcZAOvaxHYmJ2svLM7HDFo8RZ X-Received: by 2002:a62:119d:: with SMTP id 29-v6mr8972414pfr.102.1528973035366; Thu, 14 Jun 2018 03:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973035; cv=none; d=google.com; s=arc-20160816; b=Wo8wgftCFi2QuiQB/8+brZlmADBHlnsuZm87Q9ZxN4JBZcruHT7pvTScRalL4FHUdO SDrS1kwt/pdkqiKIvtooFSKR3bqb8xDfv9ksnTvDOWZnryaNZ1T5x3QgF8MPkavbawwc FRH1vT/erj2jCymgZ8jrLc/xSSZ38YXIJyXo7zqo0mvPYC7dfywSF/ykEWZe9m7+xzmR S3jFeA52lTK2YIC6CAdBBrUCAFboqKcTgy7r6PzOaIi/z+kq+TQHOnN2f+MVtT8mcoCP XiH/NShWIyZyN98pU6Kmjcevh+XTx0JRdtWb38GMBSZPE//x9OyvDjOGlcZaZh4W1CEq R99g== 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 :arc-authentication-results; bh=RqHvCXWgQNEn4X6AU/ZqYttyBtBVtMakbjX0moav5Ps=; b=isCpdwg/ZajVQIOVCJ+YzKexzKOSoLMEnduYV/5sjfojJyvYIePa3BAaPW0oY/1ku3 mKUaieolrCCelBvEea2TrsBcXPY0tRFJiNY2DFGLk5sxN61+RdqIXiS7ssP3Z+OSBn38 Mrw6zEbcp+JAdEbz1kd5F+O1JBqM49qT/VvJ+vBREYlnbB4RllQ6ozo3wNfwdxSLfkqi x6mCIiWDS36Yqdr9bWqCxNRs2k661AMYoGG95iw4T/EduNq1tYDFjFqq/A6cjuIldiiQ DMmESQGRrKMvLKD+DId/HIxKsssCG1kGmfTPoxfvbkWzISGlVsKDIccin8LI11FoyOBY CRpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ByN4Hdqe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 e124-v6si4918274pfe.80.2018.06.14.03.43.55; Thu, 14 Jun 2018 03:43:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=ByN4Hdqe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1755087AbeFNKnx (ORCPT + 30 others); Thu, 14 Jun 2018 06:43:53 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33215 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755033AbeFNKns (ORCPT ); Thu, 14 Jun 2018 06:43:48 -0400 Received: by mail-lf0-f67.google.com with SMTP id y20-v6so8693532lfy.0 for ; Thu, 14 Jun 2018 03:43:47 -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=RqHvCXWgQNEn4X6AU/ZqYttyBtBVtMakbjX0moav5Ps=; b=ByN4HdqeA8rhSNJ7duMK3OV/9qqXaH/8YkesWFOiqzBpgx5SH8sjzK61iqG3BHO3tj rNOA6mvMdc+SUUFP2rURErGGlh7kgGCI85gxO7ERyciyUqElx8tL3dcoN67GW+dRgqxV b+rEdDUYiAORNRN/V1gzrJ5JfAt4sncpDDMTk= 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=RqHvCXWgQNEn4X6AU/ZqYttyBtBVtMakbjX0moav5Ps=; b=nKwpNlYBdMGs6hTRmVwUAltk1NUwTOL/hj0uReG6n2SwnBFA4iM9D2sSVifwVW0Zk1 PTrCzWudubnLWz8gQXcMbtvN6BMcGybsAbc2s12GRoqdCHNaBtk+zpq3VG0wdXL/aVuc 6dD35q0+Eo1E+T136lfzwSE8NvuQs27oFChUP3Q4edy0iLCPTLeMZ1WjjlalAZwLAglu tLRzSueL8RhQMLPsh4ju5Zu8mmAcRgUwckD91uBB34pLzJUpobHLoLQFBmxp4yIe2+x3 BOJ7/h1tQdubxOSD4oY0VPLwXLIAmgLON7nenLMWGA0WXauE8CoYLPS60Tan/qG55PPw 7uWg== X-Gm-Message-State: APt69E1Y6gn1jTZOeJmj4Pweh9rt6qX1J+h2MPcr5J7+96U/BEuNGMWQ CuxlIAaZ58cE6wcGI6F/rZHLPWbYwtM= X-Received: by 2002:a19:a892:: with SMTP id r140-v6mr5554444lfe.39.1528973026826; Thu, 14 Jun 2018 03:43:46 -0700 (PDT) Received: from localhost (85-76-96-172-nat.elisa-mobile.fi. [85.76.96.172]) by smtp.gmail.com with ESMTPSA id l16-v6sm902241lji.40.2018.06.14.03.43.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 03:43:46 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , linux-pm@vger.kernel.org (open list:THERMAL) Subject: [PATCH v3 1/6] thermal: tsens: Get rid of unused fields in structure Date: Thu, 14 Jun 2018 13:43:11 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak --- drivers/thermal/qcom/tsens.h | 2 -- 1 file changed, 2 deletions(-) -- 2.7.4 diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 911c197..dc56e1e 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -77,9 +77,7 @@ struct tsens_device { struct device *dev; u32 num_sensors; struct regmap *map; - struct regmap_field *status_field; struct tsens_context ctx; - bool trdy; const struct tsens_ops *ops; struct tsens_sensor sensor[0]; }; From patchwork Thu Jun 14 10:43:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138548 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1941706lji; Thu, 14 Jun 2018 03:45:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJnQ/kTqcVpV10RXJOxAscGpdtk+YJKklqmy6Cq9dW58C3/xItAeUkZ2ebO//G0eutGbZy X-Received: by 2002:a17:902:8c95:: with SMTP id t21-v6mr2477652plo.306.1528973108631; Thu, 14 Jun 2018 03:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973108; cv=none; d=google.com; s=arc-20160816; b=BrUW6C5RTpjB16baeXWOpDoft/Ks8ps+sAVXHgWatwrUIfxd2HSXHYfl31fWOcchQb YX5osp0f6V/Vqkx/JHM7DEMaoILSajFN0bYyEAfSyYK/L4N6D/hEoevDqospQAr1Inl9 De56RC/5SvCKU3oIMRcYjSZRqcwmO05NfvhXdOExRHJl53bHRW7eZJLnPEex3gpWHfX5 zh8lRhQjeDuOOfyg5+617MZiU0YrlyotL9NGvuTwmzeAKhW8YtXwkESFITCACYY/lBVE LbQweiR/pAzVzmHEIozEy7zgMG5EH2a5qWUAzkiAQNKOka7Xl2t2hjOO880ZmQ/xAR+p Fh3w== 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 :arc-authentication-results; bh=LboO0m9tdUv5OClL5JGmFqiWh7zVC6d1MgWg2XNw1k8=; b=jjzUGvchn8hYoZxZnZLvGH3G0cvHKX7vhMznhmeUidOqCpuJGXrRmgheJk7Sx7u5QL n55Zq/VQsA/WD+jHBZ0VnMe7Opl8FAKVnJ9qjlEe5R2UYI/1kyARUoGi/fVr1nuSs48r inpdKxOMd8Rv0lPJTgh2X1WkXQi5nFekdx8HGlN0VA0yQLVNpQCV0NOdcQ1ZdhoWs02y wn7+ej+t33gyzsNrn/uf48w4veEGJ+YxybpobWjxrYN+YwsEE/BDmTT/F/IG3RDnfp1X gN0HOno/bqJmE/qU0aBf8ZL1lCBo7hoRI9GNmp0lJTg/NKFA9iOe6qFbXJngOzb4Y5/C hNXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e18n8GM9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 m5-v6si4030209pgp.269.2018.06.14.03.45.08; Thu, 14 Jun 2018 03:45:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=e18n8GM9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1755164AbeFNKpF (ORCPT + 30 others); Thu, 14 Jun 2018 06:45:05 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:42680 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755054AbeFNKnu (ORCPT ); Thu, 14 Jun 2018 06:43:50 -0400 Received: by mail-lf0-f68.google.com with SMTP id v135-v6so8642884lfa.9 for ; Thu, 14 Jun 2018 03:43:49 -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=LboO0m9tdUv5OClL5JGmFqiWh7zVC6d1MgWg2XNw1k8=; b=e18n8GM9yMChDMiudEptri7Dt71qtvl/jlXU/Iklt0lISEG+w3XBpsDiMfLrTHJGnw SJtYbJ5Az4TkPoyUpsxipUL2MaXB8lqVFp/v8zSoRQSqT+JS7SRBxAqnpC4POeWGBhR+ 3BzymjBjoW2xSMgaRdwpTMVdbIfz5EtciXV/E= 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=LboO0m9tdUv5OClL5JGmFqiWh7zVC6d1MgWg2XNw1k8=; b=hwfZt+gXMk1sVTTTC6470cvEZM5X6e57WAIIZ6Yk2R3wftJYHSuuCSCS4+56AYW8M3 69Snd+yEdVcHHB4nc+ccIfa1Iy2g5nOzVFHiiL9kboNSJgW5g8b2Ct3DsGcjB9D5RY8L Lhw+gVsQA+PmoSQNEtLdtHISz0MZM66q0BOd5Jo+tXiT8Bxj2FCX56A/22/oEFvxnaFF Wq6baoQi0tM4pt1DZ0w6NE11XRMTkTYInuUZ2OE11HQxwBf9ARAe+kdz7Nsw2pqGheDK elvVfFRI978Z2BtfO6Nb1lmDVFyzFd32KxvvOculmod43GBaVeZPthL4PwbiDEb1DHj3 +Ssw== X-Gm-Message-State: APt69E2phxAThcETAu0itv0YG4VC1K0AWqXHrQwJO+RdhRfdekudj8/V iz4mgvKKrLMKZ1sD7zsscC23D9EBRig= X-Received: by 2002:a19:1003:: with SMTP id f3-v6mr6000987lfi.114.1528973028844; Thu, 14 Jun 2018 03:43:48 -0700 (PDT) Received: from localhost (85-76-96-172-nat.elisa-mobile.fi. [85.76.96.172]) by smtp.gmail.com with ESMTPSA id y15-v6sm888556ljj.75.2018.06.14.03.43.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 03:43:48 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, David Brown , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , linux-soc@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)) Subject: [PATCH v3 2/6] dt: qcom: 8996: thermal: Move to DT initialisation Date: Thu, 14 Jun 2018 13:43:12 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We also split up the regmap address space into two, one for the TM registers, the other for the SROT registers. This was required to deal with different address offsets for the TM and SROT registers across different SoC families. Since tsens-common.c/init_common() currently only registers one address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 8c7f9ca..6c8a857 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -461,7 +461,17 @@ tsens0: thermal-sensor@4a8000 { compatible = "qcom,msm8996-tsens"; - reg = <0x4a8000 0x2000>; + reg = <0x4a9000 0x1000>, /* TM */ + <0x4a8000 0x1000>; /* SROT */ + #qcom,sensors = <13>; + #thermal-sensor-cells = <1>; + }; + + tsens1: thermal-sensor@4ac000 { + compatible = "qcom,msm8996-tsens"; + reg = <0x4ad000 0x1000>, /* TM */ + <0x4ac000 0x1000>; /* SROT */ + #qcom,sensors = <8>; #thermal-sensor-cells = <1>; }; From patchwork Thu Jun 14 10:43:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138544 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1940763lji; Thu, 14 Jun 2018 03:44:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJzMneK1xeigbJ/egjj1Wa5jNIcMOgymbXBcqGGAM+Xz1U3OgNOZijm5FcrO1KV1V48SgXu X-Received: by 2002:a17:902:b40f:: with SMTP id x15-v6mr2470467plr.270.1528973045953; Thu, 14 Jun 2018 03:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973045; cv=none; d=google.com; s=arc-20160816; b=CdFDvQXYst3O4pq29Z5eq5dsJh8OVhrVslVmjuvxRpwNZey/lnk5l3P0vKNqMJoUNl b76eEcVMSgHuIgWdMyccjK35AOjO3P1A215aincVys5nRyMK+uyFW/DhRkaxQinRuKD4 DPgDwxsb210aECa0FpJvuGJWGofYU+OZSXactKFcfE7vTakC3QmuL0qU1EdEUR6cEhrT gXHNgD8XLDjj2BMYKB2aiyy7P/L/JS9ArOX8z/J16+7adV2U6GOW/12pg21VhuqIJP+j gjRCaVhDMuF5JuD2IOlWjfMrr6MMj97urKumTI7A3B/pdVuSeKKG/erl5ERXuHmd4u19 hDKw== 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 :arc-authentication-results; bh=79IlTt7LMeUKFlfd230WbPE21fWiEzhh7e4WAJs4pwE=; b=0ik9bI3WE0Yf2872z7G/tC7xlT910K1P0iq2TSitg7ivPl/tecXsYHaNbWRifQACvU zRShwgC+ZgAATeun639RZEid0r46og4grRhDLiBh6QZGcK15DtiVU/Utf3+GHjvtormL KXPkhEBLWrvRMX3O1f+iiuuMLOhdyTksQd+tUOvQAcT4o+lsq+zK2qPb2RRjM96aFtwm pYGGSSrdFgyYo1FJ7uVz/kwIk5PSSXDmnHlX9qIXU1w/adFki/T8gN5Ku4M5sPNBioQp ZQPCa07Kc1UzNz/UDdwfzyPN+Gf/hLXWb//+T+MkIiXxZpE+41iMwNmq0HyxZeRNvBzI hphQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EhLcvwF5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 y21-v6si4843958pfm.1.2018.06.14.03.44.05; Thu, 14 Jun 2018 03:44:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=EhLcvwF5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1755113AbeFNKoE (ORCPT + 30 others); Thu, 14 Jun 2018 06:44:04 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45045 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755102AbeFNKoB (ORCPT ); Thu, 14 Jun 2018 06:44:01 -0400 Received: by mail-lf0-f65.google.com with SMTP id 36-v6so8636940lfr.11 for ; Thu, 14 Jun 2018 03:44:01 -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=79IlTt7LMeUKFlfd230WbPE21fWiEzhh7e4WAJs4pwE=; b=EhLcvwF51e+ZPnpx00WQ9NvTdBWZRTYsULr16qZp96G278PsdBkIIFjJ88DGcF3cI2 tyd1kYbuPlOl9flhJmd4/DzZHnMjxTqvuo9gP0QcCdq1PmSfUKM2zB1ay3U5LVAXyiKq EmEOO67Ng1Q5/ZfiJG04yf6IhBdvZRC7qepPg= 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=79IlTt7LMeUKFlfd230WbPE21fWiEzhh7e4WAJs4pwE=; b=VQnkSYKtTEGtZQDuAEuUcZTxwFacyJkUlh6DJ2DrZPG4smHbmmN57alXTQytyNuclt w460N5N1aYx1whAUOo0DXZVrisCIfhEQUv8dV9GgEL5P5Vd9EHah20+E8jbX/wF3jRdT 0wdBlLBOkylDrarhJHfNhSKorNRs8hjVY37BFYL+DCl2CI/R8Efc3VIviaD1rurRDr5v 0KKAa/1K215Lpa9ff3yr0mZkf+cmR3X4acqenKINoTkoMaZrif47BrSDFtK7ipDcZy2V /E64w1U5R+YXT9Tl9cB0gE9jR12mb4e6GEGRicBdRzq4gLWZ4CEF5ICai3WGIHNvC9c6 lhDg== X-Gm-Message-State: APt69E1XWVRyFaclZJrklZIBUds4OYK87zjaFyfGYjbhuO3JeqccoWYr /J1aoXBEyRLramBdWhkEFE+9JiAHEhI= X-Received: by 2002:a2e:635b:: with SMTP id x88-v6mr1478142ljb.103.1528973040056; Thu, 14 Jun 2018 03:44:00 -0700 (PDT) Received: from localhost (85-76-96-172-nat.elisa-mobile.fi. [85.76.96.172]) by smtp.gmail.com with ESMTPSA id d6-v6sm893297ljd.52.2018.06.14.03.43.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 03:43:59 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , linux-pm@vger.kernel.org (open list:THERMAL) Subject: [PATCH v3 3/6] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse Date: Thu, 14 Jun 2018 13:43:13 +0300 Message-Id: <44df951a0e13aa0b313e3dbcdf4e0b313c5893e2.1528972165.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. Also, rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/Makefile | 2 +- drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} | 26 ++++++++--------------- 2 files changed, 10 insertions(+), 18 deletions(-) rename drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} (66%) -- 2.7.4 diff --git a/drivers/thermal/qcom/Makefile b/drivers/thermal/qcom/Makefile index 2cc2193..a821929 100644 --- a/drivers/thermal/qcom/Makefile +++ b/drivers/thermal/qcom/Makefile @@ -1,2 +1,2 @@ obj-$(CONFIG_QCOM_TSENS) += qcom_tsens.o -qcom_tsens-y += tsens.o tsens-common.o tsens-8916.o tsens-8974.o tsens-8960.o tsens-8996.o +qcom_tsens-y += tsens.o tsens-common.o tsens-8916.o tsens-8974.o tsens-8960.o tsens-v2.o diff --git a/drivers/thermal/qcom/tsens-8996.c b/drivers/thermal/qcom/tsens-v2.c similarity index 66% rename from drivers/thermal/qcom/tsens-8996.c rename to drivers/thermal/qcom/tsens-v2.c index e1f7781..c981a40 100644 --- a/drivers/thermal/qcom/tsens-8996.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -1,27 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * + * Copyright (c) 2018, Linaro Limited */ -#include #include #include "tsens.h" -#define STATUS_OFFSET 0x10a0 -#define LAST_TEMP_MASK 0xfff +#define STATUS_OFFSET 0xa0 +#define LAST_TEMP_MASK 0xfff #define STATUS_VALID_BIT BIT(21) #define CODE_SIGN_BIT BIT(11) -static int get_temp_8996(struct tsens_device *tmdev, int id, int *temp) +static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) { struct tsens_sensor *s = &tmdev->sensor[id]; u32 code; @@ -73,12 +64,13 @@ static int get_temp_8996(struct tsens_device *tmdev, int id, int *temp) return 0; } -static const struct tsens_ops ops_8996 = { +static const struct tsens_ops ops_v2 = { .init = init_common, - .get_temp = get_temp_8996, + .get_temp = get_temp_tsens_v2, }; const struct tsens_data data_8996 = { .num_sensors = 13, - .ops = &ops_8996, + .ops = &ops_v2, }; + From patchwork Thu Jun 14 10:43:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138545 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1940924lji; Thu, 14 Jun 2018 03:44:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFe24oiZZcxGXmeFdsa1GVStHaKA7hkU6Krv4zew/wD6NdRDi39I6C+EmAMEyx5FDIeGjg X-Received: by 2002:a63:bc0a:: with SMTP id q10-v6mr1855781pge.70.1528973057654; Thu, 14 Jun 2018 03:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973057; cv=none; d=google.com; s=arc-20160816; b=dLau3Tc8L3Jlr4aap2/P4iP/FtlxtdyiKnfZMS/pG0XIzyU4rK3vXEd0L/kjWgcn2K QXV4ktrPVoggqWB37MoNXPIu779ZSpQYKb84UVgsc3HLHkphjJ5AiNLCTmP73p1uQNzx 7bBDSnTX+IWWY1WBSEKqD5k36LAy+vk2zKRFUA2bQsjGqD+tfZWd2TdemA8EonZslFIh UoT7dwgXgjk4v0qW00DspK1cciKyee6eOfrx7L+F8HAE2lAfuNnD6nPgFej8VIiFypJI LiEWY0I64lx7b89TqCz9fOaqQaHI9+C6xeF7OO6iVATaYSOc9AcHDuL/4HaH1eSS5f5G D0ng== 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 :arc-authentication-results; bh=nsLRHqDsn6jIlUl3h1shSA3jg98RwxjrWsSKcLlExq4=; b=eYoc8jL2DNAdfbHKRycVsZzNWEmuMqL5bfqh1h9pHOso0ubVAtdPjso8Uqwnn48EVv ORLPM94fIJuMhRfRUBeaObpaXwGfPEo2VWtunoZBjrmUs1qxO7FR2R1IYfYee6XtQwkC Y+14W0IXrw099MtB7YyzYmYo+hVlLzUrqWa2QEn+UPWm6KoiHPcOF31a2NsuKJMHbTzJ +JD25PcTLeE+TaZN6SD6DFFUmC+nLZQRlPCy0ONB0PC1pZSFS7Ugkzc0HPEIXPg2kvfD ZlH+qpObgQchI7N88jfBKVkzgvXkkbXapzRixl+i6+fWriYDEWDo5KqH15rAJkN1lxPo eauw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LT1IVnCo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 y21-v6si4843958pfm.1.2018.06.14.03.44.17; Thu, 14 Jun 2018 03:44:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=LT1IVnCo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1755138AbeFNKoQ (ORCPT + 30 others); Thu, 14 Jun 2018 06:44:16 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35015 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935786AbeFNKoM (ORCPT ); Thu, 14 Jun 2018 06:44:12 -0400 Received: by mail-lf0-f66.google.com with SMTP id i15-v6so8667991lfc.2 for ; Thu, 14 Jun 2018 03:44:12 -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=nsLRHqDsn6jIlUl3h1shSA3jg98RwxjrWsSKcLlExq4=; b=LT1IVnCorpgGAWEoUOq6VNXRB3aEXO6y7JwmORhLa4nBLkjMCKzQuN899bORmb22Zh VhvtR+v/nugVoHnb5hIdg4cFjT1DZLc5Iv6eVvEUJxJMbEm+fj5WH/jJgs09IeBHRemb rz4pnwl1DE1rhAWi5hMMoCv5u5Lvc435Pu4H4= 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=nsLRHqDsn6jIlUl3h1shSA3jg98RwxjrWsSKcLlExq4=; b=EUKYKQS2LJJLBEF6Hh7p0TwFdDg9X6DNXac77grGrW2SfJ/cinEQkKCPanqPpkVIcQ DT++WeIwH2csIeNzLkGaoUVZxzTRqeItXfF3bxI2iTu5DpEyL5yiE9WynUzL0Pk69E9x Fk8+SEtykISYm4OTrYz0mnrJ5O0ucdC0LpK3KLeKfUvI59AKRUPaajrgqAgciVOz6ybq gdWtRJAwqJEA+2yTPFKneOUIwVobIqm8nO7KPzU9SWP0zd+0KlgrlvFRqmi02J9FP5Xb QpW58pFK/5M9bFnqsFJ2jqEVAFoKCRpFYHn7EqXaFNo+ElCcxfI6ALLc7rc/6sR0RZl1 0Slw== X-Gm-Message-State: APt69E1Ugv+XavpVmYiCYXKbI/pnnL1G1w5NYzo0fwupGrihhD56NFBa +Zd76isv5+UCyjJR9aue+FvEYbLlfgo= X-Received: by 2002:a2e:5358:: with SMTP id t24-v6mr1448532ljd.129.1528973051032; Thu, 14 Jun 2018 03:44:11 -0700 (PDT) Received: from localhost (85-76-96-172-nat.elisa-mobile.fi. [85.76.96.172]) by smtp.gmail.com with ESMTPSA id a19-v6sm1013055lff.84.2018.06.14.03.44.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 03:44:09 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , Rob Herring , Mark Rutland , David Brown , Catalin Marinas , Will Deacon , Kees Cook , linux-pm@vger.kernel.org (open list:THERMAL), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-soc@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)) Subject: [PATCH v3 4/6] thermal: tsens: Add support for SDM845 Date: Thu, 14 Jun 2018 13:43:14 +0300 Message-Id: <0cdd0957cf80c2f9921928755722a427c7309964.1528972165.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SDM845 uses the TSENS v2 IP block Signed-off-by: Amit Kucheria --- Documentation/devicetree/bindings/thermal/qcom-tsens.txt | 1 + arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +- drivers/thermal/qcom/tsens-v2.c | 9 ++++++++- drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 5 ++++- 5 files changed, 17 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt index 06195e8..84da3db 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt @@ -5,6 +5,7 @@ Required properties: - "qcom,msm8916-tsens" : For 8916 Family of SoCs - "qcom,msm8974-tsens" : For 8974 Family of SoCs - "qcom,msm8996-tsens" : For 8996 Family of SoCs + - "qcom,tsens-v2" : For any SoC with v2 version of the tsens IP - reg: Address range of the thermal registers - #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description. diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 6c8a857..28d4c08 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -460,7 +460,7 @@ }; tsens0: thermal-sensor@4a8000 { - compatible = "qcom,msm8996-tsens"; + compatible = "qcom,msm8996-tsens", "qcom,tsens-v2"; reg = <0x4a9000 0x1000>, /* TM */ <0x4a8000 0x1000>; /* SROT */ #qcom,sensors = <13>; diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index c981a40..abc8f13 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -69,8 +69,15 @@ static const struct tsens_ops ops_v2 = { .get_temp = get_temp_tsens_v2, }; +const struct tsens_data data_tsens_v2 = { + .ops = &ops_v2, +}; + +/* Kept around for backward compatibility with old msm8996.dtsi. + * New platforms should use data_tsens_v2 if possible and define + * the #qcom,sensors property in DT. + */ const struct tsens_data data_8996 = { .num_sensors = 13, .ops = &ops_v2, }; - diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 3440166c..a2c9bfa 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -72,6 +72,9 @@ static const struct of_device_id tsens_table[] = { }, { .compatible = "qcom,msm8996-tsens", .data = &data_8996, + }, { + .compatible = "qcom,tsens-v2", + .data = &data_tsens_v2, }, {} }; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index dc56e1e..69212cb 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -87,6 +87,9 @@ void compute_intercept_slope(struct tsens_device *, u32 *, u32 *, u32); int init_common(struct tsens_device *); int get_temp_common(struct tsens_device *, int, int *); -extern const struct tsens_data data_8916, data_8974, data_8960, data_8996; +/* TSENS v1 targets */ +extern const struct tsens_data data_8916, data_8974, data_8960; +/* TSENS v2 targets */ +extern const struct tsens_data data_8996, data_tsens_v2; #endif /* __QCOM_TSENS_H__ */ From patchwork Thu Jun 14 10:43:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138546 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1941020lji; Thu, 14 Jun 2018 03:44:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWjitmyQmBi4frF7kRr+cbt4xLHKbe4nTZJCgnC77VrmZo2I7x/h7GGJgicQlS4FSLRNY3 X-Received: by 2002:a17:902:7089:: with SMTP id z9-v6mr2397608plk.231.1528973063830; Thu, 14 Jun 2018 03:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973063; cv=none; d=google.com; s=arc-20160816; b=O46BoQBnBNkpTYaWVZwksy1OQfjbukycsOJVKa1iBsN+5WoEhmtb2JOI0FrJ/9rpeC 8UQ22gENfPcuITDTDPlJRvIOfGHObmjN1/FW6t/Equc6YkDNdtH1vUDe5By1I/FvsC0k eo4jGhpH9Vw8Y8qgIcty75dnkyBY5cvYj1xVju77neZiVaHETLHMqbh/Sr53p4U6sqie vomOeFVbVmhTqm6sgG559cHR2fKx9Z49cn0n5g007FyXY8wXlP6ABAMzstK/5Ua6witS 8AiVblpaE+49OnaLJ3uHL+pcMDeWhx2JmLYj+ajOYp9e10djqVSWjIcG1khCBjLuv/Gh fiNA== 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 :arc-authentication-results; bh=U39x3+GmFhXEta2G8HMZPe16wfFoZGxDiNc2P0jDGto=; b=c+tUryOLPAe0n1UQ+aNHBe4Sx51pJvjP/J0W3BeR8i9V85sxVtZQ7WtzM/+IIKxc3g 5rQqVsn1fnOK+NvOd56MYAwgROZN9Rxxzq5CWnETezFMgZ6UcJ4u/LeYXCff8XWpvJno aqVVK9Fv9GFbO26h6KS/Sd1g/RP8KXdp2E6Irqcr1V4KX33o3RiVc/Oy1xiUtupEpsGm TnJo7oga/kacL9NzDHRAkvbMQYFlRmURrkrI4SDXcmRGSPbyBsEgkmEFzlftNGcUZnuy C3mnWA1Q9AKxMt20NhxDlyH/RTVG2Sr5tUetD6aGqvW5SOOpELoeHGRHS3EIeHsfkkp4 zNog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dF5GopFe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 p187-v6si4281556pga.226.2018.06.14.03.44.23; Thu, 14 Jun 2018 03:44:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=dF5GopFe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1755146AbeFNKoW (ORCPT + 30 others); Thu, 14 Jun 2018 06:44:22 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:45312 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934160AbeFNKoS (ORCPT ); Thu, 14 Jun 2018 06:44:18 -0400 Received: by mail-lf0-f66.google.com with SMTP id n3-v6so8639235lfe.12 for ; Thu, 14 Jun 2018 03:44:17 -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=U39x3+GmFhXEta2G8HMZPe16wfFoZGxDiNc2P0jDGto=; b=dF5GopFegu/UvdDWgUYCmYWd+7kSkmgl8FqCNJTpT59kgAuBFzpUDDwYNzeNZcI4z1 qA057hIqnAsl7FbKWAtj4Y/k1Auc3cRPBTbOgyNQrkMdygOcR5BOwY77cp5+KaXDsAaO fWFVFL3WWyhV8ERnaN7UsIE5/e99pHmvHZaIk= 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=U39x3+GmFhXEta2G8HMZPe16wfFoZGxDiNc2P0jDGto=; b=UNQynEa7EvO4xC7ZF7uXx9AVK4GhMSf9URPJNWvDmKZtGiUcboLqasXJ3nf1B1Elns zMFAPGj+JOowfbTOB8KouVKJOK1qlxSogvSNqWryNA9ExCevkgapGVp8pT+DnptWQlkM 868IiaJS0vEq1HoLIKZsLViLoWymRrUXUBFbcpQLeJ729yY2p3XRGNgpEBh4KIJAEth2 JWqEt82sr6qzpqaB6I5MdwS+5T+PXDp9eJuDGKoDob/VugcGKSRnLQ44ghjv66bnNWL4 mDPuk66d5SfTjinonhOJdhSd2PsXzeaDHB6RmiDI9ECzRxwaWA8s+I1O1u7LxNoC0Yh4 Bz8A== X-Gm-Message-State: APt69E2W+804hH9wDGwNSD3c05o2NHVuJ7sTDF0OYwJrWNk2+usWG3XR MLf0hLMAKHNxwhluBmcz8HAAdg68XEQ= X-Received: by 2002:a19:97cb:: with SMTP id z194-v6mr5976920lfd.17.1528973056378; Thu, 14 Jun 2018 03:44:16 -0700 (PDT) Received: from localhost (85-76-96-172-nat.elisa-mobile.fi. [85.76.96.172]) by smtp.gmail.com with ESMTPSA id v79-v6sm888693lje.78.2018.06.14.03.44.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 03:44:15 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , linux-pm@vger.kernel.org (open list:THERMAL) Subject: [PATCH v3 5/6] thermal: tsens: Check if we have valid data before reading Date: Thu, 14 Jun 2018 13:43:15 +0300 Message-Id: <383d28a935992f62e2ff707b01de63b53e7e8418.1528972165.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-v2.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.7.4 diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index abc8f13..76fb668 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -7,6 +7,9 @@ #include #include "tsens.h" +#define TRDY_OFFSET 0xe4 +#define TRDY_READY_BIT BIT(0) + #define STATUS_OFFSET 0xa0 #define LAST_TEMP_MASK 0xfff #define STATUS_VALID_BIT BIT(21) @@ -19,6 +22,12 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) unsigned int sensor_addr; int last_temp = 0, last_temp2 = 0, last_temp3 = 0, ret; + ret = regmap_read(tmdev->map, TRDY_OFFSET, &code); + if (ret) + return ret; + if (code & TRDY_READY_BIT) + return -ENODATA; + sensor_addr = STATUS_OFFSET + s->hw_id * 4; ret = regmap_read(tmdev->map, sensor_addr, &code); if (ret) From patchwork Thu Jun 14 10:43:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138547 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1941247lji; Thu, 14 Jun 2018 03:44:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLKMKyHCww8MnoVl/I57xLQBnGg/RD303kR4AWl5YE0tCTfu+Pa+UpgxXhYUXZtwk/+P7SR X-Received: by 2002:a17:902:b08a:: with SMTP id p10-v6mr2518736plr.0.1528973079147; Thu, 14 Jun 2018 03:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973079; cv=none; d=google.com; s=arc-20160816; b=d7sTpT5oOjUOzGGFdfL4nrhWy0au8RDQ9Khm+xcB9kV2LibIdCTx0ti7yBlnqzeu1B HYsrHjzAtbi21qVMDQe3yW2qYFMgvElASa/y6Ly50Db7hPFbRD+hcg6c+ABgmCTaXiql 3cEG62LVAP07nGZyDjr+nxl/icF+iMUt3TpgLpU8+0NLLyY7SynToeSw1a9KJq7HCWbf Inz1fKdkIAggVpWxtglsLZhnEjavtRlWXiMOnZ7MmUZWh7bdGeoYDg1juZCLaFJEqWVz MSTxZ5Qy919bdOH5Ns8RPw6uS9pewEDk/E1XlFCwkG9TXFc+m1QrcLYPSeW7pSfHxchj XCuQ== 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 :arc-authentication-results; bh=IdYsJPMEv4nuycJs7YJd5jalqQSPROp1IR5aOtwfvBY=; b=Mmcw6m4E0MI0vgEgduaT7SdgFhMMMnZx4UCvQ0UQzYuuSM4TdTPwA/DjNtvYUojTwt w1CPtBkkmOunhcKp2/yhVJ9C+v9KUT2Ks07Gi7k+8YkONGreOyuArQtvYEYeX6rjQIN/ z3l3vkXx52xPHE7aItrhuQYYnO3FTUjz/t0QEk84nBVVgRo9DKZyqo50CUkxURa6PyJs mpXrcNlh/3Rlixq4KeoXEGjCRStMLr/RAT8OsffDw+ZskQhPd/nbx35pkWl4z6z7igU8 LNTXMix1s/U8ORKVSUeMKlr54Cucz0OHTBYVNtveF4oED0x95ltbcyLUy+Bk1apVgYez 5LaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DNNqEQEl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q130-v6si4328095pgq.526.2018.06.14.03.44.38; Thu, 14 Jun 2018 03:44:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=DNNqEQEl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S935994AbeFNKog (ORCPT + 30 others); Thu, 14 Jun 2018 06:44:36 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38715 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935675AbeFNKoU (ORCPT ); Thu, 14 Jun 2018 06:44:20 -0400 Received: by mail-lf0-f66.google.com with SMTP id i83-v6so8670359lfh.5 for ; Thu, 14 Jun 2018 03:44:19 -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=IdYsJPMEv4nuycJs7YJd5jalqQSPROp1IR5aOtwfvBY=; b=DNNqEQElx/o/FooOuj/KOGS343kpzBhxS//J1XqxLMibkMX3qzeC2TPfg3egF1pB4p 7x46NgwySjceY/F5/i+5ABu1s+gxVo/UflwsLdK7qBb8e3Xe+q4/74QHQMBAV9cjdeVy chCktPDFQtA/wYCLzL2oRbpWNoYBpD/5v7iMI= 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=IdYsJPMEv4nuycJs7YJd5jalqQSPROp1IR5aOtwfvBY=; b=B/eHiA08jEldWBY1i9B8kenURxNASyyIA9z+9IuwT+ZztoX3KIqfPrsIrwH+EX3JZx ZSMwdSFGaEVDPv1Y1gnD/bNnsSvXn+2KW0L4QJc5b+Pwma2r84renILynGXZ/kpRiKSS 7b9gkPBPljM8HnRXTludxGjJjPlHjQU7W+f49skFCJ+ZRl++Nz/yK2IUFl3BfYZlgylz VyXxuD6Yxx/08w5U8GqvsyHEWT8UXTY3xwoSHqNkzpr0caXk3rEDljmy5vbgcFgQZhdu ZJCjnkRtfzscbTUDYQa1p1iRu86l6vu3fxsD9ACk9a2nXDOWIgCztjyE7DzmHWlQpm5M 1sWw== X-Gm-Message-State: APt69E0CB3PgM+Pzn8KTuOkYE9SBoZKvi8dUmC8hlhN60silNeUPOUG/ hq5NWA7f9yiw2vu1mvL+tAn+gBPsfqw= X-Received: by 2002:a2e:5047:: with SMTP id v7-v6mr1475075ljd.122.1528973058659; Thu, 14 Jun 2018 03:44:18 -0700 (PDT) Received: from localhost (85-76-96-172-nat.elisa-mobile.fi. [85.76.96.172]) by smtp.gmail.com with ESMTPSA id u85-v6sm1022465lfi.5.2018.06.14.03.44.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 03:44:17 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, David Brown , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , linux-soc@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)) Subject: [PATCH v3 6/6] arm64: dts: sdm845: Add tsens nodes Date: Thu, 14 Jun 2018 13:43:16 +0300 Message-Id: <448cdc793c6ac83ab6d0ba2a6bef00036ad20801.1528972165.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.7.4 diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index cdaabeb..7dd59b4 100644 --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi @@ -221,6 +221,22 @@ #interrupt-cells = <2>; }; + tsens0: tsens@c222000 { + compatible = "qcom,tsens-v2"; + reg = <0xc263000 0x1ff>, /* TM */ + <0xc222000 0x1ff>; /* SROT */ + #qcom,sensors = <13>; + #thermal-sensor-cells = <1>; + }; + + tsens1: tsens@c223000 { + compatible = "qcom,tsens-v2"; + reg = <0xc265000 0x1ff>, /* TM */ + <0xc223000 0x1ff>; /* SROT */ + #qcom,sensors = <8>; + #thermal-sensor-cells = <1>; + }; + spmi_bus: spmi@c440000 { compatible = "qcom,spmi-pmic-arb"; reg = <0xc440000 0x1100>,