From: Daniel Lezcano <daniel.lezcano@linaro.org> To: Alexander Stein <alexander.stein@ew.tq-group.com>, "Rafael J . Wysocki" <rafael@kernel.org>, Zhang Rui <rui.zhang@intel.com>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Fabio Estevam <festevam@gmail.com> Cc: Paul Gerber <Paul.Gerber@tq-group.com>, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor Date: Tue, 30 Nov 2021 15:49:48 +0100 [thread overview] Message-ID: <2786750e-0556-a1b8-e464-30de05ce7cf2@linaro.org> (raw) In-Reply-To: <20211122114225.196280-1-alexander.stein@ew.tq-group.com> On 22/11/2021 12:42, Alexander Stein wrote: > From: Paul Gerber <Paul.Gerber@tq-group.com> > > The i.MX 8MP has a ADC_PD bit in the TMU_TER register that controls the > operating mode of the ADC: > * 0 means normal operating mode > * 1 means power down mode > > When enabling/disabling the TMU, the ADC operating mode must be set > accordingly. > > i.MX 8M Mini & Nano are lacking this bit. > > Signed-off-by: Paul Gerber <Paul.Gerber@tq-group.com> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > --- > Often this bit is set already by the bootloader, but in case this is not > done, the file /sys/class/thermal/thermal_zone0/temp will always return > -EAGAIN. Does it deserve a Fixes tag? > drivers/thermal/imx8mm_thermal.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c > index 7442e013738f..af666bd9e8d4 100644 > --- a/drivers/thermal/imx8mm_thermal.c > +++ b/drivers/thermal/imx8mm_thermal.c > @@ -21,6 +21,7 @@ > #define TPS 0x4 > #define TRITSR 0x20 /* TMU immediate temp */ > > +#define TER_ADC_PD BIT(30) > #define TER_EN BIT(31) > #define TRITSR_TEMP0_VAL_MASK 0xff > #define TRITSR_TEMP1_VAL_MASK 0xff0000 > @@ -113,6 +114,8 @@ static void imx8mm_tmu_enable(struct imx8mm_tmu *tmu, bool enable) > > val = readl_relaxed(tmu->base + TER); > val = enable ? (val | TER_EN) : (val & ~TER_EN); > + if (tmu->socdata->version == TMU_VER2) > + val = enable ? (val & ~TER_ADC_PD) : (val | TER_ADC_PD); > writel_relaxed(val, tmu->base + TER); > } > > -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano@linaro.org> To: Alexander Stein <alexander.stein@ew.tq-group.com>, "Rafael J . Wysocki" <rafael@kernel.org>, Zhang Rui <rui.zhang@intel.com>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Fabio Estevam <festevam@gmail.com> Cc: Paul Gerber <Paul.Gerber@tq-group.com>, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor Date: Tue, 30 Nov 2021 15:49:48 +0100 [thread overview] Message-ID: <2786750e-0556-a1b8-e464-30de05ce7cf2@linaro.org> (raw) In-Reply-To: <20211122114225.196280-1-alexander.stein@ew.tq-group.com> On 22/11/2021 12:42, Alexander Stein wrote: > From: Paul Gerber <Paul.Gerber@tq-group.com> > > The i.MX 8MP has a ADC_PD bit in the TMU_TER register that controls the > operating mode of the ADC: > * 0 means normal operating mode > * 1 means power down mode > > When enabling/disabling the TMU, the ADC operating mode must be set > accordingly. > > i.MX 8M Mini & Nano are lacking this bit. > > Signed-off-by: Paul Gerber <Paul.Gerber@tq-group.com> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> > --- > Often this bit is set already by the bootloader, but in case this is not > done, the file /sys/class/thermal/thermal_zone0/temp will always return > -EAGAIN. Does it deserve a Fixes tag? > drivers/thermal/imx8mm_thermal.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c > index 7442e013738f..af666bd9e8d4 100644 > --- a/drivers/thermal/imx8mm_thermal.c > +++ b/drivers/thermal/imx8mm_thermal.c > @@ -21,6 +21,7 @@ > #define TPS 0x4 > #define TRITSR 0x20 /* TMU immediate temp */ > > +#define TER_ADC_PD BIT(30) > #define TER_EN BIT(31) > #define TRITSR_TEMP0_VAL_MASK 0xff > #define TRITSR_TEMP1_VAL_MASK 0xff0000 > @@ -113,6 +114,8 @@ static void imx8mm_tmu_enable(struct imx8mm_tmu *tmu, bool enable) > > val = readl_relaxed(tmu->base + TER); > val = enable ? (val | TER_EN) : (val & ~TER_EN); > + if (tmu->socdata->version == TMU_VER2) > + val = enable ? (val & ~TER_ADC_PD) : (val | TER_ADC_PD); > writel_relaxed(val, tmu->base + TER); > } > > -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-11-30 14:53 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-22 11:42 [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor Alexander Stein 2021-11-22 11:42 ` Alexander Stein 2021-11-30 14:49 ` Daniel Lezcano [this message] 2021-11-30 14:49 ` Daniel Lezcano 2021-12-01 14:45 ` (EXT) " Alexander Stein 2021-12-01 14:45 ` Alexander Stein 2021-12-01 14:52 ` Daniel Lezcano 2021-12-01 14:52 ` Daniel Lezcano 2021-12-01 15:19 ` (EXT) " Alexander Stein 2021-12-01 15:19 ` Alexander Stein 2021-12-12 11:20 ` [thermal: thermal/next] thermal/drivers/imx8mm: Enable " thermal-bot for Paul Gerber
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=2786750e-0556-a1b8-e464-30de05ce7cf2@linaro.org \ --to=daniel.lezcano@linaro.org \ --cc=Paul.Gerber@tq-group.com \ --cc=alexander.stein@ew.tq-group.com \ --cc=festevam@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=rafael@kernel.org \ --cc=rui.zhang@intel.com \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.