[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37680c5e-e61c-410b-b48d-829914200e4a@notapiano>
Date: Fri, 28 Apr 2023 16:10:38 -0400
From: Nícolas F. R. A. Prado
<nfraprado@...labora.com>
To: bchihi@...libre.com
Cc: daniel.lezcano@...aro.org, angelogioacchino.delregno@...labora.com,
rafael@...nel.org, amitk@...nel.org, rui.zhang@...el.com,
matthias.bgg@...il.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, rdunlap@...radead.org,
ye.xingchen@....com.cn, p.zabel@...gutronix.de,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, devicetree@...r.kernel.org,
wenst@...omium.org, james.lo@...iatek.com,
rex-bc.chen@...iatek.com, abailon@...libre.com,
amergnat@...libre.com, khilman@...libre.com
Subject: Re: [PATCH v2 3/5] thermal/drivers/mediatek/lvts_thermal: Add mt8192
support
On Tue, Apr 25, 2023 at 03:30:50PM +0200, bchihi@...libre.com wrote:
> From: Balsam CHIHI <bchihi@...libre.com>
>
> Add LVTS Driver support for MT8192.
>
> Signed-off-by: Balsam CHIHI <bchihi@...libre.com>
> Co-developed-by : Nícolas F. R. A. Prado <nfraprado@...labora.com>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@...labora.com>
> ---
> drivers/thermal/mediatek/lvts_thermal.c | 92 +++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
>
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index 5ea8a9d569ea6..8df7b4c72a658 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
[..]
> +static const struct lvts_ctrl_data mt8192_lvts_mcu_data_ctrl[] = {
> + {
> + .cal_offset = { 0x04, 0x08 },
> + .lvts_sensor = {
> + { .dt_id = MT8192_MCU_BIG_CPU0 },
> + { .dt_id = MT8192_MCU_BIG_CPU1 }
> + },
> + .num_lvts_sensor = 2,
> + .offset = 0x0,
> + .hw_tshut_temp = LVTS_HW_SHUTDOWN_MT8192,
Hi Balsam,
during the investigation I did to fix the interrupt issues I mentioned in v1, I
noticed that the threshold interrupts (hot, hot to normal, cold), only trigger
when the controller is configured to filtered mode. In immediate mode the
threshold interrupts are not triggered.
So I say we add
.mode = LVTS_MSR_FILTERED_MODE,
for all the controllers here. Same for MT8195, although I guess that'd be better
done in a separate series. And I haven't had time to test more on MT8195 to see
if I can get any interrupts there.
One issue with filtered mode is that the data read is often not ready (valid bit
unset), so most of the time it returns -EAGAIN. But I think that should be easy
to address by reading with a timeout (equal to the measurement interval we
already know), instead of a single time, if on filtered mode.
I'll also try to review the other commits in this series, though that'll have to
wait for next week.
Thanks,
Nícolas
Powered by blists - more mailing lists