summaryrefslogtreecommitdiff
path: root/kernel/power/em_netlink.h
blob: 583d7f1c39390d8a14362c3d11a423d7e57c02d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *
 * Generic netlink for energy model.
 *
 * Copyright (c) 2025 Valve Corporation.
 * Author: Changwoo Min <changwoo@igalia.com>
 */
#ifndef _EM_NETLINK_H
#define _EM_NETLINK_H

#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_NET)
int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
			    void *data);
struct em_perf_domain *em_perf_domain_get_by_id(int id);
void em_notify_pd_created(const struct em_perf_domain *pd);
void em_notify_pd_deleted(const struct em_perf_domain *pd);
void em_notify_pd_updated(const struct em_perf_domain *pd);
#else
static inline
int for_each_em_perf_domain(int (*cb)(struct em_perf_domain*, void *),
			    void *data)
{
	return -EINVAL;
}
static inline
struct em_perf_domain *em_perf_domain_get_by_id(int id)
{
	return NULL;
}

static inline void em_notify_pd_created(const struct em_perf_domain *pd) {}

static inline void em_notify_pd_deleted(const struct em_perf_domain *pd) {}

static inline void em_notify_pd_updated(const struct em_perf_domain *pd) {}
#endif

#endif /* _EM_NETLINK_H */