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,
Zhang Rui <rui.zhang@intel.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 07/11] thermal: tsens: Add the SROT address map
Date: Mon, 3 Sep 2018 13:28:22 -0700 [thread overview]
Message-ID: <20180903202822.GS3456@tuxbook-pro> (raw)
In-Reply-To: <d1d2e58288f4d78db924863ac1775c5e2e5c884a.1535462942.git.amit.kucheria@linaro.org>
On Tue 28 Aug 06:38 PDT 2018, Amit Kucheria wrote:
> On platforms whose device trees specify two address spaces for TSENS, the
> second one points to the SROT registers. Initialise the SROT map on those
> platforms.
>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> ---
> drivers/thermal/qcom/tsens-common.c | 14 ++++++++++++--
> drivers/thermal/qcom/tsens.h | 1 +
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
> index 0585084630b3..0b8a793f15f4 100644
> --- a/drivers/thermal/qcom/tsens-common.c
> +++ b/drivers/thermal/qcom/tsens-common.c
> @@ -117,16 +117,26 @@ static const struct regmap_config tsens_config = {
>
> int __init init_common(struct tsens_device *tmdev)
> {
> - void __iomem *tm_base;
> + void __iomem *tm_base, *srot_base;
> struct resource *res;
> struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node);
>
> if (!op)
> return -EINVAL;
>
> - /* The driver only uses the TM register address space for now */
> if (op->num_resources > 1) {
> + /* DT with separate SROT and TM address space */
> tmdev->tm_offset = 0;
> + res = platform_get_resource(op, IORESOURCE_MEM, 1);
> + srot_base = devm_ioremap_resource(&op->dev, res);
> + if (IS_ERR(srot_base))
> + return PTR_ERR(srot_base);
> +
> + tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev,
> + srot_base, &tsens_config);
> + if (IS_ERR(tmdev->srot_map))
> + return PTR_ERR(tmdev->srot_map);
> +
> } else {
> /* old DTs where SROT and TM were in a contiguous 2K block */
> tmdev->tm_offset = 0x1000;
> diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h
> index 58e98c4d3a8b..b9c4bcf255fa 100644
> --- a/drivers/thermal/qcom/tsens.h
> +++ b/drivers/thermal/qcom/tsens.h
> @@ -70,6 +70,7 @@ struct tsens_device {
> struct device *dev;
> u32 num_sensors;
> struct regmap *tm_map;
> + struct regmap *srot_map;
> u32 tm_offset;
> struct tsens_context ctx;
> const struct tsens_ops *ops;
> --
> 2.17.1
>
next prev parent reply other threads:[~2018-09-03 20:28 UTC|newest]
Thread overview: 20+ 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
2018-09-06 9:24 ` Amit Kucheria
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 [this message]
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
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=20180903202822.GS3456@tuxbook-pro \
--to=bjorn.andersson@linaro.org \
--cc=amit.kucheria@linaro.org \
--cc=andy.gross@linaro.org \
--cc=daniel.lezcano@linaro.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=mka@chromium.org \
--cc=rnayak@codeaurora.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).