From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Amit Kucheria <amit.kucheria@linaro.org>
Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org,
linux-arm-msm@vger.kernel.org, edubezval@gmail.com,
smohanad@codeaurora.org, andy.gross@linaro.org,
dianders@chromium.org, mka@chromium.org,
David Brown <david.brown@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Zhang Rui <rui.zhang@intel.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
linux-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 01/11] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two
Date: Mon, 3 Sep 2018 13:02:55 -0700 [thread overview]
Message-ID: <20180903200255.GL3456@tuxbook-pro> (raw)
In-Reply-To: <882739b10bd0a3b655baef9b7ee1958680aa0b04.1535462942.git.amit.kucheria@linaro.org>
On Tue 28 Aug 06:38 PDT 2018, 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.
>
Having a single patch touching both code and dts will cause merge issues
as this patch travel upstream. Even more arm-soc expects arm and arm64
dts changes to come in different pull requests.
Please split it so that the three pieces can be picked up by respective
maintainer.
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> ---
> arch/arm/boot/dts/qcom-msm8974.dtsi | 5 +++--
> arch/arm64/boot/dts/qcom/msm8916.dtsi | 5 +++--
> drivers/thermal/qcom/tsens-common.c | 5 +++--
> 3 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
> index d9019a49b292..56dbbf788d15 100644
> --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
> @@ -427,9 +427,10 @@
> };
> };
>
> - 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";
> #thermal-sensor-cells = <1>;
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 7b32b8990d62..6a277fce3333 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -761,9 +761,10 @@
> };
> };
>
> - 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";
> #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 <linux/regmap.h>
> #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;
Wasn't this change part of the previous set that introduced the
tm_offset? If not how did we handle the fact that tmdev->map is already
indented 0x1000 bytes?
Both changes looks good, but I'm worries about the order of things.
Regards,
Bjorn
> ret = regmap_read(tmdev->map, status_reg, &code);
> +
> if (ret)
> return ret;
> last_temp = code & SN_ST_TEMP_MASK;
> --
> 2.17.1
>
next prev parent reply other threads:[~2018-09-03 19:59 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 13:38 [PATCH v2 00/11] Another round of tsens cleanups Amit Kucheria
2018-08-28 13:38 ` [PATCH v2 01/11] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two Amit Kucheria
2018-09-03 20:02 ` Bjorn Andersson [this message]
2018-09-06 9:24 ` Amit Kucheria
2018-08-28 13:38 ` [PATCH v2 02/11] arm/arm64: dts: msm8974/msm8916: thermal: Add "qcom,sensors" property Amit Kucheria
2018-09-03 20:03 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 03/11] dt-bindings: thermal: Fix a typo in documentation Amit Kucheria
2018-09-03 20:04 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 04/11] thermal: tsens: Add SPDX license identifiers Amit Kucheria
2018-09-03 20:04 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 05/11] thermal: tsens: Get rid of dead code Amit Kucheria
2018-09-03 20:22 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 06/11] thermal: tsens: Rename map field in order to add a second address map Amit Kucheria
2018-09-03 20:23 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 07/11] thermal: tsens: Add the SROT " Amit Kucheria
2018-09-03 20:28 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 08/11] thermal: tsens: Check if the IP is correctly enabled by firmware Amit Kucheria
2018-08-30 19:23 ` Amit Kucheria
2018-09-03 20:48 ` Bjorn Andersson
2018-09-06 10:00 ` Amit Kucheria
2018-08-28 13:38 ` [PATCH v2 09/11] thermal: tsens: Get rid of 'id' field Amit Kucheria
2018-09-03 20:26 ` Bjorn Andersson
2018-08-28 13:38 ` [PATCH v2 10/11] arm64: dts: qcom: Add reg-names for all tsens nodes Amit Kucheria
2018-09-03 20:34 ` Bjorn Andersson
2018-09-04 23:42 ` Doug Anderson
2018-08-28 13:38 ` [PATCH v2 11/11] MAINTAINERS: Add entry for Qualcomm TSENS thermal drivers Amit Kucheria
2018-09-03 20:46 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180903200255.GL3456@tuxbook-pro \
--to=bjorn.andersson@linaro.org \
--cc=amit.kucheria@linaro.org \
--cc=andy.gross@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=edubezval@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mka@chromium.org \
--cc=rnayak@codeaurora.org \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=smohanad@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).