platform/x86/amd/pmf: Add helper to verify BIOS input notifications are enable/disable

Implement a helper function to check if BIOS input notifications are
enabled or disabled.

Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Tested-by: Yijun Shen <Yijun.Shen@Dell.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://patch.msgid.link/20250901110140.2519072-6-Shyam-sundar.S-k@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Shyam Sundar S K
2025-09-01 16:31:36 +05:30
committed by Ilpo Järvinen
parent 37336ecb06
commit 4389d38080
2 changed files with 22 additions and 0 deletions

View File

@@ -161,6 +161,11 @@ int is_apmf_func_supported(struct amd_pmf_dev *pdev, unsigned long index)
return !!(pdev->supported_func & BIT(index - 1));
}
int is_apmf_bios_input_notifications_supported(struct amd_pmf_dev *pdev)
{
return !!(pdev->notifications & CUSTOM_BIOS_INPUT_BITS);
}
int apts_get_static_slider_granular_v2(struct amd_pmf_dev *pdev,
struct amd_pmf_apts_granular_output *data, u32 apts_idx)
{
@@ -385,6 +390,7 @@ static int apmf_if_verify_interface(struct amd_pmf_dev *pdev)
pdev->pmf_if_version = output.version;
pdev->notifications = output.notification_mask;
return 0;
}

View File

@@ -118,6 +118,7 @@ struct cookie_header {
#define PMF_IF_V2 2
#define APTS_MAX_STATES 16
#define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7)
/* APTS PMF BIOS Interface */
struct amd_pmf_apts_output {
@@ -377,6 +378,7 @@ struct amd_pmf_dev {
struct resource *res;
struct apmf_sbios_req_v2 req; /* To get custom bios pending request */
struct mutex cb_mutex;
u32 notifications;
};
struct apmf_sps_prop_granular_v2 {
@@ -641,6 +643,19 @@ static const struct amd_pmf_pb_bitmap custom_bios_inputs[] __used = {
{"NOTIFY_CUSTOM_BIOS_INPUT10", BIT(14)},
};
static const struct amd_pmf_pb_bitmap custom_bios_inputs_v1[] __used = {
{"NOTIFY_CUSTOM_BIOS_INPUT1", BIT(7)},
{"NOTIFY_CUSTOM_BIOS_INPUT2", BIT(8)},
{"NOTIFY_CUSTOM_BIOS_INPUT3", BIT(9)},
{"NOTIFY_CUSTOM_BIOS_INPUT4", BIT(10)},
{"NOTIFY_CUSTOM_BIOS_INPUT5", BIT(11)},
{"NOTIFY_CUSTOM_BIOS_INPUT6", BIT(12)},
{"NOTIFY_CUSTOM_BIOS_INPUT7", BIT(13)},
{"NOTIFY_CUSTOM_BIOS_INPUT8", BIT(14)},
{"NOTIFY_CUSTOM_BIOS_INPUT9", BIT(15)},
{"NOTIFY_CUSTOM_BIOS_INPUT10", BIT(16)},
};
enum platform_type {
PTYPE_UNKNOWN = 0,
LID_CLOSE,
@@ -792,6 +807,7 @@ int apmf_os_power_slider_update(struct amd_pmf_dev *dev, u8 flag);
int amd_pmf_set_dram_addr(struct amd_pmf_dev *dev, bool alloc_buffer);
int amd_pmf_notify_sbios_heartbeat_event_v2(struct amd_pmf_dev *dev, u8 flag);
u32 fixp_q88_fromint(u32 val);
int is_apmf_bios_input_notifications_supported(struct amd_pmf_dev *pdev);
/* SPS Layer */
int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf);