thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
Subsystems (2)
PATCH 1/1 thermal/drivers/mediatek/lvts_thermal: Remove redundant code in lvts_ctrl_configure
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.
---
drivers/thermal/mediatek/lvts_thermal.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/thermal/mediatek/lvts_thermal.c +0 -6
@@ -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 *
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Quoted 7 lines · 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 <[email protected]>
AngeloGioacchino Del Regno
maintainerIl 10/04/24 02:07, Pin-yen Lin ha scritto:
Quoted 7 lines
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 <[email protected]>
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.
Quoted 10 lines
---
drivers/thermal/mediatek/lvts_thermal.c | 6 ------ 1 file changed, 6 deletions(-)drivers/thermal/mediatek/lvts_thermal.c +0
-0
drivers/thermal/mediatek/lvts_thermal.c static int lvts_ctrl_configure(struct device *dev, struct lvts_ctrl *lvts_ctrl) · line 992
Quoted 8 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-5@@ -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
Quoted 4 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-1-/* * LVTS_MSRCTL0 : Sensor filtering strategy *
Quoted 50 lines · AngeloGioacchino Del Regno
Il 10/04/24 02:07, Pin-yen Lin ha scritto:
Quoted 10 lines
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 <[email protected]>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 the0x300value is right for this
register? I'd still like Linux to properly initialize the registers, even if
this could technically be a default value.Quoted 15 lines
---
drivers/thermal/mediatek/lvts_thermal.c| 6 ------1 file changed, 6 deletions(-)drivers/thermal/mediatek/lvts_thermal.c +0
-0@@ -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));drivers/thermal/mediatek/lvts_thermal.c static int lvts_ctrl_configure(struct device *dev, struct lvts_ctrl *lvts_ctrl) · line 992
Quoted 5 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-5-/* -* 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...
Quoted 12 lines
value = LVTS_CALSCALE_CONF; writel(value, LVTS_CALSCALE(lvts_ctrl->base);Cheers,
AngeloQuoted 4 lines
-
/*
*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
Hi Chang-Yi,
Quoted 64 lines · Chang-Yi Lin (林長億)
Quoted 50 lines · AngeloGioacchino Del Regno
Il 10/04/24 02:07, Pin-yen Lin ha scritto:
Quoted 10 lines
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 <[email protected]>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 the0x300value is right for this
register? I'd still like Linux to properly initialize the
registers, even if
this could technically be a default value.Quoted 11 lines
---
drivers/thermal/mediatek/lvts_thermal.c | 6 ------ 1 file changed, 6 deletions(-)drivers/thermal/mediatek/lvts_thermal.c +0
-0drivers/thermal/mediatek/lvts_thermal.c static int lvts_ctrl_configure(struct device · line 993
Quoted 9 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-5@@ -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...
Quoted 12 lines
value =
LVTS_CALSCALE_CONF;
writel(value,LVTS_CALSCALE(lvts_ctrl->base);Cheers,
AngeloQuoted 4 lines
drivers/thermal/mediatek/lvts_thermal.c +0
-1-/* * LVTS_MSRCTL0 : Sensor filtering strategy *
Quoted 3 lines
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
Quoted 16 lines
************* 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 believethat 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!