xref: /linux/kernel/power/em_netlink.h (revision b2b1bbcac758798e27ad9c29a88340fcb13c8321)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  *
4  * Generic netlink for energy model.
5  *
6  * Copyright (c) 2025 Valve Corporation.
7  * Author: Changwoo Min <changwoo@igalia.com>
8  */
9 #ifndef _EM_NETLINK_H
10 #define _EM_NETLINK_H
11 
12 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_NET)
13 int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
14 			    void *data);
15 struct em_perf_domain *em_perf_domain_get_by_id(int id);
16 void em_notify_pd_deleted(const struct em_perf_domain *pd);
17 #else
18 static inline
19 int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
20 			    void *data)
21 {
22 	return -EINVAL;
23 }
24 static inline
25 struct em_perf_domain *em_perf_domain_get_by_id(int id)
26 {
27 	return NULL;
28 }
29 
30 static inline void em_notify_pd_deleted(const struct em_perf_domain *pd) {}
31 #endif
32 
33 #endif /* _EM_NETLINK_H */
34