]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86: dell-smbios: Add helper for checking supported class
authorLyndon Sanche <lsanche@lyndeno.ca>
Wed, 29 May 2024 17:47:44 +0000 (11:47 -0600)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 30 May 2024 08:25:55 +0000 (11:25 +0300)
Add helper that returns true if smbios command class is supported.

Signed-off-by: Lyndon Sanche <lsanche@lyndeno.ca>
Link: https://lore.kernel.org/r/20240529174843.13226-2-lsanche@lyndeno.ca
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/dell/dell-smbios-base.c
drivers/platform/x86/dell/dell-smbios.h

index e61bfaf8b5c48faf8fdf2df15cf0faa140b5869e..fbdd12a7cb8de3827e96b948c2c56217979d2423 100644 (file)
@@ -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 */
index eb341bf000c675e8cf2d3860a4d35c6bf7d49cd4..756c354b1eef4485e135f78f83f5f78162c316b0 100644 (file)
@@ -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