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

source code of linux/drivers/thermal/thermal_netlink.h