Unverified Commit 4389d380 authored by Shyam Sundar S K's avatar Shyam Sundar S K Committed by Ilpo Järvinen
Browse files

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: default avatarPatil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: default avatarPatil Rajesh Reddy <Patil.Reddy@amd.com>
Tested-by: default avatarYijun Shen <Yijun.Shen@Dell.com>
Signed-off-by: default avatarShyam 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: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 37336ecb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;
}

+16 −0
Original line number Diff line number Diff line
@@ -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);