diff options
| -rw-r--r-- | MAINTAINERS | 1 | ||||
| -rw-r--r-- | include/linux/thermal.h | 31 | ||||
| -rw-r--r-- | include/uapi/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/uapi/linux/thermal.h | 35 |
4 files changed, 38 insertions, 30 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 0ff630de8a6d..9c709f503c03 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -9295,6 +9295,7 @@ Q: https://patchwork.kernel.org/project/linux-pm/list/ | |||
| 9295 | S: Supported | 9295 | S: Supported |
| 9296 | F: drivers/thermal/ | 9296 | F: drivers/thermal/ |
| 9297 | F: include/linux/thermal.h | 9297 | F: include/linux/thermal.h |
| 9298 | F: include/uapi/linux/thermal.h | ||
| 9298 | F: include/linux/cpu_cooling.h | 9299 | F: include/linux/cpu_cooling.h |
| 9299 | F: Documentation/devicetree/bindings/thermal/ | 9300 | F: Documentation/devicetree/bindings/thermal/ |
| 9300 | 9301 | ||
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index ef90838b36a0..70f87406bed9 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -29,10 +29,10 @@ | |||
| 29 | #include <linux/idr.h> | 29 | #include <linux/idr.h> |
| 30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 31 | #include <linux/workqueue.h> | 31 | #include <linux/workqueue.h> |
| 32 | #include <uapi/linux/thermal.h> | ||
| 32 | 33 | ||
| 33 | #define THERMAL_TRIPS_NONE -1 | 34 | #define THERMAL_TRIPS_NONE -1 |
| 34 | #define THERMAL_MAX_TRIPS 12 | 35 | #define THERMAL_MAX_TRIPS 12 |
| 35 | #define THERMAL_NAME_LENGTH 20 | ||
| 36 | 36 | ||
| 37 | /* invalid cooling state */ | 37 | /* invalid cooling state */ |
| 38 | #define THERMAL_CSTATE_INVALID -1UL | 38 | #define THERMAL_CSTATE_INVALID -1UL |
| @@ -49,11 +49,6 @@ | |||
| 49 | #define MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, off) (((t) / 100) + (off)) | 49 | #define MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, off) (((t) / 100) + (off)) |
| 50 | #define MILLICELSIUS_TO_DECI_KELVIN(t) MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, 2732) | 50 | #define MILLICELSIUS_TO_DECI_KELVIN(t) MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, 2732) |
| 51 | 51 | ||
| 52 | /* Adding event notification support elements */ | ||
| 53 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
| 54 | #define THERMAL_GENL_VERSION 0x01 | ||
| 55 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_grp" | ||
| 56 | |||
| 57 | /* Default Thermal Governor */ | 52 | /* Default Thermal Governor */ |
| 58 | #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) | 53 | #if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE) |
| 59 | #define DEFAULT_THERMAL_GOVERNOR "step_wise" | 54 | #define DEFAULT_THERMAL_GOVERNOR "step_wise" |
| @@ -86,30 +81,6 @@ enum thermal_trend { | |||
| 86 | THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */ | 81 | THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */ |
| 87 | }; | 82 | }; |
| 88 | 83 | ||
| 89 | /* Events supported by Thermal Netlink */ | ||
| 90 | enum events { | ||
| 91 | THERMAL_AUX0, | ||
| 92 | THERMAL_AUX1, | ||
| 93 | THERMAL_CRITICAL, | ||
| 94 | THERMAL_DEV_FAULT, | ||
| 95 | }; | ||
| 96 | |||
| 97 | /* attributes of thermal_genl_family */ | ||
| 98 | enum { | ||
| 99 | THERMAL_GENL_ATTR_UNSPEC, | ||
| 100 | THERMAL_GENL_ATTR_EVENT, | ||
| 101 | __THERMAL_GENL_ATTR_MAX, | ||
| 102 | }; | ||
| 103 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
| 104 | |||
| 105 | /* commands supported by the thermal_genl_family */ | ||
| 106 | enum { | ||
| 107 | THERMAL_GENL_CMD_UNSPEC, | ||
| 108 | THERMAL_GENL_CMD_EVENT, | ||
| 109 | __THERMAL_GENL_CMD_MAX, | ||
| 110 | }; | ||
| 111 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
| 112 | |||
| 113 | struct thermal_zone_device_ops { | 84 | struct thermal_zone_device_ops { |
| 114 | int (*bind) (struct thermal_zone_device *, | 85 | int (*bind) (struct thermal_zone_device *, |
| 115 | struct thermal_cooling_device *); | 86 | struct thermal_cooling_device *); |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 4c94f31a8c99..a1943e2d1264 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
| @@ -383,6 +383,7 @@ header-y += tcp.h | |||
| 383 | header-y += tcp_metrics.h | 383 | header-y += tcp_metrics.h |
| 384 | header-y += telephony.h | 384 | header-y += telephony.h |
| 385 | header-y += termios.h | 385 | header-y += termios.h |
| 386 | header-y += thermal.h | ||
| 386 | header-y += time.h | 387 | header-y += time.h |
| 387 | header-y += times.h | 388 | header-y += times.h |
| 388 | header-y += timex.h | 389 | header-y += timex.h |
diff --git a/include/uapi/linux/thermal.h b/include/uapi/linux/thermal.h new file mode 100644 index 000000000000..ac5535855982 --- /dev/null +++ b/include/uapi/linux/thermal.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | #ifndef _UAPI_LINUX_THERMAL_H | ||
| 2 | #define _UAPI_LINUX_THERMAL_H | ||
| 3 | |||
| 4 | #define THERMAL_NAME_LENGTH 20 | ||
| 5 | |||
| 6 | /* Adding event notification support elements */ | ||
| 7 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
| 8 | #define THERMAL_GENL_VERSION 0x01 | ||
| 9 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_grp" | ||
| 10 | |||
| 11 | /* Events supported by Thermal Netlink */ | ||
| 12 | enum events { | ||
| 13 | THERMAL_AUX0, | ||
| 14 | THERMAL_AUX1, | ||
| 15 | THERMAL_CRITICAL, | ||
| 16 | THERMAL_DEV_FAULT, | ||
| 17 | }; | ||
| 18 | |||
| 19 | /* attributes of thermal_genl_family */ | ||
| 20 | enum { | ||
| 21 | THERMAL_GENL_ATTR_UNSPEC, | ||
| 22 | THERMAL_GENL_ATTR_EVENT, | ||
| 23 | __THERMAL_GENL_ATTR_MAX, | ||
| 24 | }; | ||
| 25 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
| 26 | |||
| 27 | /* commands supported by the thermal_genl_family */ | ||
| 28 | enum { | ||
| 29 | THERMAL_GENL_CMD_UNSPEC, | ||
| 30 | THERMAL_GENL_CMD_EVENT, | ||
| 31 | __THERMAL_GENL_CMD_MAX, | ||
| 32 | }; | ||
| 33 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
| 34 | |||
| 35 | #endif /* _UAPI_LINUX_THERMAL_H */ | ||
