1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  *  Copyright (C) Linaro Ltd 2020
4  *  Author: Daniel Lezcano <daniel.lezcano@linaro.org>
5  */
6 
7 struct thermal_genl_cpu_caps {
8 	int cpu;
9 	int performance;
10 	int efficiency;
11 };
12 
13 /* Netlink notification function */
14 #ifdef CONFIG_THERMAL_NETLINK
15 int __init thermal_netlink_init(void);
16 void __init thermal_netlink_exit(void);
17 int thermal_notify_tz_create(int tz_id, const char *name);
18 int thermal_notify_tz_delete(int tz_id);
19 int thermal_notify_tz_enable(int tz_id);
20 int thermal_notify_tz_disable(int tz_id);
21 int thermal_notify_tz_trip_down(int tz_id, int id, int temp);
22 int thermal_notify_tz_trip_up(int tz_id, int id, int temp);
23 int thermal_notify_tz_trip_delete(int tz_id, int id);
24 int thermal_notify_tz_trip_add(int tz_id, int id, int type,
25 			       int temp, int hyst);
26 int thermal_notify_tz_trip_change(int tz_id, int id, int type,
27 				  int temp, int hyst);
28 int thermal_notify_cdev_state_update(int cdev_id, int state);
29 int thermal_notify_cdev_add(int cdev_id, const char *name, int max_state);
30 int thermal_notify_cdev_delete(int cdev_id);
31 int thermal_notify_tz_gov_change(int tz_id, const char *name);
32 int thermal_genl_sampling_temp(int id, int temp);
33 int thermal_genl_cpu_capability_event(int count,
34 				      struct thermal_genl_cpu_caps *caps);
35 #else
thermal_netlink_init(void)36 static inline int thermal_netlink_init(void)
37 {
38 	return 0;
39 }
40 
thermal_notify_tz_create(int tz_id,const char * name)41 static inline int thermal_notify_tz_create(int tz_id, const char *name)
42 {
43 	return 0;
44 }
45 
thermal_notify_tz_delete(int tz_id)46 static inline int thermal_notify_tz_delete(int tz_id)
47 {
48 	return 0;
49 }
50 
thermal_notify_tz_enable(int tz_id)51 static inline int thermal_notify_tz_enable(int tz_id)
52 {
53 	return 0;
54 }
55 
thermal_notify_tz_disable(int tz_id)56 static inline int thermal_notify_tz_disable(int tz_id)
57 {
58 	return 0;
59 }
60 
thermal_notify_tz_trip_down(int tz_id,int id,int temp)61 static inline int thermal_notify_tz_trip_down(int tz_id, int id, int temp)
62 {
63 	return 0;
64 }
65 
thermal_notify_tz_trip_up(int tz_id,int id,int temp)66 static inline int thermal_notify_tz_trip_up(int tz_id, int id, int temp)
67 {
68 	return 0;
69 }
70 
thermal_notify_tz_trip_delete(int tz_id,int id)71 static inline int thermal_notify_tz_trip_delete(int tz_id, int id)
72 {
73 	return 0;
74 }
75 
thermal_notify_tz_trip_add(int tz_id,int id,int type,int temp,int hyst)76 static inline int thermal_notify_tz_trip_add(int tz_id, int id, int type,
77 					     int temp, int hyst)
78 {
79 	return 0;
80 }
81 
thermal_notify_tz_trip_change(int tz_id,int id,int type,int temp,int hyst)82 static inline int thermal_notify_tz_trip_change(int tz_id, int id, int type,
83 						int temp, int hyst)
84 {
85 	return 0;
86 }
87 
thermal_notify_cdev_state_update(int cdev_id,int state)88 static inline int thermal_notify_cdev_state_update(int cdev_id, int state)
89 {
90 	return 0;
91 }
92 
thermal_notify_cdev_add(int cdev_id,const char * name,int max_state)93 static inline int thermal_notify_cdev_add(int cdev_id, const char *name,
94 					  int max_state)
95 {
96 	return 0;
97 }
98 
thermal_notify_cdev_delete(int cdev_id)99 static inline int thermal_notify_cdev_delete(int cdev_id)
100 {
101 	return 0;
102 }
103 
thermal_notify_tz_gov_change(int tz_id,const char * name)104 static inline int thermal_notify_tz_gov_change(int tz_id, const char *name)
105 {
106 	return 0;
107 }
108 
thermal_genl_sampling_temp(int id,int temp)109 static inline int thermal_genl_sampling_temp(int id, int temp)
110 {
111 	return 0;
112 }
113 
thermal_genl_cpu_capability_event(int count,struct thermal_genl_cpu_caps * caps)114 static inline int thermal_genl_cpu_capability_event(int count, struct thermal_genl_cpu_caps *caps)
115 {
116 	return 0;
117 }
118 
thermal_netlink_exit(void)119 static inline void __init thermal_netlink_exit(void) {}
120 
121 #endif /* CONFIG_THERMAL_NETLINK */
122