All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
@ 2021-11-22 11:42 ` Alexander Stein
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2021-11-22 11:42 UTC (permalink / raw)
  To: Rafael J . Wysocki, Daniel Lezcano, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel, Alexander Stein

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.

 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);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
@ 2021-11-22 11:42 ` Alexander Stein
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2021-11-22 11:42 UTC (permalink / raw)
  To: Rafael J . Wysocki, Daniel Lezcano, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel, Alexander Stein

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.

 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);
 }
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
  2021-11-22 11:42 ` Alexander Stein
@ 2021-11-30 14:49   ` Daniel Lezcano
  -1 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2021-11-30 14:49 UTC (permalink / raw)
  To: Alexander Stein, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
@ 2021-11-30 14:49   ` Daniel Lezcano
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2021-11-30 14:49 UTC (permalink / raw)
  To: Alexander Stein, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: (EXT) Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
  2021-11-30 14:49   ` Daniel Lezcano
@ 2021-12-01 14:45     ` Alexander Stein
  -1 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2021-12-01 14:45 UTC (permalink / raw)
  To: Daniel Lezcano, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

Am Dienstag, dem 30.11.2021 um 15:49 +0100 schrieb Daniel Lezcano:
> 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?

The more I think about it, the more I'm inclined to add one.
Please tell me if I shall iterate v2 adding a Fixes tag (or other
changes)

Best regards,
Alexander



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: (EXT) Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
@ 2021-12-01 14:45     ` Alexander Stein
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2021-12-01 14:45 UTC (permalink / raw)
  To: Daniel Lezcano, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

Am Dienstag, dem 30.11.2021 um 15:49 +0100 schrieb Daniel Lezcano:
> 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?

The more I think about it, the more I'm inclined to add one.
Please tell me if I shall iterate v2 adding a Fixes tag (or other
changes)

Best regards,
Alexander



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: (EXT) Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
  2021-12-01 14:45     ` Alexander Stein
@ 2021-12-01 14:52       ` Daniel Lezcano
  -1 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2021-12-01 14:52 UTC (permalink / raw)
  To: Alexander Stein, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

On 01/12/2021 15:45, Alexander Stein wrote:
> Am Dienstag, dem 30.11.2021 um 15:49 +0100 schrieb Daniel Lezcano:
>> 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?
> 
> The more I think about it, the more I'm inclined to add one.
> Please tell me if I shall iterate v2 adding a Fixes tag (or other
> changes)

It is not necessary to send a V2 as the commit log will have a link to
this thread. Just answer with the Fixes tag, I'll add it myself to the
change log.



-- 
<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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: (EXT) Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
@ 2021-12-01 14:52       ` Daniel Lezcano
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2021-12-01 14:52 UTC (permalink / raw)
  To: Alexander Stein, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

On 01/12/2021 15:45, Alexander Stein wrote:
> Am Dienstag, dem 30.11.2021 um 15:49 +0100 schrieb Daniel Lezcano:
>> 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?
> 
> The more I think about it, the more I'm inclined to add one.
> Please tell me if I shall iterate v2 adding a Fixes tag (or other
> changes)

It is not necessary to send a V2 as the commit log will have a link to
this thread. Just answer with the Fixes tag, I'll add it myself to the
change log.



-- 
<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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: (EXT) Re: (EXT) Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
  2021-12-01 14:52       ` Daniel Lezcano
@ 2021-12-01 15:19         ` Alexander Stein
  -1 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2021-12-01 15:19 UTC (permalink / raw)
  To: Daniel Lezcano, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

Am Mittwoch, dem 01.12.2021 um 15:52 +0100 schrieb Daniel Lezcano:
> On 01/12/2021 15:45, Alexander Stein wrote:
> > Am Dienstag, dem 30.11.2021 um 15:49 +0100 schrieb Daniel Lezcano:
> > > 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?
> > 
> > The more I think about it, the more I'm inclined to add one.
> > Please tell me if I shall iterate v2 adding a Fixes tag (or other
> > changes)
> 
> It is not necessary to send a V2 as the commit log will have a link
> to
> this thread. Just answer with the Fixes tag, I'll add it myself to
> the
> change log.

Thanks.

Fixes: 2b8f1f0337c5 ("thermal: imx8mm: Add i.MX8MP support")

imx8mm_tmu_enable() was introduced in this commit and the fix is about
i.MX8MP as well, so this seems even more reasonable to me.

Best regards,
Alexander



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: (EXT) Re: (EXT) Re: [PATCH 1/1] thermal: imx8mm: enable ADC when enabling monitor
@ 2021-12-01 15:19         ` Alexander Stein
  0 siblings, 0 replies; 11+ messages in thread
From: Alexander Stein @ 2021-12-01 15:19 UTC (permalink / raw)
  To: Daniel Lezcano, Rafael J . Wysocki, Zhang Rui, Shawn Guo,
	Sascha Hauer, Fabio Estevam
  Cc: Paul Gerber, linux-pm, linux-arm-kernel

Am Mittwoch, dem 01.12.2021 um 15:52 +0100 schrieb Daniel Lezcano:
> On 01/12/2021 15:45, Alexander Stein wrote:
> > Am Dienstag, dem 30.11.2021 um 15:49 +0100 schrieb Daniel Lezcano:
> > > 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?
> > 
> > The more I think about it, the more I'm inclined to add one.
> > Please tell me if I shall iterate v2 adding a Fixes tag (or other
> > changes)
> 
> It is not necessary to send a V2 as the commit log will have a link
> to
> this thread. Just answer with the Fixes tag, I'll add it myself to
> the
> change log.

Thanks.

Fixes: 2b8f1f0337c5 ("thermal: imx8mm: Add i.MX8MP support")

imx8mm_tmu_enable() was introduced in this commit and the fix is about
i.MX8MP as well, so this seems even more reasonable to me.

Best regards,
Alexander



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [thermal: thermal/next] thermal/drivers/imx8mm: Enable ADC when enabling monitor
  2021-11-22 11:42 ` Alexander Stein
  (?)
  (?)
@ 2021-12-12 11:20 ` thermal-bot for Paul Gerber
  -1 siblings, 0 replies; 11+ messages in thread
From: thermal-bot for Paul Gerber @ 2021-12-12 11:20 UTC (permalink / raw)
  To: linux-pm; +Cc: Paul Gerber, Alexander Stein, Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     3de89d8842a2b5d3dd22ebf97dd561ae0a330948
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//3de89d8842a2b5d3dd22ebf97dd561ae0a330948
Author:        Paul Gerber <Paul.Gerber@tq-group.com>
AuthorDate:    Mon, 22 Nov 2021 12:42:25 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 02 Dec 2021 11:12:24 +01:00

thermal/drivers/imx8mm: Enable ADC when enabling monitor

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>
Fixes: 2b8f1f0337c5 ("thermal: imx8mm: Add i.MX8MP support")
Link: https://lore.kernel.org/r/20211122114225.196280-1-alexander.stein@ew.tq-group.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 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 7442e01..af666bd 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);
 }
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-12 11:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.