platform/x86/amd/pmf: Add support for CnQF
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Thu, 22 Sep 2022 13:12:00 +0000 (18:42 +0530)
committerHans de Goede <hdegoede@redhat.com>
Thu, 22 Sep 2022 15:42:53 +0000 (17:42 +0200)
commit1738061c9ec854db2db76be8bb968f550d9bdddc
tree35cf5f55e0dd6f72aac2b0ebb971e4fe453c25d0
parent9af48b262675561eefd6edc11b4b02854e6a18ae
platform/x86/amd/pmf: Add support for CnQF

CnQF (a.k.a Cool and Quiet Framework) extends the static slider concept.
PMF dynamically manages system power limits and fan policy based on system
power trends which is representative of workload trend.

Static slider and CnQF controls are mutually exclusive for system power
budget adjustments. CnQF supports configurable number of modes which can
be unique for AC and DC. Every mode is representative of a system state
characterized by unique steady state and boost behavior.

OEMs can configure the different modes/system states and how the
transition to a mode happens. Whether to have CnQF manage system power
budget dynamically in AC or DC or both is also configurable. Mode changes
due to CnQF don't result in slider position change.

The default OEM values are obtained after evaluating the PMF ACPI function
idx 11 & 12 for AC and DC respectively. Whether to turn ON/OFF by default
is guided by a "flag" passed by the OEM BIOS.

Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20220922131202.56529-2-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd/pmf/Makefile
drivers/platform/x86/amd/pmf/acpi.c
drivers/platform/x86/amd/pmf/cnqf.c [new file with mode: 0644]
drivers/platform/x86/amd/pmf/core.c
drivers/platform/x86/amd/pmf/pmf.h