1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-12 01:20:14 +00:00
torvalds-linux/kernel/power/em_netlink.h
Changwoo Min b95a0c02ad PM: EM: Implement em_notify_pd_created/updated()
Implement two event notifications when a performance domain is created
(EM_CMD_PD_CREATED) and updated (EM_CMD_PD_UPDATED). The message format
of these two event notifications is the same as EM_CMD_GET_PD_TABLE --
containing the performance domain's ID and its energy model table.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20251020220914.320832-10-changwoo@igalia.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-10-22 21:44:38 +02:00

40 lines
1.1 KiB
C

/* 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 */