printf: Remove unused 'bprintf'
[drm/drm-misc.git] / drivers / thermal / thermal_netlink.h
blob075e9ae85f3d0884351e4c3244339a6614f79622
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) Linaro Ltd 2020
4 * Author: Daniel Lezcano <daniel.lezcano@linaro.org>
5 */
7 struct thermal_genl_cpu_caps {
8 int cpu;
9 int performance;
10 int efficiency;
13 enum thermal_genl_multicast_groups {
14 THERMAL_GENL_SAMPLING_GROUP = 0,
15 THERMAL_GENL_EVENT_GROUP = 1,
16 THERMAL_GENL_MAX_GROUP = THERMAL_GENL_EVENT_GROUP,
19 #define THERMAL_NOTIFY_BIND 0
20 #define THERMAL_NOTIFY_UNBIND 1
22 struct thermal_genl_notify {
23 int mcgrp;
26 struct thermal_zone_device;
27 struct thermal_trip;
28 struct thermal_cooling_device;
30 /* Netlink notification function */
31 #ifdef CONFIG_THERMAL_NETLINK
32 int __init thermal_netlink_init(void);
33 void __init thermal_netlink_exit(void);
34 int thermal_genl_register_notifier(struct notifier_block *nb);
35 int thermal_genl_unregister_notifier(struct notifier_block *nb);
37 int thermal_notify_tz_create(const struct thermal_zone_device *tz);
38 int thermal_notify_tz_delete(const struct thermal_zone_device *tz);
39 int thermal_notify_tz_enable(const struct thermal_zone_device *tz);
40 int thermal_notify_tz_disable(const struct thermal_zone_device *tz);
41 int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,
42 const struct thermal_trip *trip);
43 int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,
44 const struct thermal_trip *trip);
45 int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,
46 const struct thermal_trip *trip);
47 int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,
48 int state);
49 int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev);
50 int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev);
51 int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,
52 const char *name);
53 int thermal_genl_sampling_temp(int id, int temp);
54 int thermal_genl_cpu_capability_event(int count,
55 struct thermal_genl_cpu_caps *caps);
56 int thermal_notify_threshold_add(const struct thermal_zone_device *tz,
57 int temperature, int direction);
58 int thermal_notify_threshold_delete(const struct thermal_zone_device *tz,
59 int temperature, int direction);
60 int thermal_notify_threshold_flush(const struct thermal_zone_device *tz);
61 int thermal_notify_threshold_down(const struct thermal_zone_device *tz);
62 int thermal_notify_threshold_up(const struct thermal_zone_device *tz);
63 #else
64 static inline int thermal_netlink_init(void)
66 return 0;
69 static inline int thermal_notify_tz_create(const struct thermal_zone_device *tz)
71 return 0;
74 static inline int thermal_genl_register_notifier(struct notifier_block *nb)
76 return 0;
79 static inline int thermal_genl_unregister_notifier(struct notifier_block *nb)
81 return 0;
84 static inline int thermal_notify_tz_delete(const struct thermal_zone_device *tz)
86 return 0;
89 static inline int thermal_notify_tz_enable(const struct thermal_zone_device *tz)
91 return 0;
94 static inline int thermal_notify_tz_disable(const struct thermal_zone_device *tz)
96 return 0;
99 static inline int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,
100 const struct thermal_trip *trip)
102 return 0;
105 static inline int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,
106 const struct thermal_trip *trip)
108 return 0;
111 static inline int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,
112 const struct thermal_trip *trip)
114 return 0;
117 static inline int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,
118 int state)
120 return 0;
123 static inline int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev)
125 return 0;
128 static inline int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev)
130 return 0;
133 static inline int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,
134 const char *name)
136 return 0;
139 static inline int thermal_genl_sampling_temp(int id, int temp)
141 return 0;
144 static inline int thermal_genl_cpu_capability_event(int count, struct thermal_genl_cpu_caps *caps)
146 return 0;
149 static inline int thermal_notify_threshold_add(const struct thermal_zone_device *tz,
150 int temperature, int direction)
152 return 0;
155 static inline int thermal_notify_threshold_delete(const struct thermal_zone_device *tz,
156 int temperature, int direction)
158 return 0;
161 static inline int thermal_notify_threshold_flush(const struct thermal_zone_device *tz)
163 return 0;
166 static inline int thermal_notify_threshold_down(const struct thermal_zone_device *tz)
168 return 0;
171 static inline int thermal_notify_threshold_up(const struct thermal_zone_device *tz)
173 return 0;
176 static inline void __init thermal_netlink_exit(void) {}
178 #endif /* CONFIG_THERMAL_NETLINK */