1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) Linaro Ltd 2020
7 struct thermal_genl_cpu_caps {
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 {
26 struct thermal_zone_device;
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,
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,
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);
57 static inline int thermal_netlink_init(void)
62 static inline int thermal_notify_tz_create(const struct thermal_zone_device *tz)
67 static inline int thermal_genl_register_notifier(struct notifier_block *nb)
72 static inline int thermal_genl_unregister_notifier(struct notifier_block *nb)
77 static inline int thermal_notify_tz_delete(const struct thermal_zone_device *tz)
82 static inline int thermal_notify_tz_enable(const struct thermal_zone_device *tz)
87 static inline int thermal_notify_tz_disable(const struct thermal_zone_device *tz)
92 static inline int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,
93 const struct thermal_trip *trip)
98 static inline int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,
99 const struct thermal_trip *trip)
104 static inline int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,
105 const struct thermal_trip *trip)
110 static inline int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,
116 static inline int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev)
121 static inline int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev)
126 static inline int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,
132 static inline int thermal_genl_sampling_temp(int id, int temp)
137 static inline int thermal_genl_cpu_capability_event(int count, struct thermal_genl_cpu_caps *caps)
142 static inline void __init thermal_netlink_exit(void) {}
144 #endif /* CONFIG_THERMAL_NETLINK */