linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: Robert Lee <rob.lee@linaro.org>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	Philipp Ahmann <pahmann@de.adit-jv.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"amit.kucheria@linaro.org" <amit.kucheria@linaro.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"amit.kachhap@linaro.org" <amit.kachhap@linaro.org>,
	Ying-Chun Liu <paul.liu@linaro.org>,
	"shawn.guo@freescale.com" <shawn.guo@freescale.com>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [RFC PATCH v4] ARM: imx: Add basic imx6q thermal management
Date: Wed, 13 Jun 2012 10:46:31 +0200	[thread overview]
Message-ID: <4FD85367.5000302@de.bosch.com> (raw)
In-Reply-To: <1326940051-31016-2-git-send-email-rob.lee@linaro.org>

On 19.01.2012 03:27, Robert Lee wrote:
> Adds support for temperature sensor readings, registers with common
> thermal framework, and uses the new common cpu_cooling interface.
> 
> Signed-off-by: Robert Lee <rob.lee@linaro.org>
> ---
>  arch/arm/boot/dts/imx6q.dtsi    |    1 +
>  drivers/thermal/Kconfig         |    6 +
>  drivers/thermal/Makefile        |    1 +
>  drivers/thermal/imx6q_thermal.c |  540 +++++++++++++++++++++++++++++++++++++++
>  4 files changed, 548 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/thermal/imx6q_thermal.c
...
> +static int __init imx6q_thermal_init(void)
> +{
> +       struct device_node *np_ocotp, *np_anatop;
> +       unsigned int fuse_data;
> +       int ret;
> +
> +       np_ocotp = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp");
> +       np_anatop = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
> +
> +       if (!(np_ocotp && np_anatop))
> +               return -ENXIO; /* not a compatible platform */
> +
> +       ocotp_base = of_iomap(np_ocotp, 0);
> +
> +       if (!ocotp_base) {
> +               pr_err("Could not retrieve ocotp-base\n");
> +               ret = -ENXIO;
> +               goto err_unregister;
> +       }
> +
> +       anatop_base = of_iomap(np_anatop, 0);
> +
> +       if (!anatop_base) {
> +               pr_err("Could not retrieve anantop-base\n");
> +               ret = -ENXIO;
> +               goto err_unregister;
> +       }
> +
> +       fuse_data = readl_relaxed(ocotp_base + HW_OCOTP_ANA1);

To be able to use this on non-calibrated sample devices, we had to add [1].

Best regards

Dirk

[1]

From: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Subject: [PATCH] ARM: imx6: thermal: Add workaround for missing 
calibration data

Sample devices not calibrated in the production don't have the fuses 
containing
the calibration data. Hardcode this value if the fuse data read is zero 
to be able
to use the thermal functinality on these sample devices, too.

Signed-off-by: Ying-Chun Liu <paul.liu@linaro.org>
Signed-off-by: Philipp Ahmann <pahmann@de.adit-jv.com>
---
  drivers/thermal/imx6q_thermal.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/thermal/imx6q_thermal.c 
b/drivers/thermal/imx6q_thermal.c
index 76b7ba1..543cd75 100644
--- a/drivers/thermal/imx6q_thermal.c
+++ b/drivers/thermal/imx6q_thermal.c
@@ -446,6 +446,8 @@ static int __init imx6q_thermal_init(void)
  	}

  	fuse_data = readl_relaxed(ocotp_base + HW_OCOTP_ANA1);
+	if (fuse_data == 0)
+		fuse_data = 0x5704c67d;

  	th_zone = kzalloc(sizeof(struct imx6q_thermal_zone), GFP_KERNEL);
  	if (!th_zone) {
-- 
1.7.0.4

      reply	other threads:[~2012-06-13  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19  2:27 [RFC PATCH v4] ARM: imx: Add basic imx6q thermal management Robert Lee
2012-01-19  2:27 ` Robert Lee
2012-06-13  8:46   ` Dirk Behme [this message]

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=4FD85367.5000302@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=amit.kachhap@linaro.org \
    --cc=amit.kucheria@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=pahmann@de.adit-jv.com \
    --cc=paul.liu@linaro.org \
    --cc=rob.lee@linaro.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@freescale.com \
    /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).