* [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
@ 2024-04-10 0:07 Pin-yen Lin
2024-04-10 4:38 ` Chen-Yu Tsai
2024-04-10 9:55 ` AngeloGioacchino Del Regno
0 siblings, 2 replies; 5+ messages in thread
From: Pin-yen Lin @ 2024-04-10 0:07 UTC (permalink / raw)
To: Daniel Lezcano, Rafael J . Wysocki, Zhang Rui, Lukasz Luba,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-arm-kernel, Alexandre Mergnat, linux-kernel, linux-mediatek,
Nícolas F . R . A . Prado, Minjie Du, linux-pm,
Frank Wunderlich, Balsam CHIHI, Pin-yen Lin
The removed variable assignment is never written to the register, so it
has no effect on the device behavior. Mediatek has confirmed that it
is not required to initialize this register for current platforms, so
remove this segment to avoid confusion.
Signed-off-by: Pin-yen Lin <treapking@chromium.org>
---
drivers/thermal/mediatek/lvts_thermal.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index fd4bd650c77a..48d2f8ba3f18 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -985,12 +985,6 @@ static int lvts_ctrl_configure(struct device *dev, struct lvts_ctrl *lvts_ctrl)
value = LVTS_TSSEL_CONF;
writel(value, LVTS_TSSEL(lvts_ctrl->base));
- /*
- * LVTS_CALSCALE : ADC voltage round
- */
- value = 0x300;
- value = LVTS_CALSCALE_CONF;
-
/*
* LVTS_MSRCTL0 : Sensor filtering strategy
*
--
2.44.0.478.gd926399ef9-goog
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
2024-04-10 0:07 [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure Pin-yen Lin
@ 2024-04-10 4:38 ` Chen-Yu Tsai
2024-04-10 9:55 ` AngeloGioacchino Del Regno
1 sibling, 0 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2024-04-10 4:38 UTC (permalink / raw)
To: Pin-yen Lin
Cc: Daniel Lezcano, Rafael J . Wysocki, Zhang Rui, Lukasz Luba,
Matthias Brugger, AngeloGioacchino Del Regno, Minjie Du,
Nícolas F . R . A . Prado, Alexandre Mergnat, linux-pm,
linux-kernel, linux-mediatek, linux-arm-kernel, Balsam CHIHI
On Wed, Apr 10, 2024 at 8:07 AM Pin-yen Lin <treapking@chromium.org> wrote:
>
> The removed variable assignment is never written to the register, so it
> has no effect on the device behavior. Mediatek has confirmed that it
> is not required to initialize this register for current platforms, so
> remove this segment to avoid confusion.
>
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
2024-04-10 0:07 [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure Pin-yen Lin
2024-04-10 4:38 ` Chen-Yu Tsai
@ 2024-04-10 9:55 ` AngeloGioacchino Del Regno
2025-04-30 8:25 ` Chang-Yi Lin (林長億)
1 sibling, 1 reply; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-04-10 9:55 UTC (permalink / raw)
To: Pin-yen Lin, Daniel Lezcano, Rafael J . Wysocki, Zhang Rui,
Lukasz Luba, Matthias Brugger, Nicolas Pitre
Cc: linux-arm-kernel, Alexandre Mergnat, linux-kernel, linux-mediatek,
Nícolas F . R . A . Prado, Minjie Du, linux-pm,
Frank Wunderlich, Balsam CHIHI
Il 10/04/24 02:07, Pin-yen Lin ha scritto:
> The removed variable assignment is never written to the register, so it
> has no effect on the device behavior. Mediatek has confirmed that it
> is not required to initialize this register for current platforms, so
> remove this segment to avoid confusion.
>
> Signed-off-by: Pin-yen Lin <treapking@chromium.org>
>
Added Nicolas Pitre to the loop;
Nicolas, since you're pushing support for those, can you please check if CALSCALE
is used/useful/necessary on MT8186/88 before I give a R-b to this commit?
P.S.: Can anyone from MediaTek please confirm if the 0x300 value is right for this
register? I'd still like Linux to properly initialize the registers, even if
this could technically be a default value.
> ---
>
> drivers/thermal/mediatek/lvts_thermal.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index fd4bd650c77a..48d2f8ba3f18 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -985,12 +985,6 @@ static int lvts_ctrl_configure(struct device *dev, struct lvts_ctrl *lvts_ctrl)
> value = LVTS_TSSEL_CONF;
> writel(value, LVTS_TSSEL(lvts_ctrl->base));
>
> - /*
> - * LVTS_CALSCALE : ADC voltage round
> - */
> - value = 0x300;
> - value = LVTS_CALSCALE_CONF;
As a side note, I believe that the original author wanted to write, instead...
value = LVTS_CALSCALE_CONF;
writel(value, LVTS_CALSCALE(lvts_ctrl->base);
Cheers,
Angelo
> -
> /*
> * LVTS_MSRCTL0 : Sensor filtering strategy
> *
_______________________________________________
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] 5+ messages in thread
* Re: [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
2024-04-10 9:55 ` AngeloGioacchino Del Regno
@ 2025-04-30 8:25 ` Chang-Yi Lin (林長億)
2025-05-14 19:49 ` Pin-yen Lin
0 siblings, 1 reply; 5+ messages in thread
From: Chang-Yi Lin (林長億) @ 2025-04-30 8:25 UTC (permalink / raw)
To: treapking@chromium.org, daniel.lezcano@linaro.org,
nico@fluxnic.net, rafael@kernel.org, AngeloGioacchino Del Regno,
rui.zhang@intel.com, lukasz.luba@arm.com, matthias.bgg@gmail.com
Cc: duminjie@vivo.com, Alexandre Mergnat,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, bchihi@baylibre.com,
linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org,
Nicolas Prado
On Wed, 2024-04-10 at 11:55 +0200, AngeloGioacchino Del Regno wrote:
> Il 10/04/24 02:07, Pin-yen Lin ha scritto:
> > The removed variable assignment is never written to the register,
> > so it
> > has no effect on the device behavior. Mediatek has confirmed that
> > it
> > is not required to initialize this register for current platforms,
> > so
> > remove this segment to avoid confusion.
> >
> > Signed-off-by: Pin-yen Lin <treapking@chromium.org>
> >
>
> Added Nicolas Pitre to the loop;
>
> Nicolas, since you're pushing support for those, can you please check
> if CALSCALE
> is used/useful/necessary on MT8186/88 before I give a R-b to this
> commit?
>
> P.S.: Can anyone from MediaTek please confirm if the 0x300 value is
> right for this
> register? I'd still like Linux to properly initialize the
> registers, even if
> this could technically be a default value.
>
>
> > ---
> >
> > drivers/thermal/mediatek/lvts_thermal.c | 6 ------
> > 1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/thermal/mediatek/lvts_thermal.c
> > b/drivers/thermal/mediatek/lvts_thermal.c
> > index fd4bd650c77a..48d2f8ba3f18 100644
> > --- a/drivers/thermal/mediatek/lvts_thermal.c
> > +++ b/drivers/thermal/mediatek/lvts_thermal.c
> > @@ -985,12 +985,6 @@ static int lvts_ctrl_configure(struct device
> > *dev, struct lvts_ctrl *lvts_ctrl)
> > value = LVTS_TSSEL_CONF;
> > writel(value, LVTS_TSSEL(lvts_ctrl->base));
> >
> > - /*
> > - * LVTS_CALSCALE : ADC voltage round
> > - */
> > - value = 0x300;
> > - value = LVTS_CALSCALE_CONF;
>
> As a side note, I believe that the original author wanted to write,
> instead...
>
> value = LVTS_CALSCALE_CONF;
> writel(value, LVTS_CALSCALE(lvts_ctrl->base);
>
> Cheers,
> Angelo
>
> > -
> > /*
> > * LVTS_MSRCTL0 : Sensor filtering strategy
> > *
>
>
Base on xiaojun.zheng
The register is for PTP function, and in MT8192 it's not required
to do such setting any more
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
2025-04-30 8:25 ` Chang-Yi Lin (林長億)
@ 2025-05-14 19:49 ` Pin-yen Lin
0 siblings, 0 replies; 5+ messages in thread
From: Pin-yen Lin @ 2025-05-14 19:49 UTC (permalink / raw)
To: Chang-Yi Lin (林長億)
Cc: daniel.lezcano@linaro.org, nico@fluxnic.net, rafael@kernel.org,
AngeloGioacchino Del Regno, rui.zhang@intel.com,
lukasz.luba@arm.com, matthias.bgg@gmail.com, duminjie@vivo.com,
Alexandre Mergnat, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, bchihi@baylibre.com,
linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org,
Nicolas Prado
Hi Chang-Yi,
On Wed, Apr 30, 2025 at 4:26 AM Chang-Yi Lin (林長億)
<ds_chang-yi.lin@mediatek.com> wrote:
>
> On Wed, 2024-04-10 at 11:55 +0200, AngeloGioacchino Del Regno wrote:
> > Il 10/04/24 02:07, Pin-yen Lin ha scritto:
> > > The removed variable assignment is never written to the register,
> > > so it
> > > has no effect on the device behavior. Mediatek has confirmed that
> > > it
> > > is not required to initialize this register for current platforms,
> > > so
> > > remove this segment to avoid confusion.
> > >
> > > Signed-off-by: Pin-yen Lin <treapking@chromium.org>
> > >
> >
> > Added Nicolas Pitre to the loop;
> >
> > Nicolas, since you're pushing support for those, can you please check
> > if CALSCALE
> > is used/useful/necessary on MT8186/88 before I give a R-b to this
> > commit?
> >
> > P.S.: Can anyone from MediaTek please confirm if the 0x300 value is
> > right for this
> > register? I'd still like Linux to properly initialize the
> > registers, even if
> > this could technically be a default value.
> >
> >
> > > ---
> > >
> > > drivers/thermal/mediatek/lvts_thermal.c | 6 ------
> > > 1 file changed, 6 deletions(-)
> > >
> > > diff --git a/drivers/thermal/mediatek/lvts_thermal.c
> > > b/drivers/thermal/mediatek/lvts_thermal.c
> > > index fd4bd650c77a..48d2f8ba3f18 100644
> > > --- a/drivers/thermal/mediatek/lvts_thermal.c
> > > +++ b/drivers/thermal/mediatek/lvts_thermal.c
> > > @@ -985,12 +985,6 @@ static int lvts_ctrl_configure(struct device
> > > *dev, struct lvts_ctrl *lvts_ctrl)
> > > value = LVTS_TSSEL_CONF;
> > > writel(value, LVTS_TSSEL(lvts_ctrl->base));
> > >
> > > -/*
> > > - * LVTS_CALSCALE : ADC voltage round
> > > - */
> > > -value = 0x300;
> > > -value = LVTS_CALSCALE_CONF;
> >
> > As a side note, I believe that the original author wanted to write,
> > instead...
> >
> > value = LVTS_CALSCALE_CONF;
> > writel(value, LVTS_CALSCALE(lvts_ctrl->base);
> >
> > Cheers,
> > Angelo
> >
> > > -
> > > /*
> > > * LVTS_MSRCTL0 : Sensor filtering strategy
> > > *
> >
> >
> Base on xiaojun.zheng
> The register is for PTP function, and in MT8192 it's not required
> to do such setting any more
This driver is now also used by mt7988, mt8188, and mt8195. Could you
confirm if the PTP function are not required for all these SoCs, so we
are safe to remove this?
As a side note, Mediatek explained PTP in an offline discussion with us:
PTPOD stands for PTP (Performance Thermal Power) OD (Overdrive).
PTPOD is a technique to let the HW runs at the same frequency but with
lower operating voltage to save power.
Regards,
Pin-yen
>
>
> ************* MEDIATEK Confidentiality Notice
> ********************
> The information contained in this e-mail message (including any
> attachments) may be confidential, proprietary, privileged, or otherwise
> exempt from disclosure under applicable laws. It is intended to be
> conveyed only to the designated recipient(s). Any use, dissemination,
> distribution, printing, retaining or copying of this e-mail (including its
> attachments) by unintended recipient(s) is strictly prohibited and may
> be unlawful. If you are not an intended recipient of this e-mail, or believe
>
> that you have received this e-mail in error, please notify the sender
> immediately (by replying to this e-mail), delete any and all copies of
> this e-mail (including any attachments) from your system, and do not
> disclose the content of this e-mail to any other person. Thank you!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-14 19:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-10 0:07 [PATCH] thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure Pin-yen Lin
2024-04-10 4:38 ` Chen-Yu Tsai
2024-04-10 9:55 ` AngeloGioacchino Del Regno
2025-04-30 8:25 ` Chang-Yi Lin (林長億)
2025-05-14 19:49 ` Pin-yen Lin
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).