2 * sbs.c - ACPI Smart Battery System Driver ($Revision: 2.0 $)
4 * Copyright (c) 2007 Alexey Starikovskiy <astarikovskiy@suse.de>
5 * Copyright (c) 2005-2007 Vladimir Lebedev <vladimir.p.lebedev@intel.com>
6 * Copyright (c) 2005 Rich Townsend <rhdt@bartol.udel.edu>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or (at
13 * your option) any later version.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 #include <linux/init.h>
28 #include <linux/module.h>
29 #include <linux/moduleparam.h>
30 #include <linux/kernel.h>
31 #include <linux/proc_fs.h>
32 #include <linux/seq_file.h>
33 #include <asm/uaccess.h>
34 #include <linux/acpi.h>
35 #include <linux/timer.h>
36 #include <linux/jiffies.h>
37 #include <linux/delay.h>
41 #define ACPI_SBS_COMPONENT 0x00080000
42 #define ACPI_SBS_CLASS "sbs"
43 #define ACPI_AC_CLASS "ac_adapter"
44 #define ACPI_BATTERY_CLASS "battery"
45 #define ACPI_SBS_DEVICE_NAME "Smart Battery System"
46 #define ACPI_SBS_FILE_INFO "info"
47 #define ACPI_SBS_FILE_STATE "state"
48 #define ACPI_SBS_FILE_ALARM "alarm"
49 #define ACPI_BATTERY_DIR_NAME "BAT%i"
50 #define ACPI_AC_DIR_NAME "AC0"
52 enum acpi_sbs_device_addr {
53 ACPI_SBS_CHARGER = 0x9,
54 ACPI_SBS_MANAGER = 0xa,
55 ACPI_SBS_BATTERY = 0xb,
58 #define ACPI_SBS_NOTIFY_STATUS 0x80
59 #define ACPI_SBS_NOTIFY_INFO 0x81
61 ACPI_MODULE_NAME("sbs");
63 MODULE_AUTHOR("Alexey Starikovskiy <astarikovskiy@suse.de>");
64 MODULE_DESCRIPTION("Smart Battery System ACPI interface driver");
65 MODULE_LICENSE("GPL");
67 static unsigned int cache_time = 1000;
68 module_param(cache_time, uint, 0644);
69 MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
71 extern struct proc_dir_entry *acpi_lock_ac_dir(void);
72 extern struct proc_dir_entry *acpi_lock_battery_dir(void);
73 extern void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
74 extern void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
77 #define ACPI_SBS_BLOCK_MAX 32
79 static int acpi_sbs_add(struct acpi_device *device);
80 static int acpi_sbs_remove(struct acpi_device *device, int type);
81 static int acpi_sbs_resume(struct acpi_device *device);
83 static const struct acpi_device_id sbs_device_ids[] = {
87 MODULE_DEVICE_TABLE(acpi, sbs_device_ids);
89 static struct acpi_driver acpi_sbs_driver = {
91 .class = ACPI_SBS_CLASS,
92 .ids = sbs_device_ids,
95 .remove = acpi_sbs_remove,
96 .resume = acpi_sbs_resume,
100 struct acpi_battery {
101 struct acpi_sbs *sbs;
102 struct proc_dir_entry *proc_entry;
103 unsigned long update_time;
105 char manufacturer_name[ACPI_SBS_BLOCK_MAX];
106 char device_name[ACPI_SBS_BLOCK_MAX];
107 char device_chemistry[ACPI_SBS_BLOCK_MAX];
109 u16 full_charge_capacity;
128 struct acpi_device *device;
129 struct acpi_smb_hc *hc;
131 struct proc_dir_entry *charger_entry;
132 struct acpi_battery battery[MAX_SBS_BAT];
133 u8 batteries_supported:4;
134 u8 manager_present:1;
135 u8 charger_present:1;
138 static inline int battery_scale(int log)
146 static inline int acpi_battery_vscale(struct acpi_battery *battery)
148 return battery_scale((battery->spec & 0x0f00) >> 8);
151 static inline int acpi_battery_ipscale(struct acpi_battery *battery)
153 return battery_scale((battery->spec & 0xf000) >> 12);
156 static inline int acpi_battery_mode(struct acpi_battery *battery)
158 return (battery->mode & 0x8000);
161 static inline int acpi_battery_scale(struct acpi_battery *battery)
163 return (acpi_battery_mode(battery) ? 10 : 1) *
164 acpi_battery_ipscale(battery);
167 /* --------------------------------------------------------------------------
168 Smart Battery System Management
169 -------------------------------------------------------------------------- */
171 struct acpi_battery_reader {
172 u8 command; /* command for battery */
173 u8 mode; /* word or block? */
174 size_t offset; /* offset inside struct acpi_sbs_battery */
177 static struct acpi_battery_reader info_readers[] = {
178 {0x01, SMBUS_READ_WORD, offsetof(struct acpi_battery, alarm_capacity)},
179 {0x03, SMBUS_READ_WORD, offsetof(struct acpi_battery, mode)},
180 {0x10, SMBUS_READ_WORD, offsetof(struct acpi_battery, full_charge_capacity)},
181 {0x17, SMBUS_READ_WORD, offsetof(struct acpi_battery, cycle_count)},
182 {0x18, SMBUS_READ_WORD, offsetof(struct acpi_battery, design_capacity)},
183 {0x19, SMBUS_READ_WORD, offsetof(struct acpi_battery, design_voltage)},
184 {0x1a, SMBUS_READ_WORD, offsetof(struct acpi_battery, spec)},
185 {0x1c, SMBUS_READ_WORD, offsetof(struct acpi_battery, serial_number)},
186 {0x20, SMBUS_READ_BLOCK, offsetof(struct acpi_battery, manufacturer_name)},
187 {0x21, SMBUS_READ_BLOCK, offsetof(struct acpi_battery, device_name)},
188 {0x22, SMBUS_READ_BLOCK, offsetof(struct acpi_battery, device_chemistry)},
191 static struct acpi_battery_reader state_readers[] = {
192 {0x08, SMBUS_READ_WORD, offsetof(struct acpi_battery, temp_now)},
193 {0x09, SMBUS_READ_WORD, offsetof(struct acpi_battery, voltage_now)},
194 {0x0a, SMBUS_READ_WORD, offsetof(struct acpi_battery, current_now)},
195 {0x0b, SMBUS_READ_WORD, offsetof(struct acpi_battery, current_avg)},
196 {0x0f, SMBUS_READ_WORD, offsetof(struct acpi_battery, capacity_now)},
197 {0x0e, SMBUS_READ_WORD, offsetof(struct acpi_battery, state_of_charge)},
198 {0x16, SMBUS_READ_WORD, offsetof(struct acpi_battery, state)},
201 static int acpi_manager_get_info(struct acpi_sbs *sbs)
204 u16 battery_system_info;
206 result = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_MANAGER,
207 0x04, (u8 *) & battery_system_info);
209 sbs->batteries_supported = battery_system_info & 0x000f;
213 static int acpi_battery_get_info(struct acpi_battery *battery)
217 for (i = 0; i < ARRAY_SIZE(info_readers); ++i) {
218 result = acpi_smbus_read(battery->sbs->hc, info_readers[i].mode,
219 ACPI_SBS_BATTERY, info_readers[i].command,
220 (u8 *) battery + info_readers[i].offset);
227 static int acpi_battery_get_state(struct acpi_battery *battery)
231 if (time_before(jiffies, battery->update_time +
232 msecs_to_jiffies(cache_time)))
234 for (i = 0; i < ARRAY_SIZE(state_readers); ++i) {
235 result = acpi_smbus_read(battery->sbs->hc,
236 state_readers[i].mode,
238 state_readers[i].command,
240 state_readers[i].offset);
245 battery->update_time = jiffies;
249 static int acpi_battery_get_alarm(struct acpi_battery *battery)
251 return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
252 ACPI_SBS_BATTERY, 0x01,
253 (u8 *) & battery->alarm_capacity);
256 static int acpi_battery_set_alarm(struct acpi_battery *battery)
258 struct acpi_sbs *sbs = battery->sbs;
262 if (sbs->manager_present) {
263 acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_MANAGER,
266 value |= 1 << (battery->id + 12);
267 acpi_smbus_write(sbs->hc, SMBUS_WRITE_WORD, ACPI_SBS_MANAGER,
268 0x01, (u8 *)&value, 2);
270 value = battery->alarm_capacity / (acpi_battery_mode(battery) ? 10 : 1);
271 return acpi_smbus_write(sbs->hc, SMBUS_WRITE_WORD, ACPI_SBS_BATTERY,
272 0x01, (u8 *)&value, 2);
275 static int acpi_ac_get_present(struct acpi_sbs *sbs)
280 result = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_CHARGER,
281 0x13, (u8 *) & status);
283 sbs->charger_present = (status >> 15) & 0x1;
287 /* --------------------------------------------------------------------------
288 FS Interface (/proc/acpi)
289 -------------------------------------------------------------------------- */
291 /* Generic Routines */
294 acpi_sbs_add_fs(struct proc_dir_entry **dir,
295 struct proc_dir_entry *parent_dir,
297 struct file_operations *info_fops,
298 struct file_operations *state_fops,
299 struct file_operations *alarm_fops, void *data)
301 struct proc_dir_entry *entry = NULL;
304 *dir = proc_mkdir(dir_name, parent_dir);
306 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
307 "proc_mkdir() failed"));
310 (*dir)->owner = THIS_MODULE;
315 entry = create_proc_entry(ACPI_SBS_FILE_INFO, S_IRUGO, *dir);
317 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
318 "create_proc_entry() failed"));
320 entry->proc_fops = info_fops;
322 entry->owner = THIS_MODULE;
328 entry = create_proc_entry(ACPI_SBS_FILE_STATE, S_IRUGO, *dir);
330 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
331 "create_proc_entry() failed"));
333 entry->proc_fops = state_fops;
335 entry->owner = THIS_MODULE;
341 entry = create_proc_entry(ACPI_SBS_FILE_ALARM, S_IRUGO, *dir);
343 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
344 "create_proc_entry() failed"));
346 entry->proc_fops = alarm_fops;
348 entry->owner = THIS_MODULE;
356 acpi_sbs_remove_fs(struct proc_dir_entry **dir,
357 struct proc_dir_entry *parent_dir)
361 remove_proc_entry(ACPI_SBS_FILE_INFO, *dir);
362 remove_proc_entry(ACPI_SBS_FILE_STATE, *dir);
363 remove_proc_entry(ACPI_SBS_FILE_ALARM, *dir);
364 remove_proc_entry((*dir)->name, parent_dir);
370 /* Smart Battery Interface */
372 static struct proc_dir_entry *acpi_battery_dir = NULL;
374 static inline char *acpi_battery_units(struct acpi_battery *battery)
376 return acpi_battery_mode(battery) ? " mWh" : " mAh";
380 static int acpi_battery_read_info(struct seq_file *seq, void *offset)
382 struct acpi_battery *battery = seq->private;
383 struct acpi_sbs *sbs = battery->sbs;
386 mutex_lock(&sbs->lock);
388 seq_printf(seq, "present: %s\n",
389 (battery->present) ? "yes" : "no");
390 if (!battery->present)
393 seq_printf(seq, "design capacity: %i%s\n",
394 battery->design_capacity * acpi_battery_scale(battery),
395 acpi_battery_units(battery));
396 seq_printf(seq, "last full capacity: %i%s\n",
397 battery->full_charge_capacity * acpi_battery_scale(battery),
398 acpi_battery_units(battery));
399 seq_printf(seq, "battery technology: rechargeable\n");
400 seq_printf(seq, "design voltage: %i mV\n",
401 battery->design_voltage * acpi_battery_vscale(battery));
402 seq_printf(seq, "design capacity warning: unknown\n");
403 seq_printf(seq, "design capacity low: unknown\n");
404 seq_printf(seq, "capacity granularity 1: unknown\n");
405 seq_printf(seq, "capacity granularity 2: unknown\n");
406 seq_printf(seq, "model number: %s\n", battery->device_name);
407 seq_printf(seq, "serial number: %i\n",
408 battery->serial_number);
409 seq_printf(seq, "battery type: %s\n",
410 battery->device_chemistry);
411 seq_printf(seq, "OEM info: %s\n",
412 battery->manufacturer_name);
414 mutex_unlock(&sbs->lock);
418 static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
420 return single_open(file, acpi_battery_read_info, PDE(inode)->data);
423 static int acpi_battery_read_state(struct seq_file *seq, void *offset)
425 struct acpi_battery *battery = seq->private;
426 struct acpi_sbs *sbs = battery->sbs;
429 mutex_lock(&sbs->lock);
430 seq_printf(seq, "present: %s\n",
431 (battery->present) ? "yes" : "no");
432 if (!battery->present)
435 acpi_battery_get_state(battery);
436 seq_printf(seq, "capacity state: %s\n",
437 (battery->state & 0x0010) ? "critical" : "ok");
438 seq_printf(seq, "charging state: %s\n",
439 (battery->current_now < 0) ? "discharging" :
440 ((battery->current_now > 0) ? "charging" : "charged"));
441 seq_printf(seq, "present rate: %d mA\n",
442 abs(battery->current_now) * acpi_battery_ipscale(battery));
443 seq_printf(seq, "remaining capacity: %i%s\n",
444 battery->capacity_now * acpi_battery_scale(battery),
445 acpi_battery_units(battery));
446 seq_printf(seq, "present voltage: %i mV\n",
447 battery->voltage_now * acpi_battery_vscale(battery));
450 mutex_unlock(&sbs->lock);
454 static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
456 return single_open(file, acpi_battery_read_state, PDE(inode)->data);
459 static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
461 struct acpi_battery *battery = seq->private;
462 struct acpi_sbs *sbs = battery->sbs;
465 mutex_lock(&sbs->lock);
467 if (!battery->present) {
468 seq_printf(seq, "present: no\n");
472 acpi_battery_get_alarm(battery);
473 seq_printf(seq, "alarm: ");
474 if (battery->alarm_capacity)
475 seq_printf(seq, "%i%s\n",
476 battery->alarm_capacity *
477 acpi_battery_scale(battery),
478 acpi_battery_units(battery));
480 seq_printf(seq, "disabled\n");
482 mutex_unlock(&sbs->lock);
487 acpi_battery_write_alarm(struct file *file, const char __user * buffer,
488 size_t count, loff_t * ppos)
490 struct seq_file *seq = file->private_data;
491 struct acpi_battery *battery = seq->private;
492 struct acpi_sbs *sbs = battery->sbs;
493 char alarm_string[12] = { '\0' };
495 mutex_lock(&sbs->lock);
496 if (!battery->present) {
500 if (count > sizeof(alarm_string) - 1) {
504 if (copy_from_user(alarm_string, buffer, count)) {
508 alarm_string[count] = 0;
509 battery->alarm_capacity = simple_strtoul(alarm_string, NULL, 0);
510 acpi_battery_set_alarm(battery);
512 mutex_unlock(&sbs->lock);
518 static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
520 return single_open(file, acpi_battery_read_alarm, PDE(inode)->data);
523 static struct file_operations acpi_battery_info_fops = {
524 .open = acpi_battery_info_open_fs,
527 .release = single_release,
528 .owner = THIS_MODULE,
531 static struct file_operations acpi_battery_state_fops = {
532 .open = acpi_battery_state_open_fs,
535 .release = single_release,
536 .owner = THIS_MODULE,
539 static struct file_operations acpi_battery_alarm_fops = {
540 .open = acpi_battery_alarm_open_fs,
542 .write = acpi_battery_write_alarm,
544 .release = single_release,
545 .owner = THIS_MODULE,
548 /* Legacy AC Adapter Interface */
550 static struct proc_dir_entry *acpi_ac_dir = NULL;
552 static int acpi_ac_read_state(struct seq_file *seq, void *offset)
555 struct acpi_sbs *sbs = seq->private;
557 mutex_lock(&sbs->lock);
559 seq_printf(seq, "state: %s\n",
560 sbs->charger_present ? "on-line" : "off-line");
562 mutex_unlock(&sbs->lock);
566 static int acpi_ac_state_open_fs(struct inode *inode, struct file *file)
568 return single_open(file, acpi_ac_read_state, PDE(inode)->data);
571 static struct file_operations acpi_ac_state_fops = {
572 .open = acpi_ac_state_open_fs,
575 .release = single_release,
576 .owner = THIS_MODULE,
579 /* --------------------------------------------------------------------------
581 -------------------------------------------------------------------------- */
585 static int acpi_battery_read(struct acpi_battery *battery)
587 int result = 0, saved_present = battery->present;
590 if (battery->sbs->manager_present) {
591 result = acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
592 ACPI_SBS_MANAGER, 0x01, (u8 *)&state);
594 battery->present = state & (1 << battery->id);
596 state |= 1 << (battery->id + 12);
597 acpi_smbus_write(battery->sbs->hc, SMBUS_WRITE_WORD,
598 ACPI_SBS_MANAGER, 0x01, (u8 *)&state, 2);
599 } else if (battery->id == 0)
600 battery->present = 1;
601 if (result || !battery->present)
604 if (saved_present != battery->present) {
605 battery->update_time = 0;
606 result = acpi_battery_get_info(battery);
610 result = acpi_battery_get_state(battery);
614 static int acpi_battery_add(struct acpi_sbs *sbs, int id)
617 struct acpi_battery *battery = &sbs->battery[id];
620 battery->update_time = 0;
621 result = acpi_battery_read(battery);
625 sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id);
626 acpi_sbs_add_fs(&battery->proc_entry, acpi_battery_dir,
627 battery->name, &acpi_battery_info_fops,
628 &acpi_battery_state_fops, &acpi_battery_alarm_fops,
630 printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n",
631 ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
632 battery->name, sbs->battery->present ? "present" : "absent");
636 static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
639 if (sbs->battery[id].proc_entry) {
640 acpi_sbs_remove_fs(&(sbs->battery[id].proc_entry),
645 static int acpi_charger_add(struct acpi_sbs *sbs)
649 result = acpi_ac_get_present(sbs);
652 result = acpi_sbs_add_fs(&sbs->charger_entry, acpi_ac_dir,
653 ACPI_AC_DIR_NAME, NULL,
654 &acpi_ac_state_fops, NULL, sbs);
657 printk(KERN_INFO PREFIX "%s [%s]: AC Adapter [%s] (%s)\n",
658 ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
659 ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line");
664 static void acpi_charger_remove(struct acpi_sbs *sbs)
667 if (sbs->charger_entry)
668 acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir);
671 void acpi_sbs_callback(void *context)
674 struct acpi_sbs *sbs = context;
675 struct acpi_battery *bat;
676 u8 saved_charger_state = sbs->charger_present;
677 u8 saved_battery_state;
678 acpi_ac_get_present(sbs);
679 if (sbs->charger_present != saved_charger_state) {
680 acpi_bus_generate_proc_event4(ACPI_AC_CLASS, ACPI_AC_DIR_NAME,
681 ACPI_SBS_NOTIFY_STATUS,
682 sbs->charger_present);
684 if (sbs->manager_present) {
685 for (id = 0; id < MAX_SBS_BAT; ++id) {
686 if (!(sbs->batteries_supported & (1 << id)))
688 bat = &sbs->battery[id];
689 saved_battery_state = bat->present;
690 acpi_battery_read(bat);
691 if (saved_battery_state == bat->present)
693 acpi_bus_generate_proc_event4(ACPI_BATTERY_CLASS,
695 ACPI_SBS_NOTIFY_STATUS,
701 static int acpi_sbs_remove(struct acpi_device *device, int type);
703 static int acpi_sbs_add(struct acpi_device *device)
705 struct acpi_sbs *sbs;
709 sbs = kzalloc(sizeof(struct acpi_sbs), GFP_KERNEL);
715 mutex_init(&sbs->lock);
717 sbs->hc = acpi_driver_data(device->parent);
718 sbs->device = device;
719 strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME);
720 strcpy(acpi_device_class(device), ACPI_SBS_CLASS);
721 acpi_driver_data(device) = sbs;
723 result = acpi_charger_add(sbs);
727 result = acpi_manager_get_info(sbs);
729 sbs->manager_present = 1;
730 for (id = 0; id < MAX_SBS_BAT; ++id)
731 if ((sbs->batteries_supported & (1 << id)))
732 acpi_battery_add(sbs, id);
734 acpi_battery_add(sbs, 0);
735 acpi_smbus_register_callback(sbs->hc, acpi_sbs_callback, sbs);
738 acpi_sbs_remove(device, 0);
742 static int acpi_sbs_remove(struct acpi_device *device, int type)
744 struct acpi_sbs *sbs;
749 sbs = acpi_driver_data(device);
752 mutex_lock(&sbs->lock);
753 acpi_smbus_unregister_callback(sbs->hc);
754 for (id = 0; id < MAX_SBS_BAT; ++id)
755 acpi_battery_remove(sbs, id);
756 acpi_charger_remove(sbs);
757 mutex_unlock(&sbs->lock);
758 mutex_destroy(&sbs->lock);
763 static void acpi_sbs_rmdirs(void)
766 acpi_unlock_ac_dir(acpi_ac_dir);
769 if (acpi_battery_dir) {
770 acpi_unlock_battery_dir(acpi_battery_dir);
771 acpi_battery_dir = NULL;
775 static int acpi_sbs_resume(struct acpi_device *device)
777 struct acpi_sbs *sbs;
780 sbs = device->driver_data;
781 acpi_sbs_callback(sbs);
785 static int __init acpi_sbs_init(void)
792 acpi_ac_dir = acpi_lock_ac_dir();
794 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
795 "acpi_lock_ac_dir() failed"));
799 acpi_battery_dir = acpi_lock_battery_dir();
800 if (!acpi_battery_dir) {
801 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
802 "acpi_lock_battery_dir() failed"));
807 result = acpi_bus_register_driver(&acpi_sbs_driver);
809 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
810 "acpi_bus_register_driver() failed"));
818 static void __exit acpi_sbs_exit(void)
820 acpi_bus_unregister_driver(&acpi_sbs_driver);
827 module_init(acpi_sbs_init);
828 module_exit(acpi_sbs_exit);