Permalink
Browse files

add dmi support to the driver

  • Loading branch information...
1 parent 488d2f8 commit 9253b12802ed170545965efcbb9d7efd6de02f84 @gregkh committed Aug 14, 2009
Showing with 26 additions and 0 deletions.
  1. +26 −0 samsung-backlight.c
View
@@ -16,6 +16,7 @@
#include <linux/pci.h>
#include <linux/backlight.h>
#include <linux/fb.h>
+#include <linux/dmi.h>
#define MAX_BRIGHT 0xff
#define OFFSET 0xf4
@@ -125,9 +126,33 @@ static void remove_video_card(void)
pci_device = NULL;
}
+static int dmi_check_cb(const struct dmi_system_id *id)
+{
+ printk(KERN_INFO KBUILD_MODNAME ": found laptop model '%s'\n",
+ id->ident);
+ return 0;
+}
+
+static struct dmi_system_id __initdata samsung_dmi_table[] = {
+ {
+ .ident = "N130",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "N130"),
+ DMI_MATCH(DMI_BOARD_NAME, "N130"),
+ },
+ .callback = dmi_check_cb,
+ },
+ { },
+};
+
static int __init samsung_init(void)
{
int retval;
+
+ if (!dmi_check_system(samsung_dmi_table))
+ return -ENODEV;
+
retval = pci_register_driver(&samsung_driver);
if (retval)
return retval;
@@ -149,3 +174,4 @@ MODULE_DESCRIPTION("Samsung N130 Backlight driver");
MODULE_LICENSE("GPL");
module_param(offset, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(offset, "The offset into the PCI device for the brightness control");
+MODULE_ALIAS("dmi:*:svnSAMSUNGELECTRONICSCO.,LTD.:pnN130:*:rnN130:*");

0 comments on commit 9253b12

Please sign in to comment.