From 12845e79f486aeb261d01e0749cbfcdc94726f4e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 14 Aug 2009 11:25:37 -0700 Subject: [PATCH] initial pci structure for driver --- samsung-backlight.c | 70 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/samsung-backlight.c b/samsung-backlight.c index 21c5209..bfc9373 100644 --- a/samsung-backlight.c +++ b/samsung-backlight.c @@ -1,20 +1,76 @@ +/* + * Samsung N130 Laptop Backlight driver + * + * Copyright (C) 2009 Greg Kroah-Hartman (gregkh@suse.de) + * Copyright (C) 2009 Novell Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + */ + #include #include #include +#include + +static struct pci_dev *device; + +static struct pci_device_id samsung_ids[] = { + { PCI_DEVICE(0x8086, 0x27ae) }, + { }, +}; +MODULE_DEVICE_TABLE(pci, samsung_ids); + +static int probe(struct pci_dev *pci_dev, const struct pci_device_id *id) +{ + return -ENODEV; +} -static int __init gotemp_init(void) +static void remove(struct pci_dev *pci_dev) { - printk(KERN_INFO "Hello from the kernel!\n"); +} + +static struct pci_driver samsung_driver = { + .name = "samsung-backlight", + .id_table = samsung_ids, + .probe = probe, + .remove = remove, +}; + + +static int find_video_card(void) +{ + return 0; } -static void __exit gotemp_exit(void) +static void remove_video_card(void) +{ + if (!device) + return; +} + +static int __init samsung_init(void) +{ + int retval; + retval = pci_register_driver(&samsung_driver); + if (retval) + return retval; + + return find_video_card(); +} + +static void __exit samsung_exit(void) { + pci_unregister_driver(&samsung_driver); + remove_video_card(); } -module_init(gotemp_init); -module_exit(gotemp_exit); +module_init(samsung_init); +module_exit(samsung_exit); -MODULE_AUTHOR("My name here"); -MODULE_DESCRIPTION("Simple driver"); +MODULE_AUTHOR("Greg Kroah-Hartman "); +MODULE_DESCRIPTION("Samsung N130 Backlight driver"); MODULE_LICENSE("GPL");