[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea30d169-2ae6-2744-fbfd-01bbbba36554@linaro.org>
Date: Mon, 6 Feb 2023 15:38:15 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: bchihi@...libre.com, 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,
khilman@...libre.com, james.lo@...iatek.com,
rex-bc.chen@...iatek.com
Subject: Re: [PATCH v12] thermal: drivers: mediatek: Add the Low Voltage
Thermal Sensor driver
On 06/02/2023 15:30, Krzysztof Kozlowski wrote:
> On 06/02/2023 15:07, Daniel Lezcano wrote:
>> On Wed, Feb 01, 2023 at 08:55:07AM +0100, Krzysztof Kozlowski wrote:
>>> On 31/01/2023 16:38, bchihi@...libre.com wrote:
>>>> From: Balsam CHIHI <bchihi@...libre.com>
>>>>
>>>> The Low Voltage Thermal Sensor (LVTS) is a multiple sensors, multi
>>>> controllers contained in a thermal domain.
>>>>
>>>> A thermal domains can be the MCU or the AP.
>>>>
>>>> Each thermal domains contain up to seven controllers, each thermal
>>>> controller handle up to four thermal sensors.
>>>>
>>>> The LVTS has two Finite State Machines (FSM), one to handle the
>>>> functionin temperatures range like hot or cold temperature and another
>>>> one to handle monitoring trip point. The FSM notifies via interrupts
>>>> when a trip point is crossed.
>>>>
>>>
>>> (...)
>>>
>>>> +
>>>> +struct lvts_domain {
>>>> + struct lvts_ctrl *lvts_ctrl;
>>>> + struct reset_control *reset;
>>>> + struct clk *clk;
>>>> + int num_lvts_ctrl;
>>>> + void __iomem *base;
>>>> + size_t calib_len;
>>>> + u8 *calib;
>>>> +};
>>>> +
>>>> +#ifdef CONFIG_MTK_LVTS_THERMAL_DEBUGFS
>>>> +
>>>> +static struct dentry *root;
>>>
>>> How do you handle two instances of driver?
>>
>> For now, we can put the entry in /sys/kernel/debug/<dev_name>
>>
>> I'm preparing a debugfs series for the thermal framework and that will provide
>> an entry to hook in for the sensors debugfs if available
>
> The code looked like it does not support it at all. I think it would
> remove entries from second instance, while unbinding the first (or the
> opposite).
Yes, and you are right.
So instead of having:
/sys/kernel/debugfs/lvts/lvts@mcu
We will have:
/sys/kernel/debugfs/lvts@mcu
Later, when the other domain is added, we will have:
/sys/kernel/debugfs/lvts@mcu
/sys/kernel/debugfs/lvts@ap
Each instance takes care of removing its own entry
When I'll introduce thermal debugfs, I'll take care of massaging the
driver to have them like:
/sys/kernel/debugfs/thermal/thermal_zone/0/sensors/lvts@mcu,0
/sys/kernel/debugfs/thermal/thermal_zone/1/sensors/lvts@ap,1
--
<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
Powered by blists - more mailing lists