aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal/mediatek
AgeCommit message (Collapse)AuthorFilesLines
2023-03-13thermal/drivers/mediatek: Add support for MT8365 SoCFabien Parent1-0/+68
MT8365 is similar to the other SoCs supported by the driver. It has only one bank and 3 actual sensors that can be multiplexed. There is another one sensor that does not have usable data. Signed-off-by: Fabien Parent <[email protected]> Signed-off-by: Amjad Ouled-Ameur <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
2023-03-13thermal/drivers/mediatek: Control buffer enablement tweaksMarkus Schneider-Pargmann1-9/+19
Add logic in order to be able to turn on the control buffer on MT8365. This change now allows to have control buffer support for MTK_THERMAL_V1, and it allows to define the register offset, and mask used to enable it. Signed-off-by: Markus Schneider-Pargmann <[email protected]> Signed-off-by: Fabien Parent <[email protected]> Signed-off-by: Amjad Ouled-Ameur <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
2023-03-03thermal: Use thermal_zone_device_type() accessorDaniel Lezcano1-2/+4
Replace the accesses to 'tz->type' by its accessor version in order to self-encapsulate the thermal_zone_device structure. Signed-off-by: Daniel Lezcano <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> #mlxsw Reviewed-by: AngeloGioacchino Del Regno <[email protected]> #MediaTek LVTS Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-03-03thermal: Don't use 'device' internal thermal zone structure fieldDaniel Lezcano1-2/+2
Some drivers are directly using the thermal zone's 'device' structure field. Use the driver device pointer instead of the thermal zone device when it is available. Remove the traces when they are duplicate with the traces in the core code. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Reviewed-by: Balsam CHIHI <[email protected]> #Mediatek LVTS Reviewed-by: AngeloGioacchino Del Regno <[email protected]> #MediaTek LVTS Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-03-03thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()Daniel Lezcano1-1/+1
The devres variant of thermal_add_hwmon_sysfs() only takes the thermal zone structure pointer as parameter. Actually, it uses the tz->device to add it in the devres list. It is preferable to use the device registering the thermal zone instead of the thermal zone device itself. That prevents the driver accessing the thermal zone structure internals and it is from my POV more correct regarding how devm_ is used. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Martin Blumenstingl <[email protected]> #amlogic_thermal Acked-by: Jernej Skrabec <[email protected]> #sun8i_thermal Reviewed-by: AngeloGioacchino Del Regno <[email protected]> #MediaTek auxadc Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-03-03thermal/core: Use the thermal zone 'devdata' accessor in thermal located driversDaniel Lezcano2-3/+3
The thermal zone device structure is exposed to the different drivers and obviously they access the internals while that should be restricted to the core thermal code. In order to self-encapsulate the thermal core code, we need to prevent the drivers accessing directly the thermal zone structure and provide accessor functions to deal with. Use the devdata accessor introduced in the previous patch. No functional changes intended. Signed-off-by: Daniel Lezcano <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> #R-Car Acked-by: Mark Brown <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> #MediaTek auxadc and lvts Reviewed-by: Balsam CHIHI <[email protected]> #Mediatek lvts Reviewed-by: Adam Ward <[email protected]> #da9062 Reviewed-by: Baolin Wang <[email protected]> #spread Acked-by: Jernej Skrabec <[email protected]> #sun8i_thermal Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Florian Fainelli <[email protected]> #Broadcom Reviewed-by: Dhruva Gole <[email protected]> # K3 bandgap Acked-by: Linus Walleij <[email protected]> Acked-by: Heiko Stuebner <[email protected]> #rockchip Reviewed-by: Kunihiko Hayashi <[email protected]> #uniphier Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-02-15thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driverBalsam CHIHI3-0/+1241
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. The interrupt is managed at the thermal controller level, so when an interrupt occurs, the driver has to find out which sensor triggered such an interrupt. The sampling of the thermal can be filtered or immediate. For the former, the LVTS measures several points and applies a low pass filter. Signed-off-by: Balsam CHIHI <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> On MT8195 Tomato Chromebook: Tested-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-02-15thermal/drivers/mediatek: Relocate driver to mediatek folderBalsam CHIHI3-0/+1276
Add MediaTek proprietary folder to upstream more thermal zone and cooler drivers, relocate the original thermal controller driver to it, and rename it as "auxadc_thermal.c" to show its purpose more clearly. Signed-off-by: Balsam CHIHI <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>