aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-11-19 21:11:00 -0500
committerZhang Rui <rui.zhang@intel.com>2014-12-09 01:10:41 -0500
commitaf6c9f1657ca6d2ef2b2c0e31ad17c6fbf773baf (patch)
treea2a148611792c71bcee577c505b20851f07fcefd
parent9d367e5e7b05c71a8c1ac4e9b6e00ba45a79f2fc (diff)
thermal: provide an UAPI header file
include/linux/thermal.h contains definitions for the Thermal generic netlink family, but none of the valuable information relevant to user-space such as the Genl family name, multicast group, version or command set and data types is exported to user-space. Export all the relevant generic netlink information to user-space to make this genl family usable by user-space, and while at it, export THERMAL_NAME_LENGTH since it limits name length for thermal_hwmon devices. Kbuild and MAINTAINERS are also updated accordingly to reflect this new file: include/uapi/linux/thermal.h. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
-rw-r--r--MAINTAINERS1
-rw-r--r--include/linux/thermal.h31
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/thermal.h35
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/
9295S: Supported 9295S: Supported
9296F: drivers/thermal/ 9296F: drivers/thermal/
9297F: include/linux/thermal.h 9297F: include/linux/thermal.h
9298F: include/uapi/linux/thermal.h
9298F: include/linux/cpu_cooling.h 9299F: include/linux/cpu_cooling.h
9299F: Documentation/devicetree/bindings/thermal/ 9300F: 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 */
90enum events {
91 THERMAL_AUX0,
92 THERMAL_AUX1,
93 THERMAL_CRITICAL,
94 THERMAL_DEV_FAULT,
95};
96
97/* attributes of thermal_genl_family */
98enum {
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 */
106enum {
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
113struct thermal_zone_device_ops { 84struct 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
383header-y += tcp_metrics.h 383header-y += tcp_metrics.h
384header-y += telephony.h 384header-y += telephony.h
385header-y += termios.h 385header-y += termios.h
386header-y += thermal.h
386header-y += time.h 387header-y += time.h
387header-y += times.h 388header-y += times.h
388header-y += timex.h 389header-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 */
12enum events {
13 THERMAL_AUX0,
14 THERMAL_AUX1,
15 THERMAL_CRITICAL,
16 THERMAL_DEV_FAULT,
17};
18
19/* attributes of thermal_genl_family */
20enum {
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 */
28enum {
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 */