Commit 586d7e4b authored by Lyndon Sanche's avatar Lyndon Sanche Committed by Ilpo Järvinen

platform/x86: dell-smbios: Add helper for checking supported class

Add helper that returns true if smbios command class is supported.
Signed-off-by: default avatarLyndon Sanche <lsanche@lyndeno.ca>
Link: https://lore.kernel.org/r/20240529174843.13226-2-lsanche@lyndeno.caReviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 46de5130
...@@ -350,6 +350,15 @@ void dell_laptop_call_notifier(unsigned long action, void *data) ...@@ -350,6 +350,15 @@ void dell_laptop_call_notifier(unsigned long action, void *data)
} }
EXPORT_SYMBOL_GPL(dell_laptop_call_notifier); 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) static void __init parse_da_table(const struct dmi_header *dm)
{ {
/* Final token is a terminator, so we don't want to copy it */ /* Final token is a terminator, so we don't want to copy it */
......
...@@ -73,6 +73,7 @@ enum dell_laptop_notifier_actions { ...@@ -73,6 +73,7 @@ enum dell_laptop_notifier_actions {
int dell_laptop_register_notifier(struct notifier_block *nb); int dell_laptop_register_notifier(struct notifier_block *nb);
int dell_laptop_unregister_notifier(struct notifier_block *nb); int dell_laptop_unregister_notifier(struct notifier_block *nb);
void dell_laptop_call_notifier(unsigned long action, void *data); void dell_laptop_call_notifier(unsigned long action, void *data);
bool dell_smbios_class_is_supported(u16 class);
/* for the supported backends */ /* for the supported backends */
#ifdef CONFIG_DELL_SMBIOS_WMI #ifdef CONFIG_DELL_SMBIOS_WMI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment