summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_mmio.c
Commit message (Collapse)AuthorAgeFilesLines
* thermal/core: Use the thermal zone 'devdata' accessor in thermal located driversDaniel Lezcano2023-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <daniel.lezcano@linaro.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> #R-Car Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #MediaTek auxadc and lvts Reviewed-by: Balsam CHIHI <bchihi@baylibre.com> #Mediatek lvts Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.com> #da9062 Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> #spread Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> #sun8i_thermal Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> #Broadcom Reviewed-by: Dhruva Gole <d-gole@ti.com> # K3 bandgap Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de> #rockchip Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> #uniphier Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* thermal/drivers/thermal_mmio: Use devm_platform_get_and_ioremap_resource()ye xingchen2023-01-181-3/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202301181641194943741@zte.com.cn Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
*-. Merge branches 'thermal-intel' and 'thermal-drivers'Rafael J. Wysocki2022-10-031-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge thermal control driver changes for 6.1-rc1: - Use module_pci_driver() macro in the int340x processor_thermal driver (Shang XiaoJing). - Use get_cpu() instead of smp_processor_id() in the intel_powerclamp thermal driver to prevent it from crashing and remove unused accounting for IRQ wakes from it (Srinivas Pandruvada). - Consolidate priv->data_vault checks in int340x_thermal (Rafael Wysocki). - Check the policy first in cpufreq_cooling_register() (Xuewen Yan). - Drop redundant error message from da9062-thermal (zhaoxiao). - Drop of_match_ptr() from thermal_mmio (Jean Delvare). * thermal-intel: thermal: int340x: processor_thermal: Use module_pci_driver() macro thermal: intel_powerclamp: Remove accounting for IRQ wakes thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash thermal: int340x_thermal: Consolidate priv->data_vault checks * thermal-drivers: thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register() thermal: da9062-thermal: Drop redundant error message thermal/drivers/thermal_mmio: Drop of_match_ptr()
| | * thermal/drivers/thermal_mmio: Drop of_match_ptr()Jean Delvare2022-08-311-1/+1
| |/ | | | | | | | | | | | | | | Now that the driver depends on OF, we know what of_match_ptr() will always resolve to, so we might as well save cpp some work. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* / thermal/drivers/mmio: Switch to new of APIDaniel Lezcano2022-08-171-9/+8
|/ | | | | | | | | | | | | | The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org> Reviewed-by: Talel Shenhar <talel@amazon.com> Link: https://lore.kernel.org/r/20220804224349.1926752-7-daniel.lezcano@linexp.org Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* thermal/drivers/thermal_mmio: Constify static struct thermal_mmio_opsRikard Falkeborn2021-10-071-1/+1
| | | | | | | | | | | | The only usage of thermal_mmio_ops is to pass its address to devm_thermal_zone_of_sensor_register(), which has a pointer to const struct thermal_zone_of_device_ops as argument. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Acked-by: Talel Shenhar <talel@amazon.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210920203849.32136-1-rikard.falkeborn@gmail.com
* thermal/drivers/thermal_mmio: Remove redundant dev_err call in ↵Ruiqi Gong2021-04-201-4/+1
| | | | | | | | | | | | | thermal_mmio_probe() There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ruiqi Gong <gongruiqi1@huawei.com> Acked-by: Talel Shenhar <talel@amazon.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210408100144.7494-1-gongruiqi1@huawei.com
* thermal: no need to set .owner when using module_platform_driverTian Tao2019-11-071-1/+0
| | | | | | | | | | the module_platform_driver will call platform_driver_register. and It will set the .owner to THIS_MODULE Signed-off-by: Tian Tao <tiantao6@huawei.com> Acked-by: Talel Shenhar <talel@amazon.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1572051875-35861-1-git-send-email-tiantao6@huawei.com
* thermal: thermal_mmio: remove some dead codeDan Carpenter2019-09-221-7/+0
| | | | | | | | | | | The platform_get_resource() function doesn't return error pointers, it returns NULL. The way this is normally done, is that we pass the NULL resource to devm_ioremap_resource() and then check for errors from that. See the comment in front of devm_ioremap_resource() for more details. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Talel Shenhar <talel@amazon.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
* thermal: Introduce Amazon's Annapurna Labs Thermal DriverTalel Shenhar2019-05-141-0/+129
This is a generic thermal driver for simple MMIO sensors, of which amazon,al-thermal is one. This device uses a single MMIO transaction to read the temperature and report it to the thermal subsystem. Signed-off-by: Talel Shenhar <talel@amazon.com> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>