2 * ec.c - ACPI Embedded Controller Driver (v2.0)
4 * Copyright (C) 2006, 2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
5 * Copyright (C) 2006 Denis Sadykov <denis.m.sadykov@intel.com>
6 * Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
7 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
8 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or (at
15 * your option) any later version.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 #include <linux/kernel.h>
30 #include <linux/module.h>
31 #include <linux/init.h>
32 #include <linux/types.h>
33 #include <linux/delay.h>
34 #include <linux/proc_fs.h>
35 #include <linux/seq_file.h>
36 #include <linux/interrupt.h>
37 #include <linux/list.h>
39 #include <acpi/acpi_bus.h>
40 #include <acpi/acpi_drivers.h>
41 #include <acpi/actypes.h>
43 #define ACPI_EC_CLASS "embedded_controller"
44 #define ACPI_EC_DEVICE_NAME "Embedded Controller"
45 #define ACPI_EC_FILE_INFO "info"
48 #define PREFIX "ACPI: EC: "
50 /* EC status register */
51 #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
52 #define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */
53 #define ACPI_EC_FLAG_BURST 0x10 /* burst mode */
54 #define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */
58 ACPI_EC_COMMAND_READ = 0x80,
59 ACPI_EC_COMMAND_WRITE = 0x81,
60 ACPI_EC_BURST_ENABLE = 0x82,
61 ACPI_EC_BURST_DISABLE = 0x83,
62 ACPI_EC_COMMAND_QUERY = 0x84,
67 ACPI_EC_EVENT_OBF_1 = 1, /* Output buffer full */
68 ACPI_EC_EVENT_IBF_0, /* Input buffer empty */
71 #define ACPI_EC_DELAY 500 /* Wait 500ms max. during EC ops */
72 #define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */
75 EC_INTR = 1, /* Output buffer full */
76 EC_POLL, /* Input buffer empty */
77 } acpi_ec_mode = EC_INTR;
80 EC_FLAGS_WAIT_GPE = 0, /* Don't check status until GPE arrives */
81 EC_FLAGS_QUERY_PENDING, /* Query is pending */
84 static int acpi_ec_remove(struct acpi_device *device, int type);
85 static int acpi_ec_start(struct acpi_device *device);
86 static int acpi_ec_stop(struct acpi_device *device, int type);
87 static int acpi_ec_add(struct acpi_device *device);
89 static const struct acpi_device_id ec_device_ids[] = {
94 static struct acpi_driver acpi_ec_driver = {
96 .class = ACPI_EC_CLASS,
100 .remove = acpi_ec_remove,
101 .start = acpi_ec_start,
102 .stop = acpi_ec_stop,
106 /* If we find an EC via the ECDT, we need to keep a ptr to its context */
107 /* External interfaces use first EC only, so remember */
108 typedef int (*acpi_ec_query_func) (void *data);
110 struct acpi_ec_query_handler {
111 struct list_head node;
112 acpi_ec_query_func func;
118 static struct acpi_ec {
121 unsigned long command_addr;
122 unsigned long data_addr;
123 unsigned long global_lock;
126 wait_queue_head_t wait;
127 struct list_head list;
128 u8 handlers_installed;
129 } *boot_ec, *first_ec;
131 /* --------------------------------------------------------------------------
132 Transaction Management
133 -------------------------------------------------------------------------- */
135 static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
137 return inb(ec->command_addr);
140 static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
142 return inb(ec->data_addr);
145 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
147 outb(command, ec->command_addr);
150 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
152 outb(data, ec->data_addr);
155 static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event)
157 if (test_bit(EC_FLAGS_WAIT_GPE, &ec->flags))
159 if (event == ACPI_EC_EVENT_OBF_1) {
160 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_OBF)
162 } else if (event == ACPI_EC_EVENT_IBF_0) {
163 if (!(acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF))
170 static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
172 if (unlikely(force_poll) || acpi_ec_mode == EC_POLL) {
173 unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
174 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
175 while (time_before(jiffies, delay)) {
176 if (acpi_ec_check_status(ec, event))
180 if (wait_event_timeout(ec->wait, acpi_ec_check_status(ec, event),
181 msecs_to_jiffies(ACPI_EC_DELAY)))
183 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
184 if (acpi_ec_check_status(ec, event)) {
188 printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
189 " status = %d, expect_event = %d\n",
190 acpi_ec_read_status(ec), event);
194 static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
195 const u8 * wdata, unsigned wdata_len,
196 u8 * rdata, unsigned rdata_len,
200 set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
201 acpi_ec_write_cmd(ec, command);
203 for (; wdata_len > 0; --wdata_len) {
204 result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
206 printk(KERN_ERR PREFIX
207 "write_cmd timeout, command = %d\n", command);
210 set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
211 acpi_ec_write_data(ec, *(wdata++));
215 result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
217 printk(KERN_ERR PREFIX
218 "finish-write timeout, command = %d\n", command);
221 } else if (command == ACPI_EC_COMMAND_QUERY)
222 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
224 for (; rdata_len > 0; --rdata_len) {
225 result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll);
227 printk(KERN_ERR PREFIX "read timeout, command = %d\n",
231 set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
232 *(rdata++) = acpi_ec_read_data(ec);
238 static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
239 const u8 * wdata, unsigned wdata_len,
240 u8 * rdata, unsigned rdata_len,
246 if (!ec || (wdata_len && !wdata) || (rdata_len && !rdata))
250 memset(rdata, 0, rdata_len);
252 mutex_lock(&ec->lock);
253 if (ec->global_lock) {
254 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
255 if (ACPI_FAILURE(status)) {
256 mutex_unlock(&ec->lock);
261 /* Make sure GPE is enabled before doing transaction */
262 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
264 status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0);
266 printk(KERN_ERR PREFIX
267 "input buffer is not empty, aborting transaction\n");
271 status = acpi_ec_transaction_unlocked(ec, command,
279 acpi_release_global_lock(glk);
280 mutex_unlock(&ec->lock);
286 * Note: samsung nv5000 doesn't work with ec burst mode.
287 * http://bugzilla.kernel.org/show_bug.cgi?id=4980
289 int acpi_ec_burst_enable(struct acpi_ec *ec)
292 return acpi_ec_transaction(ec, ACPI_EC_BURST_ENABLE, NULL, 0, &d, 1, 0);
295 int acpi_ec_burst_disable(struct acpi_ec *ec)
297 return acpi_ec_transaction(ec, ACPI_EC_BURST_DISABLE, NULL, 0, NULL, 0, 0);
300 static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 * data)
305 result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_READ,
306 &address, 1, &d, 1, 0);
311 static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
313 u8 wdata[2] = { address, data };
314 return acpi_ec_transaction(ec, ACPI_EC_COMMAND_WRITE,
315 wdata, 2, NULL, 0, 0);
319 * Externally callable EC access functions. For now, assume 1 EC only
321 int ec_burst_enable(void)
325 return acpi_ec_burst_enable(first_ec);
328 EXPORT_SYMBOL(ec_burst_enable);
330 int ec_burst_disable(void)
334 return acpi_ec_burst_disable(first_ec);
337 EXPORT_SYMBOL(ec_burst_disable);
339 int ec_read(u8 addr, u8 * val)
347 err = acpi_ec_read(first_ec, addr, &temp_data);
356 EXPORT_SYMBOL(ec_read);
358 int ec_write(u8 addr, u8 val)
365 err = acpi_ec_write(first_ec, addr, val);
370 EXPORT_SYMBOL(ec_write);
372 int ec_transaction(u8 command,
373 const u8 * wdata, unsigned wdata_len,
374 u8 * rdata, unsigned rdata_len,
380 return acpi_ec_transaction(first_ec, command, wdata,
381 wdata_len, rdata, rdata_len,
385 EXPORT_SYMBOL(ec_transaction);
387 static int acpi_ec_query(struct acpi_ec *ec, u8 * data)
396 * Query the EC to find out which _Qxx method we need to evaluate.
397 * Note that successful completion of the query causes the ACPI_EC_SCI
398 * bit to be cleared (and thus clearing the interrupt source).
401 result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_QUERY, NULL, 0, &d, 1, 0);
412 /* --------------------------------------------------------------------------
414 -------------------------------------------------------------------------- */
415 int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
416 acpi_handle handle, acpi_ec_query_func func,
419 struct acpi_ec_query_handler *handler =
420 kzalloc(sizeof(struct acpi_ec_query_handler), GFP_KERNEL);
424 handler->query_bit = query_bit;
425 handler->handle = handle;
426 handler->func = func;
427 handler->data = data;
428 mutex_lock(&ec->lock);
429 list_add(&handler->node, &ec->list);
430 mutex_unlock(&ec->lock);
434 EXPORT_SYMBOL_GPL(acpi_ec_add_query_handler);
436 void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
438 struct acpi_ec_query_handler *handler;
439 mutex_lock(&ec->lock);
440 list_for_each_entry(handler, &ec->list, node) {
441 if (query_bit == handler->query_bit) {
442 list_del(&handler->node);
446 mutex_unlock(&ec->lock);
449 EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);
451 static void acpi_ec_gpe_query(void *ec_cxt)
453 struct acpi_ec *ec = ec_cxt;
455 struct acpi_ec_query_handler *handler, copy;
457 if (!ec || acpi_ec_query(ec, &value))
459 mutex_lock(&ec->lock);
460 list_for_each_entry(handler, &ec->list, node) {
461 if (value == handler->query_bit) {
462 /* have custom handler for this bit */
463 memcpy(©, handler, sizeof(copy));
464 mutex_unlock(&ec->lock);
466 copy.func(copy.data);
467 } else if (copy.handle) {
468 acpi_evaluate_object(copy.handle, NULL, NULL, NULL);
473 mutex_unlock(&ec->lock);
476 static u32 acpi_ec_gpe_handler(void *data)
478 acpi_status status = AE_OK;
479 struct acpi_ec *ec = data;
481 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
483 if (acpi_ec_mode == EC_INTR) {
487 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI) {
488 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
489 status = acpi_os_execute(OSL_EC_BURST_HANDLER,
490 acpi_ec_gpe_query, ec);
493 return status == AE_OK ?
494 ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
497 /* --------------------------------------------------------------------------
498 Address Space Management
499 -------------------------------------------------------------------------- */
502 acpi_ec_space_setup(acpi_handle region_handle,
503 u32 function, void *handler_context, void **return_context)
506 * The EC object is in the handler context and is needed
507 * when calling the acpi_ec_space_handler.
509 *return_context = (function != ACPI_REGION_DEACTIVATE) ?
510 handler_context : NULL;
516 acpi_ec_space_handler(u32 function, acpi_physical_address address,
517 u32 bits, acpi_integer *value,
518 void *handler_context, void *region_context)
520 struct acpi_ec *ec = handler_context;
521 int result = 0, i = 0;
524 if ((address > 0xFF) || !value || !handler_context)
525 return AE_BAD_PARAMETER;
527 if (function != ACPI_READ && function != ACPI_WRITE)
528 return AE_BAD_PARAMETER;
530 if (bits != 8 && acpi_strict)
531 return AE_BAD_PARAMETER;
533 while (bits - i > 0) {
534 if (function == ACPI_READ) {
535 result = acpi_ec_read(ec, address, &temp);
536 (*value) |= ((acpi_integer)temp) << i;
538 temp = 0xff & ((*value) >> i);
539 result = acpi_ec_write(ec, address, temp);
547 return AE_BAD_PARAMETER;
560 /* --------------------------------------------------------------------------
562 -------------------------------------------------------------------------- */
564 static struct proc_dir_entry *acpi_ec_dir;
566 static int acpi_ec_read_info(struct seq_file *seq, void *offset)
568 struct acpi_ec *ec = seq->private;
573 seq_printf(seq, "gpe:\t\t\t0x%02x\n", (u32) ec->gpe);
574 seq_printf(seq, "ports:\t\t\t0x%02x, 0x%02x\n",
575 (unsigned)ec->command_addr, (unsigned)ec->data_addr);
576 seq_printf(seq, "use global lock:\t%s\n",
577 ec->global_lock ? "yes" : "no");
582 static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
584 return single_open(file, acpi_ec_read_info, PDE(inode)->data);
587 static struct file_operations acpi_ec_info_ops = {
588 .open = acpi_ec_info_open_fs,
591 .release = single_release,
592 .owner = THIS_MODULE,
595 static int acpi_ec_add_fs(struct acpi_device *device)
597 struct proc_dir_entry *entry = NULL;
599 if (!acpi_device_dir(device)) {
600 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
602 if (!acpi_device_dir(device))
606 entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
607 acpi_device_dir(device));
611 entry->proc_fops = &acpi_ec_info_ops;
612 entry->data = acpi_driver_data(device);
613 entry->owner = THIS_MODULE;
619 static int acpi_ec_remove_fs(struct acpi_device *device)
622 if (acpi_device_dir(device)) {
623 remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
624 remove_proc_entry(acpi_device_bid(device), acpi_ec_dir);
625 acpi_device_dir(device) = NULL;
631 /* --------------------------------------------------------------------------
633 -------------------------------------------------------------------------- */
635 ec_parse_io_ports(struct acpi_resource *resource, void *context);
637 static struct acpi_ec *make_acpi_ec(void)
639 struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
643 ec->flags = 1 << EC_FLAGS_QUERY_PENDING;
644 mutex_init(&ec->lock);
645 init_waitqueue_head(&ec->wait);
646 INIT_LIST_HEAD(&ec->list);
652 acpi_ec_register_query_methods(acpi_handle handle, u32 level,
653 void *context, void **return_value)
655 struct acpi_namespace_node *node = handle;
656 struct acpi_ec *ec = context;
658 if (sscanf(node->name.ascii, "_Q%x", &value) == 1) {
659 acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
665 ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
669 struct acpi_ec *ec = context;
670 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
671 ec_parse_io_ports, ec);
672 if (ACPI_FAILURE(status))
675 /* Get GPE bit assignment (EC events). */
676 /* TODO: Add support for _GPE returning a package */
677 status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe);
678 if (ACPI_FAILURE(status))
680 /* Find and register all query methods */
681 acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1,
682 acpi_ec_register_query_methods, ec, NULL);
683 /* Use the global lock for all EC transactions? */
684 acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
686 return AE_CTRL_TERMINATE;
689 static void ec_remove_handlers(struct acpi_ec *ec)
691 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
692 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
693 printk(KERN_ERR PREFIX "failed to remove space handler\n");
694 if (ACPI_FAILURE(acpi_remove_gpe_handler(NULL, ec->gpe,
695 &acpi_ec_gpe_handler)))
696 printk(KERN_ERR PREFIX "failed to remove gpe handler\n");
697 ec->handlers_installed = 0;
700 static int acpi_ec_add(struct acpi_device *device)
702 struct acpi_ec *ec = NULL;
706 strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
707 strcpy(acpi_device_class(device), ACPI_EC_CLASS);
709 /* Check for boot EC */
711 if (boot_ec->handle == device->handle) {
712 /* Pre-loaded EC from DSDT, just move pointer */
716 } else if (boot_ec->handle == ACPI_ROOT_OBJECT) {
717 /* ECDT-based EC, time to shut it down */
718 ec_remove_handlers(boot_ec);
720 first_ec = boot_ec = NULL;
728 if (ec_parse_device(device->handle, 0, ec, NULL) !=
733 ec->handle = device->handle;
737 acpi_driver_data(device) = ec;
738 acpi_ec_add_fs(device);
739 printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
740 ec->gpe, ec->command_addr, ec->data_addr);
744 static int acpi_ec_remove(struct acpi_device *device, int type)
747 struct acpi_ec_query_handler *handler, *tmp;
752 ec = acpi_driver_data(device);
753 mutex_lock(&ec->lock);
754 list_for_each_entry_safe(handler, tmp, &ec->list, node) {
755 list_del(&handler->node);
758 mutex_unlock(&ec->lock);
759 acpi_ec_remove_fs(device);
760 acpi_driver_data(device) = NULL;
768 ec_parse_io_ports(struct acpi_resource *resource, void *context)
770 struct acpi_ec *ec = context;
772 if (resource->type != ACPI_RESOURCE_TYPE_IO)
776 * The first address region returned is the data port, and
777 * the second address region returned is the status/command
780 if (ec->data_addr == 0)
781 ec->data_addr = resource->data.io.minimum;
782 else if (ec->command_addr == 0)
783 ec->command_addr = resource->data.io.minimum;
785 return AE_CTRL_TERMINATE;
790 static int ec_install_handlers(struct acpi_ec *ec)
793 if (ec->handlers_installed)
795 status = acpi_install_gpe_handler(NULL, ec->gpe,
796 ACPI_GPE_EDGE_TRIGGERED,
797 &acpi_ec_gpe_handler, ec);
798 if (ACPI_FAILURE(status))
801 acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME);
802 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
804 status = acpi_install_address_space_handler(ec->handle,
806 &acpi_ec_space_handler,
807 &acpi_ec_space_setup, ec);
808 if (ACPI_FAILURE(status)) {
809 acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
813 ec->handlers_installed = 1;
817 static int acpi_ec_start(struct acpi_device *device)
825 ec = acpi_driver_data(device);
830 ret = ec_install_handlers(ec);
832 /* EC is fully operational, allow queries */
833 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
837 static int acpi_ec_stop(struct acpi_device *device, int type)
842 ec = acpi_driver_data(device);
845 ec_remove_handlers(ec);
850 int __init acpi_ec_ecdt_probe(void)
854 struct acpi_table_ecdt *ecdt_ptr;
856 boot_ec = make_acpi_ec();
860 * Generate a boot ec context
862 status = acpi_get_table(ACPI_SIG_ECDT, 1,
863 (struct acpi_table_header **)&ecdt_ptr);
864 if (ACPI_SUCCESS(status)) {
865 printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n");
866 boot_ec->command_addr = ecdt_ptr->control.address;
867 boot_ec->data_addr = ecdt_ptr->data.address;
868 boot_ec->gpe = ecdt_ptr->gpe;
869 boot_ec->handle = ACPI_ROOT_OBJECT;
871 printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
872 status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
874 /* Check that acpi_get_devices actually find something */
875 if (ACPI_FAILURE(status) || !boot_ec->handle)
879 ret = ec_install_handlers(boot_ec);
890 static int __init acpi_ec_init(void)
897 acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
901 /* Now register the driver for the EC */
902 result = acpi_bus_register_driver(&acpi_ec_driver);
904 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
911 subsys_initcall(acpi_ec_init);
913 /* EC driver currently not unloadable */
915 static void __exit acpi_ec_exit(void)
918 acpi_bus_unregister_driver(&acpi_ec_driver);
920 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
926 static int __init acpi_ec_set_intr_mode(char *str)
930 if (!get_option(&str, &intr))
933 acpi_ec_mode = (intr) ? EC_INTR : EC_POLL;
935 printk(KERN_NOTICE PREFIX "%s mode.\n", intr ? "interrupt" : "polling");
940 __setup("ec_intr=", acpi_ec_set_intr_mode);