diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-23 20:15:39 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-23 20:15:39 -0400 |
| commit | 913f201083c81cf021f050d041352ac854c4b526 (patch) | |
| tree | 1272c913bb574fb22c763811e6616c8dd6e33156 /drivers | |
| parent | 4dfa5739d9e135fa3731f3acfbc618e384c351d2 (diff) | |
| parent | a6f4850dbca66e46a73b8774e85aaf9fc0caf265 (diff) | |
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
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/thermal/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/thermal/mtk_thermal.c | 3 | ||||
| -rw-r--r-- | drivers/thermal/of-thermal.c | 4 | ||||
| -rw-r--r-- | drivers/thermal/power_allocator.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/thermal_core.c | 8 |
5 files changed, 10 insertions, 9 deletions
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index c37eedc35a24..3c3dc4a3d52c 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig | |||
| @@ -376,6 +376,8 @@ config MTK_THERMAL | |||
| 376 | tristate "Temperature sensor driver for mediatek SoCs" | 376 | tristate "Temperature sensor driver for mediatek SoCs" |
| 377 | depends on ARCH_MEDIATEK || COMPILE_TEST | 377 | depends on ARCH_MEDIATEK || COMPILE_TEST |
| 378 | depends on HAS_IOMEM | 378 | depends on HAS_IOMEM |
| 379 | depends on NVMEM || NVMEM=n | ||
| 380 | depends on RESET_CONTROLLER | ||
| 379 | default y | 381 | default y |
| 380 | help | 382 | help |
| 381 | Enable this option if you want to have support for thermal management | 383 | Enable this option if you want to have support for thermal management |
diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index 3d93b1c07cee..507632b9648e 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | #include <linux/thermal.h> | 27 | #include <linux/thermal.h> |
| 28 | #include <linux/reset.h> | 28 | #include <linux/reset.h> |
| 29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
| 30 | #include <linux/nvmem-consumer.h> | ||
| 31 | 30 | ||
| 32 | /* AUXADC Registers */ | 31 | /* AUXADC Registers */ |
| 33 | #define AUXADC_CON0_V 0x000 | 32 | #define AUXADC_CON0_V 0x000 |
| @@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = { | |||
| 619 | 618 | ||
| 620 | module_platform_driver(mtk_thermal_driver); | 619 | module_platform_driver(mtk_thermal_driver); |
| 621 | 620 | ||
| 622 | MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de"); | 621 | MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); |
| 623 | MODULE_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>"); | 622 | MODULE_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>"); |
| 624 | MODULE_DESCRIPTION("Mediatek thermal driver"); | 623 | MODULE_DESCRIPTION("Mediatek thermal driver"); |
| 625 | MODULE_LICENSE("GPL v2"); | 624 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 49ac23d3e776..d8ec44b194d6 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c | |||
| @@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np, | |||
| 803 | * otherwise, it returns a corresponding ERR_PTR(). Caller must | 803 | * otherwise, it returns a corresponding ERR_PTR(). Caller must |
| 804 | * check the return value with help of IS_ERR() helper. | 804 | * check the return value with help of IS_ERR() helper. |
| 805 | */ | 805 | */ |
| 806 | static struct __thermal_zone * | 806 | static struct __thermal_zone |
| 807 | thermal_of_build_thermal_zone(struct device_node *np) | 807 | __init *thermal_of_build_thermal_zone(struct device_node *np) |
| 808 | { | 808 | { |
| 809 | struct device_node *child = NULL, *gchild; | 809 | struct device_node *child = NULL, *gchild; |
| 810 | struct __thermal_zone *tz; | 810 | struct __thermal_zone *tz; |
diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index 1246aa6fcab0..2f1a863a8e15 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c | |||
| @@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors, | |||
| 301 | capped_extra_power = 0; | 301 | capped_extra_power = 0; |
| 302 | extra_power = 0; | 302 | extra_power = 0; |
| 303 | for (i = 0; i < num_actors; i++) { | 303 | for (i = 0; i < num_actors; i++) { |
| 304 | u64 req_range = req_power[i] * power_range; | 304 | u64 req_range = (u64)req_power[i] * power_range; |
| 305 | 305 | ||
| 306 | granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range, | 306 | granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range, |
| 307 | total_req_power); | 307 | total_req_power); |
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index d4b54653ecf8..f1db49625555 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c | |||
| @@ -688,7 +688,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, | |||
| 688 | { | 688 | { |
| 689 | struct thermal_zone_device *tz = to_thermal_zone(dev); | 689 | struct thermal_zone_device *tz = to_thermal_zone(dev); |
| 690 | int trip, ret; | 690 | int trip, ret; |
| 691 | unsigned long temperature; | 691 | int temperature; |
| 692 | 692 | ||
| 693 | if (!tz->ops->set_trip_temp) | 693 | if (!tz->ops->set_trip_temp) |
| 694 | return -EPERM; | 694 | return -EPERM; |
| @@ -696,7 +696,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, | |||
| 696 | if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip)) | 696 | if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip)) |
| 697 | return -EINVAL; | 697 | return -EINVAL; |
| 698 | 698 | ||
| 699 | if (kstrtoul(buf, 10, &temperature)) | 699 | if (kstrtoint(buf, 10, &temperature)) |
| 700 | return -EINVAL; | 700 | return -EINVAL; |
| 701 | 701 | ||
| 702 | ret = tz->ops->set_trip_temp(tz, trip, temperature); | 702 | ret = tz->ops->set_trip_temp(tz, trip, temperature); |
| @@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr, | |||
| 899 | { | 899 | { |
| 900 | struct thermal_zone_device *tz = to_thermal_zone(dev); | 900 | struct thermal_zone_device *tz = to_thermal_zone(dev); |
| 901 | int ret = 0; | 901 | int ret = 0; |
| 902 | unsigned long temperature; | 902 | int temperature; |
| 903 | 903 | ||
| 904 | if (kstrtoul(buf, 10, &temperature)) | 904 | if (kstrtoint(buf, 10, &temperature)) |
| 905 | return -EINVAL; | 905 | return -EINVAL; |
| 906 | 906 | ||
| 907 | if (!tz->ops->set_emul_temp) { | 907 | if (!tz->ops->set_emul_temp) { |
