Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2409403imm; Thu, 9 Aug 2018 12:23:38 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz6qyTo0EH4EV1UmOB8uBATaEfQTN5qahAShoetXP7oCOvL1rRwvxxSos6o2OcP7saOcTZA X-Received: by 2002:a17:902:44a4:: with SMTP id l33-v6mr3203519pld.134.1533842618003; Thu, 09 Aug 2018 12:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533842617; cv=none; d=google.com; s=arc-20160816; b=dA/VOIpQ2sC8kj/Eb3gUvWSDiry9r4eHHhRlvylg0oJz74TDXKdOvMh0hvTdnr/Uiw 2V2bYi5r6qNx43b0MKg9i4aYryfdKnyL+LWpVLKSGIUIy9aPkdsJJZrSb1F1AAm1E4AA Nql/f95eOpP7r274GMGEgD70vBstgAKXD8/VQr6frn1krdlw1bI8tRvomKSknfR7I/TK HL7wrOlQeAm7y0409i7M9oopUig/RM08o2vsQTdbO2YBTHE/WIm2Att35jLHs//cTDzw oAA84hfJgUKVRTKoO/BC+tAXhLY55PuNIYk++gTfvrZlLjD41ng6wh5KB9Jly2FKtah/ vu8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=qY/nUCJlHonZ9QIQuM23V5KBY1h8mqc6sUd7aertdxs=; b=q9o5ndRItPgGC0fN+rgpkpol3x5LI/LGnBqcI9/oZZU7RYUqAuKCUURRt0c9dNdQsR Za1AikPg42zsyxqBlwEy8lFCDWEOmp0/QvYIaxq8WSOZJR1FXuYFWs8L9chP9W8EVLpv 2wH4d1CQGi47UFczs9+njIb/XSRP/0xORWzf+IAHQc6jEIH+cyjhSL8J1WVggul4LOG0 e7S6BdUxpgYCI6Pnw739QcsbhV0xIuEsvJCB2Yn4dZwc43j7QdgW0euS481oTB/mjETy ggBUzddSo8B8YBJpbxxiss94jAnmkxa/VyUN834WbfGTdCBvUSDEUUFNpweb1w93+fL2 qT7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DKBunHGn; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg9-v6si6394575plb.243.2018.08.09.12.22.57; Thu, 09 Aug 2018 12:23:37 -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=@chromium.org header.s=google header.b=DKBunHGn; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbeHIVhN (ORCPT + 99 others); Thu, 9 Aug 2018 17:37:13 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37554 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbeHIVhN (ORCPT ); Thu, 9 Aug 2018 17:37:13 -0400 Received: by mail-pg1-f193.google.com with SMTP id n7-v6so3184080pgq.4 for ; Thu, 09 Aug 2018 12:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qY/nUCJlHonZ9QIQuM23V5KBY1h8mqc6sUd7aertdxs=; b=DKBunHGnvIGbxHhMkp+iZdjZC57rR6CDJvLbfmwrEnmaNs2BesY8xc1hb8Tghf84Jj 2vfBFvXx+5OPEW7ON27FeKVdIqcCR8q19+qPQlrPvEy6B2w2T6QhLvkD+5mqelsjtiOb eIketuZzy2FvnW8LDdUafc26dUTLy8AfV6xQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qY/nUCJlHonZ9QIQuM23V5KBY1h8mqc6sUd7aertdxs=; b=ND4GS59co63vg8/Svv0Zl9w/OCdlvXQHys4dex9YVjZvlplYQc0H5RISO9RPuLhnuW n6QP3Eki3xqHoU7YjywhbyORugq3H9jpthIP0v9q0fUOEGE29/DETyoW0CMSlwe+gYzO tLC6H9HW00ELsAbJ6+1ugANRDhqgLIxDTeqwo1hm8gCGrdpXuAAXeoMqdLKkUQx94ThZ IrtE8rC0+G1Gim59nUDMMiZ3PU3WpnTr12+EsPY8C7NLaFsjt1R3ztT5Vp460Ig17t0Y irRjqpoyj/RdkFe084NqJVg4RKZdlcFcMlk98t4SEjJ/VBaUkBvSHR8wQtTnHVGRooN+ 33Rw== X-Gm-Message-State: AOUpUlHk4oU8ylDSCpZTw6GvuXJgB4GuJxLz9vmPlPVQ/Cb5CnrCVp4L kfKyd3ZhJ+g7PvGg/Qgo/5tfVA== X-Received: by 2002:a62:8acd:: with SMTP id o74-v6mr3683204pfk.12.1533841861195; Thu, 09 Aug 2018 12:11:01 -0700 (PDT) Received: from localhost ([2620:15c:202:1:b6af:f85:ed6c:ac6a]) by smtp.gmail.com with ESMTPSA id a20-v6sm15973850pfc.14.2018.08.09.12.11.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 12:11:00 -0700 (PDT) Date: Thu, 9 Aug 2018 12:10:59 -0700 From: Matthias Kaehlcke To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, 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, David Brown , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Zhang Rui , linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v1 01/10] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two Message-ID: <20180809191059.GI160295@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ;-) > #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