Skip to content

Commit 6a8aaca

Browse files
committed
platform/x86/amd/pmf: Add helper to verify BIOS input notifications are enable/disable
JIRA: https://issues.redhat.com/browse/RHEL-73301 commit 4389d38 Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Date: Mon Sep 1 16:31:36 2025 +0530 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> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent 20062b6 commit 6a8aaca

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

drivers/platform/x86/amd/pmf/acpi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ int is_apmf_func_supported(struct amd_pmf_dev *pdev, unsigned long index)
161161
return !!(pdev->supported_func & BIT(index - 1));
162162
}
163163

164+
int is_apmf_bios_input_notifications_supported(struct amd_pmf_dev *pdev)
165+
{
166+
return !!(pdev->notifications & CUSTOM_BIOS_INPUT_BITS);
167+
}
168+
164169
int apts_get_static_slider_granular_v2(struct amd_pmf_dev *pdev,
165170
struct amd_pmf_apts_granular_output *data, u32 apts_idx)
166171
{
@@ -385,6 +390,7 @@ static int apmf_if_verify_interface(struct amd_pmf_dev *pdev)
385390

386391
pdev->pmf_if_version = output.version;
387392

393+
pdev->notifications = output.notification_mask;
388394
return 0;
389395
}
390396

drivers/platform/x86/amd/pmf/pmf.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct cookie_header {
118118
#define PMF_IF_V2 2
119119

120120
#define APTS_MAX_STATES 16
121+
#define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7)
121122

122123
/* APTS PMF BIOS Interface */
123124
struct amd_pmf_apts_output {
@@ -377,6 +378,7 @@ struct amd_pmf_dev {
377378
struct resource *res;
378379
struct apmf_sbios_req_v2 req; /* To get custom bios pending request */
379380
struct mutex cb_mutex;
381+
u32 notifications;
380382
};
381383

382384
struct apmf_sps_prop_granular_v2 {
@@ -641,6 +643,19 @@ static const struct amd_pmf_pb_bitmap custom_bios_inputs[] __used = {
641643
{"NOTIFY_CUSTOM_BIOS_INPUT10", BIT(14)},
642644
};
643645

646+
static const struct amd_pmf_pb_bitmap custom_bios_inputs_v1[] __used = {
647+
{"NOTIFY_CUSTOM_BIOS_INPUT1", BIT(7)},
648+
{"NOTIFY_CUSTOM_BIOS_INPUT2", BIT(8)},
649+
{"NOTIFY_CUSTOM_BIOS_INPUT3", BIT(9)},
650+
{"NOTIFY_CUSTOM_BIOS_INPUT4", BIT(10)},
651+
{"NOTIFY_CUSTOM_BIOS_INPUT5", BIT(11)},
652+
{"NOTIFY_CUSTOM_BIOS_INPUT6", BIT(12)},
653+
{"NOTIFY_CUSTOM_BIOS_INPUT7", BIT(13)},
654+
{"NOTIFY_CUSTOM_BIOS_INPUT8", BIT(14)},
655+
{"NOTIFY_CUSTOM_BIOS_INPUT9", BIT(15)},
656+
{"NOTIFY_CUSTOM_BIOS_INPUT10", BIT(16)},
657+
};
658+
644659
enum platform_type {
645660
PTYPE_UNKNOWN = 0,
646661
LID_CLOSE,
@@ -792,6 +807,7 @@ int apmf_os_power_slider_update(struct amd_pmf_dev *dev, u8 flag);
792807
int amd_pmf_set_dram_addr(struct amd_pmf_dev *dev, bool alloc_buffer);
793808
int amd_pmf_notify_sbios_heartbeat_event_v2(struct amd_pmf_dev *dev, u8 flag);
794809
u32 fixp_q88_fromint(u32 val);
810+
int is_apmf_bios_input_notifications_supported(struct amd_pmf_dev *pdev);
795811

796812
/* SPS Layer */
797813
int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf);

0 commit comments

Comments
 (0)