mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
Pull thermal fixes from Eduardo Valentin: "Specifics in this pull request: - Fixes in mediatek and OF thermal drivers - Fixes in power_allocator governor - More fixes of unsigned to int type change in thermal_core.c. These change have been CI tested using KernelCI bot. \o/" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: fix Mediatek thermal controller build thermal: consistently use int for trip temp thermal: fix mtk_thermal build dependency thermal: minor mtk_thermal.c cleanups thermal: power_allocator: req_range multiplication should be a 64 bit type thermal: of: add __init attribute
This commit is contained in:
commit
913f201083
@ -376,6 +376,8 @@ config MTK_THERMAL
|
||||
tristate "Temperature sensor driver for mediatek SoCs"
|
||||
depends on ARCH_MEDIATEK || COMPILE_TEST
|
||||
depends on HAS_IOMEM
|
||||
depends on NVMEM || NVMEM=n
|
||||
depends on RESET_CONTROLLER
|
||||
default y
|
||||
help
|
||||
Enable this option if you want to have support for thermal management
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <linux/thermal.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/nvmem-consumer.h>
|
||||
|
||||
/* AUXADC Registers */
|
||||
#define AUXADC_CON0_V 0x000
|
||||
@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = {
|
||||
|
||||
module_platform_driver(mtk_thermal_driver);
|
||||
|
||||
MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de");
|
||||
MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
|
||||
MODULE_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>");
|
||||
MODULE_DESCRIPTION("Mediatek thermal driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np,
|
||||
* otherwise, it returns a corresponding ERR_PTR(). Caller must
|
||||
* check the return value with help of IS_ERR() helper.
|
||||
*/
|
||||
static struct __thermal_zone *
|
||||
thermal_of_build_thermal_zone(struct device_node *np)
|
||||
static struct __thermal_zone
|
||||
__init *thermal_of_build_thermal_zone(struct device_node *np)
|
||||
{
|
||||
struct device_node *child = NULL, *gchild;
|
||||
struct __thermal_zone *tz;
|
||||
|
@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors,
|
||||
capped_extra_power = 0;
|
||||
extra_power = 0;
|
||||
for (i = 0; i < num_actors; i++) {
|
||||
u64 req_range = req_power[i] * power_range;
|
||||
u64 req_range = (u64)req_power[i] * power_range;
|
||||
|
||||
granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range,
|
||||
total_req_power);
|
||||
|
@ -688,7 +688,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
||||
int trip, ret;
|
||||
unsigned long temperature;
|
||||
int temperature;
|
||||
|
||||
if (!tz->ops->set_trip_temp)
|
||||
return -EPERM;
|
||||
@ -696,7 +696,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
|
||||
if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
|
||||
return -EINVAL;
|
||||
|
||||
if (kstrtoul(buf, 10, &temperature))
|
||||
if (kstrtoint(buf, 10, &temperature))
|
||||
return -EINVAL;
|
||||
|
||||
ret = tz->ops->set_trip_temp(tz, trip, temperature);
|
||||
@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
||||
int ret = 0;
|
||||
unsigned long temperature;
|
||||
int temperature;
|
||||
|
||||
if (kstrtoul(buf, 10, &temperature))
|
||||
if (kstrtoint(buf, 10, &temperature))
|
||||
return -EINVAL;
|
||||
|
||||
if (!tz->ops->set_emul_temp) {
|
||||
|
@ -352,8 +352,8 @@ struct thermal_zone_of_device_ops {
|
||||
|
||||
struct thermal_trip {
|
||||
struct device_node *np;
|
||||
unsigned long int temperature;
|
||||
unsigned long int hysteresis;
|
||||
int temperature;
|
||||
int hysteresis;
|
||||
enum thermal_trip_type type;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user