Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Shyam Sundar S K and committed by
Ilpo Järvinen
4389d380 37336ecb

+22
+6
drivers/platform/x86/amd/pmf/acpi.c
··· 161 161 return !!(pdev->supported_func & BIT(index - 1)); 162 162 } 163 163 164 + int is_apmf_bios_input_notifications_supported(struct amd_pmf_dev *pdev) 165 + { 166 + return !!(pdev->notifications & CUSTOM_BIOS_INPUT_BITS); 167 + } 168 + 164 169 int apts_get_static_slider_granular_v2(struct amd_pmf_dev *pdev, 165 170 struct amd_pmf_apts_granular_output *data, u32 apts_idx) 166 171 { ··· 390 385 391 386 pdev->pmf_if_version = output.version; 392 387 388 + pdev->notifications = output.notification_mask; 393 389 return 0; 394 390 } 395 391
+16
drivers/platform/x86/amd/pmf/pmf.h
··· 118 118 #define PMF_IF_V2 2 119 119 120 120 #define APTS_MAX_STATES 16 121 + #define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7) 121 122 122 123 /* APTS PMF BIOS Interface */ 123 124 struct amd_pmf_apts_output { ··· 378 377 struct resource *res; 379 378 struct apmf_sbios_req_v2 req; /* To get custom bios pending request */ 380 379 struct mutex cb_mutex; 380 + u32 notifications; 381 381 }; 382 382 383 383 struct apmf_sps_prop_granular_v2 { ··· 643 641 {"NOTIFY_CUSTOM_BIOS_INPUT10", BIT(14)}, 644 642 }; 645 643 644 + static const struct amd_pmf_pb_bitmap custom_bios_inputs_v1[] __used = { 645 + {"NOTIFY_CUSTOM_BIOS_INPUT1", BIT(7)}, 646 + {"NOTIFY_CUSTOM_BIOS_INPUT2", BIT(8)}, 647 + {"NOTIFY_CUSTOM_BIOS_INPUT3", BIT(9)}, 648 + {"NOTIFY_CUSTOM_BIOS_INPUT4", BIT(10)}, 649 + {"NOTIFY_CUSTOM_BIOS_INPUT5", BIT(11)}, 650 + {"NOTIFY_CUSTOM_BIOS_INPUT6", BIT(12)}, 651 + {"NOTIFY_CUSTOM_BIOS_INPUT7", BIT(13)}, 652 + {"NOTIFY_CUSTOM_BIOS_INPUT8", BIT(14)}, 653 + {"NOTIFY_CUSTOM_BIOS_INPUT9", BIT(15)}, 654 + {"NOTIFY_CUSTOM_BIOS_INPUT10", BIT(16)}, 655 + }; 656 + 646 657 enum platform_type { 647 658 PTYPE_UNKNOWN = 0, 648 659 LID_CLOSE, ··· 807 792 int amd_pmf_set_dram_addr(struct amd_pmf_dev *dev, bool alloc_buffer); 808 793 int amd_pmf_notify_sbios_heartbeat_event_v2(struct amd_pmf_dev *dev, u8 flag); 809 794 u32 fixp_q88_fromint(u32 val); 795 + int is_apmf_bios_input_notifications_supported(struct amd_pmf_dev *pdev); 810 796 811 797 /* SPS Layer */ 812 798 int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf);