PM: EM: Add em_dev_compute_costs()
authorLukasz Luba <lukasz.luba@arm.com>
Thu, 8 Feb 2024 11:55:56 +0000 (11:55 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Feb 2024 14:00:32 +0000 (15:00 +0100)
commit22ea02848c07d1cbd15a5f442138ca429866300d
treef7a2c3300fa47801d15b3b86ba60244b2bb3dfce
parent24e9fb635df2790eccb0e95ff65c6dee7a97fcb7
PM: EM: Add em_dev_compute_costs()

The device drivers can modify EM at runtime by providing a new EM table.
The EM is used by the EAS and the em_perf_state::cost stores
pre-calculated value to avoid overhead. This patch provides the API for
device drivers to calculate the cost values properly (and not duplicate
the same code).

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/energy_model.h
kernel/power/energy_model.c