[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240529174843.13226-2-lsanche@lyndeno.ca>
Date: Wed, 29 May 2024 11:47:44 -0600
From: Lyndon Sanche <lsanche@...deno.ca>
To: lsanche@...deno.ca
Cc: mario.limonciello@....com,
pali@...nel.org,
W_Armin@....de,
srinivas.pandruvada@...ux.intel.com,
ilpo.jarvinen@...ux.intel.com,
lkp@...el.com,
hdegoede@...hat.com,
Yijun.Shen@...l.com,
Matthew Garrett <mjg59@...f.ucam.org>,
Randy Dunlap <rdunlap@...radead.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Vegard Nossum <vegard.nossum@...cle.com>,
AceLan Kao <acelan.kao@...onical.com>,
linux-kernel@...r.kernel.org,
platform-driver-x86@...r.kernel.org,
Dell.Client.Kernel@...l.com
Subject: [PATCH v8 1/3] platform/x86: dell-smbios: Add helper for checking supported class
Add helper that returns true if smbios command class is supported.
Signed-off-by: Lyndon Sanche <lsanche@...deno.ca>
---
drivers/platform/x86/dell/dell-smbios-base.c | 9 +++++++++
drivers/platform/x86/dell/dell-smbios.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c
index e61bfaf8b5c4..fbdd12a7cb8d 100644
--- a/drivers/platform/x86/dell/dell-smbios-base.c
+++ b/drivers/platform/x86/dell/dell-smbios-base.c
@@ -350,6 +350,15 @@ void dell_laptop_call_notifier(unsigned long action, void *data)
}
EXPORT_SYMBOL_GPL(dell_laptop_call_notifier);
+bool dell_smbios_class_is_supported(u16 class)
+{
+ /* Classes over 30 always unsupported */
+ if (class > 30)
+ return false;
+ return da_supported_commands & (1 << class);
+}
+EXPORT_SYMBOL_GPL(dell_smbios_class_is_supported);
+
static void __init parse_da_table(const struct dmi_header *dm)
{
/* Final token is a terminator, so we don't want to copy it */
diff --git a/drivers/platform/x86/dell/dell-smbios.h b/drivers/platform/x86/dell/dell-smbios.h
index eb341bf000c6..756c354b1eef 100644
--- a/drivers/platform/x86/dell/dell-smbios.h
+++ b/drivers/platform/x86/dell/dell-smbios.h
@@ -73,6 +73,7 @@ enum dell_laptop_notifier_actions {
int dell_laptop_register_notifier(struct notifier_block *nb);
int dell_laptop_unregister_notifier(struct notifier_block *nb);
void dell_laptop_call_notifier(unsigned long action, void *data);
+bool dell_smbios_class_is_supported(u16 class);
/* for the supported backends */
#ifdef CONFIG_DELL_SMBIOS_WMI
--
2.42.0
Powered by blists - more mailing lists