Commit 913f2010 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 4dfa5739 a6f4850d
...@@ -376,6 +376,8 @@ config MTK_THERMAL ...@@ -376,6 +376,8 @@ config MTK_THERMAL
tristate "Temperature sensor driver for mediatek SoCs" tristate "Temperature sensor driver for mediatek SoCs"
depends on ARCH_MEDIATEK || COMPILE_TEST depends on ARCH_MEDIATEK || COMPILE_TEST
depends on HAS_IOMEM depends on HAS_IOMEM
depends on NVMEM || NVMEM=n
depends on RESET_CONTROLLER
default y default y
help help
Enable this option if you want to have support for thermal management Enable this option if you want to have support for thermal management
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/thermal.h> #include <linux/thermal.h>
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/nvmem-consumer.h>
/* AUXADC Registers */ /* AUXADC Registers */
#define AUXADC_CON0_V 0x000 #define AUXADC_CON0_V 0x000
...@@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = { ...@@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = {
module_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_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>");
MODULE_DESCRIPTION("Mediatek thermal driver"); MODULE_DESCRIPTION("Mediatek thermal driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np, ...@@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np,
* otherwise, it returns a corresponding ERR_PTR(). Caller must * otherwise, it returns a corresponding ERR_PTR(). Caller must
* check the return value with help of IS_ERR() helper. * check the return value with help of IS_ERR() helper.
*/ */
static struct __thermal_zone * static struct __thermal_zone
thermal_of_build_thermal_zone(struct device_node *np) __init *thermal_of_build_thermal_zone(struct device_node *np)
{ {
struct device_node *child = NULL, *gchild; struct device_node *child = NULL, *gchild;
struct __thermal_zone *tz; struct __thermal_zone *tz;
......
...@@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors, ...@@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors,
capped_extra_power = 0; capped_extra_power = 0;
extra_power = 0; extra_power = 0;
for (i = 0; i < num_actors; i++) { 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, granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range,
total_req_power); total_req_power);
......
...@@ -688,7 +688,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, ...@@ -688,7 +688,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
{ {
struct thermal_zone_device *tz = to_thermal_zone(dev); struct thermal_zone_device *tz = to_thermal_zone(dev);
int trip, ret; int trip, ret;
unsigned long temperature; int temperature;
if (!tz->ops->set_trip_temp) if (!tz->ops->set_trip_temp)
return -EPERM; return -EPERM;
...@@ -696,7 +696,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, ...@@ -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)) if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
return -EINVAL; return -EINVAL;
if (kstrtoul(buf, 10, &temperature)) if (kstrtoint(buf, 10, &temperature))
return -EINVAL; return -EINVAL;
ret = tz->ops->set_trip_temp(tz, trip, temperature); ret = tz->ops->set_trip_temp(tz, trip, temperature);
...@@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr, ...@@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
{ {
struct thermal_zone_device *tz = to_thermal_zone(dev); struct thermal_zone_device *tz = to_thermal_zone(dev);
int ret = 0; int ret = 0;
unsigned long temperature; int temperature;
if (kstrtoul(buf, 10, &temperature)) if (kstrtoint(buf, 10, &temperature))
return -EINVAL; return -EINVAL;
if (!tz->ops->set_emul_temp) { if (!tz->ops->set_emul_temp) {
......
...@@ -352,8 +352,8 @@ struct thermal_zone_of_device_ops { ...@@ -352,8 +352,8 @@ struct thermal_zone_of_device_ops {
struct thermal_trip { struct thermal_trip {
struct device_node *np; struct device_node *np;
unsigned long int temperature; int temperature;
unsigned long int hysteresis; int hysteresis;
enum thermal_trip_type type; enum thermal_trip_type type;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment