Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2829092imm; Thu, 9 Aug 2018 22:09:52 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy78iWwFv6nvu9ezPA3xWc98wP8Ba8y9euwbxnngHnvdPzAB7gxWmVd0PlD6g4W4cUvzF1G X-Received: by 2002:a62:cd82:: with SMTP id o124-v6mr5372871pfg.206.1533877792032; Thu, 09 Aug 2018 22:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533877791; cv=none; d=google.com; s=arc-20160816; b=O1Sx8j6zWbJ+YYtYOB5dq3YSz0szB8wVfQ9WHDUQTGo1SjT5c3nYTGEf8pe4oA6nFs 2T/Ja9VxdQdQt83HHiAewMdjP4v2Ib8ysrVtf7CEPJVuAvDWe7CAJueKatFNahzhXIP0 1J0xujR3+SYaFPNqmeqM1XZ5dxprW+8Zn80Fz3BA/4HtCYfZTVPwG/BEVbVWPWPnT1O+ B8BJRuFzq673GPU8LRyA0gD9heg3wnckRnJ6WU1g6xScnri9Mcvtbrk6Fc0Q/BAnTdwj K5bVIW9fetXuIiMQ+MhUjlDZNpTw4GBDsOgrx7KEwoH+oKkwV49ma77BSs15kZF2Cbwq rHDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=8OzhIxVdXSNF2GLduVefPFaAe0chQj0CXHcsUpdCbfY=; b=ry/SUxtrXn2AU4K1NBjJwco7OaD9zHh41H4m9A2nmaaW7u0wzMiejHx6A13rHeQaIx 4K/UGjo5FPGR8WZ0wIw5a3lzVUboIe5YAA7Y2Fzpf6Be9BgaRD4PIMh8v/1WElhOXVf+ Rn2DOpY67MaBu5xXEdJGsEKk55ZqE2M0zKAewSB/DuejlvDrAlgnUT5wGxT+Lp/Yb0ek AbLm3NnHJVmlE+8gICTrXDuAifnWSWXKkt4AD7s1W1F9z/a/Bd+Prt1m3OnPWi86UJvy +kNgsnGvAgk5K7HwvolGw/dbW533vj/dnC6wdJHU3A44GcMrJvGReHeMqFHwfWFabMCU SGqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQxm1zbZ; 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 j91-v6si7076384pld.474.2018.08.09.22.09.36; Thu, 09 Aug 2018 22:09:51 -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=SQxm1zbZ; 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 S1727236AbeHJHTB (ORCPT + 99 others); Fri, 10 Aug 2018 03:19:01 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:46660 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbeHJHTB (ORCPT ); Fri, 10 Aug 2018 03:19:01 -0400 Received: by mail-qt0-f193.google.com with SMTP id d4-v6so9019256qtn.13 for ; Thu, 09 Aug 2018 21:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8OzhIxVdXSNF2GLduVefPFaAe0chQj0CXHcsUpdCbfY=; b=SQxm1zbZehNvXkhErY4pPMQztRM6wpFYHQbAF9d2DVu5sSvgVn/fjWxkEZjGt31crA Qez0OcPaVOp2wc62INJOycp6qmbcZ8N79Kb7+V40OjhzStGm4j4kLi981yU/RMhE2lgs utg2DorbatzsQDmouffLvqPRMvI8F0WU8u/TA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8OzhIxVdXSNF2GLduVefPFaAe0chQj0CXHcsUpdCbfY=; b=mJMrHtcmepSd/PeRnu99jzMaltoL0jGTv83l72bhmZDa8sQg8ByRFOjL/efng1aKl/ NdFcfeW1ZxVBAYGinjx1adHvrXJJEs29SoljmD3eHpl/OLbQCdnF9OCXyY67ogtNNZMR 32QWiMIW8nbgbLjx+i0YO1dmWxZQKg71MzBLX+VrGsMWhKMl+jAr1mk+zcui0S4IDEDn wnCv1cmZ7wcJhTb3Si4UaNdKyFgarF7U7D72HJW0oaki//Y4vz2VDAd9bWVxI7VeytVr ARbN2iEYiZ/r6rKH4bLHWpHrowQ3RJAoIxtYc4HCwCU2sztMkvJrUGTmyYX9R7MTx7Jm m6kQ== X-Gm-Message-State: AOUpUlGXMmmDIrDxoPBJH/AP5tksO1I9Zh6k3UoWPCHaYSYODFXt/mhU 7ui987BhDxkNtgfUBT+aGN2epTBVeJR8pZ6ORu+KJg== X-Received: by 2002:a0c:d1c5:: with SMTP id k5-v6mr4440932qvh.14.1533876650703; Thu, 09 Aug 2018 21:50:50 -0700 (PDT) MIME-Version: 1.0 References: <20180809191059.GI160295@google.com> In-Reply-To: <20180809191059.GI160295@google.com> From: Amit Kucheria Date: Fri, 10 Aug 2018 10:20:38 +0530 Message-ID: Subject: Re: [PATCH v1 01/10] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two To: mka@chromium.org Cc: Linux Kernel Mailing List , Rajendra Nayak , linux-arm-msm , Bjorn Andersson , Eduardo Valentin , smohanad@codeaurora.org, Andy Gross , Doug Anderson , David Brown , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Zhang Rui , "open list:ARM/QUALCOMM SUPPORT" , DTML , Lists LAKML , Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 10, 2018 at 12:41 AM Matthias Kaehlcke wrote: > > On Thu, Aug 09, 2018 at 06:02:33PM +0530, Amit Kucheria wrote: > > We've earlier added support to split the register address space into TM > > and SROT regions. > > > > Split up the regmap address space into two for the remaining platforms that > > have a similar register layout and make corresponding changes to the > > get_temp_common() function used by these platforms. > > > > 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/arm/boot/dts/qcom-msm8974.dtsi | 6 ++++-- > > arch/arm64/boot/dts/qcom/msm8916.dtsi | 6 ++++-- > > drivers/thermal/qcom/tsens-common.c | 5 +++-- > > 3 files changed, 11 insertions(+), 6 deletions(-) > > > > diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi > > index d9019a49b292..3c4b81c29798 100644 > > --- a/arch/arm/boot/dts/qcom-msm8974.dtsi > > +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi > > @@ -427,11 +427,13 @@ > > }; > > }; > > > > - tsens: thermal-sensor@fc4a8000 { > > + tsens: thermal-sensor@fc4a9000 { > > compatible = "qcom,msm8974-tsens"; > > - reg = <0xfc4a8000 0x2000>; > > + reg = <0xfc4a9000 0x1000>, /* TM */ > > + <0xfc4a8000 0x1000>; /* SROT */ > > nvmem-cells = <&tsens_calib>, <&tsens_backup>; > > nvmem-cell-names = "calib", "calib_backup"; > > + #qcom,sensors = <11>; > > nit: adding the number of sensors isn't directly related and probably > should be in a separate patch. Not important enough to re-spin just > for this though ;-) Hi Matthias, Sometimes the urge to avoid frivolous patches takes over too strongly. :-) I'll split it out in a respin. Thanks for the quick review of the series. Regards, Amit > > #thermal-sensor-cells = <1>; > > }; > > > > diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi > > index cc1040eacdf5..abf84df5a7bc 100644 > > --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi > > +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi > > @@ -774,11 +774,13 @@ > > }; > > }; > > > > - tsens: thermal-sensor@4a8000 { > > + tsens: thermal-sensor@4a9000 { > > compatible = "qcom,msm8916-tsens"; > > - reg = <0x4a8000 0x2000>; > > + reg = <0x4a9000 0x1000>, /* TM */ > > + <0x4a8000 0x1000>; /* SROT */ > > nvmem-cells = <&tsens_caldata>, <&tsens_calsel>; > > nvmem-cell-names = "calib", "calib_sel"; > > + #qcom,sensors = <5>; > > ditto > > > #thermal-sensor-cells = <1>; > > }; > > > > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c > > index 6207d8d92351..478739543bbc 100644 > > --- a/drivers/thermal/qcom/tsens-common.c > > +++ b/drivers/thermal/qcom/tsens-common.c > > @@ -21,7 +21,7 @@ > > #include > > #include "tsens.h" > > > > -#define S0_ST_ADDR 0x1030 > > +#define STATUS_OFFSET 0x30 > > #define SN_ADDR_OFFSET 0x4 > > #define SN_ST_TEMP_MASK 0x3ff > > #define CAL_DEGC_PT1 30 > > @@ -107,8 +107,9 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp) > > unsigned int status_reg; > > int last_temp = 0, ret; > > > > - status_reg = S0_ST_ADDR + s->hw_id * SN_ADDR_OFFSET; > > + status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * SN_ADDR_OFFSET; > > ret = regmap_read(tmdev->map, status_reg, &code); > > + > > if (ret) > > return ret; > > last_temp = code & SN_ST_TEMP_MASK; > > Reviewed-by: Matthias Kaehlcke