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 /* Don't expect GPE after last read */
233 set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
234 *(rdata++) = acpi_ec_read_data(ec);
240 static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
241 const u8 * wdata, unsigned wdata_len,
242 u8 * rdata, unsigned rdata_len,
248 if (!ec || (wdata_len && !wdata) || (rdata_len && !rdata))
252 memset(rdata, 0, rdata_len);
254 mutex_lock(&ec->lock);
255 if (ec->global_lock) {
256 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
257 if (ACPI_FAILURE(status)) {
258 mutex_unlock(&ec->lock);
263 /* Make sure GPE is enabled before doing transaction */
264 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
266 status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0);
268 printk(KERN_ERR PREFIX
269 "input buffer is not empty, aborting transaction\n");
273 status = acpi_ec_transaction_unlocked(ec, command,
281 acpi_release_global_lock(glk);
282 mutex_unlock(&ec->lock);
288 * Note: samsung nv5000 doesn't work with ec burst mode.
289 * http://bugzilla.kernel.org/show_bug.cgi?id=4980
291 int acpi_ec_burst_enable(struct acpi_ec *ec)
294 return acpi_ec_transaction(ec, ACPI_EC_BURST_ENABLE, NULL, 0, &d, 1, 0);
297 int acpi_ec_burst_disable(struct acpi_ec *ec)
299 return acpi_ec_transaction(ec, ACPI_EC_BURST_DISABLE, NULL, 0, NULL, 0, 0);
302 static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 * data)
307 result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_READ,
308 &address, 1, &d, 1, 0);
313 static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
315 u8 wdata[2] = { address, data };
316 return acpi_ec_transaction(ec, ACPI_EC_COMMAND_WRITE,
317 wdata, 2, NULL, 0, 0);
321 * Externally callable EC access functions. For now, assume 1 EC only
323 int ec_burst_enable(void)
327 return acpi_ec_burst_enable(first_ec);
330 EXPORT_SYMBOL(ec_burst_enable);
332 int ec_burst_disable(void)
336 return acpi_ec_burst_disable(first_ec);
339 EXPORT_SYMBOL(ec_burst_disable);
341 int ec_read(u8 addr, u8 * val)
349 err = acpi_ec_read(first_ec, addr, &temp_data);
358 EXPORT_SYMBOL(ec_read);
360 int ec_write(u8 addr, u8 val)
367 err = acpi_ec_write(first_ec, addr, val);
372 EXPORT_SYMBOL(ec_write);
374 int ec_transaction(u8 command,
375 const u8 * wdata, unsigned wdata_len,
376 u8 * rdata, unsigned rdata_len,
382 return acpi_ec_transaction(first_ec, command, wdata,
383 wdata_len, rdata, rdata_len,
387 EXPORT_SYMBOL(ec_transaction);
389 static int acpi_ec_query(struct acpi_ec *ec, u8 * data)
398 * Query the EC to find out which _Qxx method we need to evaluate.
399 * Note that successful completion of the query causes the ACPI_EC_SCI
400 * bit to be cleared (and thus clearing the interrupt source).
403 result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_QUERY, NULL, 0, &d, 1, 0);
414 /* --------------------------------------------------------------------------
416 -------------------------------------------------------------------------- */
417 int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
418 acpi_handle handle, acpi_ec_query_func func,
421 struct acpi_ec_query_handler *handler =
422 kzalloc(sizeof(struct acpi_ec_query_handler), GFP_KERNEL);
426 handler->query_bit = query_bit;
427 handler->handle = handle;
428 handler->func = func;
429 handler->data = data;
430 mutex_lock(&ec->lock);
431 list_add(&handler->node, &ec->list);
432 mutex_unlock(&ec->lock);
436 EXPORT_SYMBOL_GPL(acpi_ec_add_query_handler);
438 void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
440 struct acpi_ec_query_handler *handler;
441 mutex_lock(&ec->lock);
442 list_for_each_entry(handler, &ec->list, node) {
443 if (query_bit == handler->query_bit) {
444 list_del(&handler->node);
448 mutex_unlock(&ec->lock);
451 EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);
453 static void acpi_ec_gpe_query(void *ec_cxt)
455 struct acpi_ec *ec = ec_cxt;
457 struct acpi_ec_query_handler *handler, copy;
459 if (!ec || acpi_ec_query(ec, &value))
461 mutex_lock(&ec->lock);
462 list_for_each_entry(handler, &ec->list, node) {
463 if (value == handler->query_bit) {
464 /* have custom handler for this bit */
465 memcpy(©, handler, sizeof(copy));
466 mutex_unlock(&ec->lock);
468 copy.func(copy.data);
469 } else if (copy.handle) {
470 acpi_evaluate_object(copy.handle, NULL, NULL, NULL);
475 mutex_unlock(&ec->lock);
478 static u32 acpi_ec_gpe_handler(void *data)
480 acpi_status status = AE_OK;
481 struct acpi_ec *ec = data;
483 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
485 if (acpi_ec_mode == EC_INTR) {
489 if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_SCI) {
490 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
491 status = acpi_os_execute(OSL_EC_BURST_HANDLER,
492 acpi_ec_gpe_query, ec);
495 return status == AE_OK ?
496 ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
499 /* --------------------------------------------------------------------------
500 Address Space Management
501 -------------------------------------------------------------------------- */
504 acpi_ec_space_setup(acpi_handle region_handle,
505 u32 function, void *handler_context, void **return_context)
508 * The EC object is in the handler context and is needed
509 * when calling the acpi_ec_space_handler.
511 *return_context = (function != ACPI_REGION_DEACTIVATE) ?
512 handler_context : NULL;
518 acpi_ec_space_handler(u32 function, acpi_physical_address address,
519 u32 bits, acpi_integer *value,
520 void *handler_context, void *region_context)
522 struct acpi_ec *ec = handler_context;
523 int result = 0, i = 0;
526 if ((address > 0xFF) || !value || !handler_context)
527 return AE_BAD_PARAMETER;
529 if (function != ACPI_READ && function != ACPI_WRITE)
530 return AE_BAD_PARAMETER;
532 if (bits != 8 && acpi_strict)
533 return AE_BAD_PARAMETER;
535 while (bits - i > 0) {
536 if (function == ACPI_READ) {
537 result = acpi_ec_read(ec, address, &temp);
538 (*value) |= ((acpi_integer)temp) << i;
540 temp = 0xff & ((*value) >> i);
541 result = acpi_ec_write(ec, address, temp);
549 return AE_BAD_PARAMETER;
562 /* --------------------------------------------------------------------------
564 -------------------------------------------------------------------------- */
566 static struct proc_dir_entry *acpi_ec_dir;
568 static int acpi_ec_read_info(struct seq_file *seq, void *offset)
570 struct acpi_ec *ec = seq->private;
575 seq_printf(seq, "gpe:\t\t\t0x%02x\n", (u32) ec->gpe);
576 seq_printf(seq, "ports:\t\t\t0x%02x, 0x%02x\n",
577 (unsigned)ec->command_addr, (unsigned)ec->data_addr);
578 seq_printf(seq, "use global lock:\t%s\n",
579 ec->global_lock ? "yes" : "no");
584 static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
586 return single_open(file, acpi_ec_read_info, PDE(inode)->data);
589 static struct file_operations acpi_ec_info_ops = {
590 .open = acpi_ec_info_open_fs,
593 .release = single_release,
594 .owner = THIS_MODULE,
597 static int acpi_ec_add_fs(struct acpi_device *device)
599 struct proc_dir_entry *entry = NULL;
601 if (!acpi_device_dir(device)) {
602 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
604 if (!acpi_device_dir(device))
608 entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
609 acpi_device_dir(device));
613 entry->proc_fops = &acpi_ec_info_ops;
614 entry->data = acpi_driver_data(device);
615 entry->owner = THIS_MODULE;
621 static int acpi_ec_remove_fs(struct acpi_device *device)
624 if (acpi_device_dir(device)) {
625 remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
626 remove_proc_entry(acpi_device_bid(device), acpi_ec_dir);
627 acpi_device_dir(device) = NULL;
633 /* --------------------------------------------------------------------------
635 -------------------------------------------------------------------------- */
637 ec_parse_io_ports(struct acpi_resource *resource, void *context);
639 static struct acpi_ec *make_acpi_ec(void)
641 struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
645 ec->flags = 1 << EC_FLAGS_QUERY_PENDING;
646 mutex_init(&ec->lock);
647 init_waitqueue_head(&ec->wait);
648 INIT_LIST_HEAD(&ec->list);
654 acpi_ec_register_query_methods(acpi_handle handle, u32 level,
655 void *context, void **return_value)
657 struct acpi_namespace_node *node = handle;
658 struct acpi_ec *ec = context;
660 if (sscanf(node->name.ascii, "_Q%x", &value) == 1) {
661 acpi_ec_add_query_handler(ec, value, handle, NULL, NULL);
667 ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
671 struct acpi_ec *ec = context;
672 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
673 ec_parse_io_ports, ec);
674 if (ACPI_FAILURE(status))
677 /* Get GPE bit assignment (EC events). */
678 /* TODO: Add support for _GPE returning a package */
679 status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe);
680 if (ACPI_FAILURE(status))
682 /* Find and register all query methods */
683 acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1,
684 acpi_ec_register_query_methods, ec, NULL);
685 /* Use the global lock for all EC transactions? */
686 acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock);
688 return AE_CTRL_TERMINATE;
691 static void ec_remove_handlers(struct acpi_ec *ec)
693 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
694 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
695 printk(KERN_ERR PREFIX "failed to remove space handler\n");
696 if (ACPI_FAILURE(acpi_remove_gpe_handler(NULL, ec->gpe,
697 &acpi_ec_gpe_handler)))
698 printk(KERN_ERR PREFIX "failed to remove gpe handler\n");
699 ec->handlers_installed = 0;
702 static int acpi_ec_add(struct acpi_device *device)
704 struct acpi_ec *ec = NULL;
708 strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
709 strcpy(acpi_device_class(device), ACPI_EC_CLASS);
711 /* Check for boot EC */
713 if (boot_ec->handle == device->handle) {
714 /* Pre-loaded EC from DSDT, just move pointer */
718 } else if (boot_ec->handle == ACPI_ROOT_OBJECT) {
719 /* ECDT-based EC, time to shut it down */
720 ec_remove_handlers(boot_ec);
722 first_ec = boot_ec = NULL;
730 if (ec_parse_device(device->handle, 0, ec, NULL) !=
735 ec->handle = device->handle;
739 acpi_driver_data(device) = ec;
740 acpi_ec_add_fs(device);
741 printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n",
742 ec->gpe, ec->command_addr, ec->data_addr);
746 static int acpi_ec_remove(struct acpi_device *device, int type)
749 struct acpi_ec_query_handler *handler, *tmp;
754 ec = acpi_driver_data(device);
755 mutex_lock(&ec->lock);
756 list_for_each_entry_safe(handler, tmp, &ec->list, node) {
757 list_del(&handler->node);
760 mutex_unlock(&ec->lock);
761 acpi_ec_remove_fs(device);
762 acpi_driver_data(device) = NULL;
770 ec_parse_io_ports(struct acpi_resource *resource, void *context)
772 struct acpi_ec *ec = context;
774 if (resource->type != ACPI_RESOURCE_TYPE_IO)
778 * The first address region returned is the data port, and
779 * the second address region returned is the status/command
782 if (ec->data_addr == 0)
783 ec->data_addr = resource->data.io.minimum;
784 else if (ec->command_addr == 0)
785 ec->command_addr = resource->data.io.minimum;
787 return AE_CTRL_TERMINATE;
792 static int ec_install_handlers(struct acpi_ec *ec)
795 if (ec->handlers_installed)
797 status = acpi_install_gpe_handler(NULL, ec->gpe,
798 ACPI_GPE_EDGE_TRIGGERED,
799 &acpi_ec_gpe_handler, ec);
800 if (ACPI_FAILURE(status))
803 acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME);
804 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
806 status = acpi_install_address_space_handler(ec->handle,
808 &acpi_ec_space_handler,
809 &acpi_ec_space_setup, ec);
810 if (ACPI_FAILURE(status)) {
811 acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler);
815 ec->handlers_installed = 1;
819 static int acpi_ec_start(struct acpi_device *device)
827 ec = acpi_driver_data(device);
832 ret = ec_install_handlers(ec);
834 /* EC is fully operational, allow queries */
835 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
839 static int acpi_ec_stop(struct acpi_device *device, int type)
844 ec = acpi_driver_data(device);
847 ec_remove_handlers(ec);
852 int __init acpi_ec_ecdt_probe(void)
856 struct acpi_table_ecdt *ecdt_ptr;
858 boot_ec = make_acpi_ec();
862 * Generate a boot ec context
864 status = acpi_get_table(ACPI_SIG_ECDT, 1,
865 (struct acpi_table_header **)&ecdt_ptr);
866 if (ACPI_SUCCESS(status)) {
867 printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n");
868 boot_ec->command_addr = ecdt_ptr->control.address;
869 boot_ec->data_addr = ecdt_ptr->data.address;
870 boot_ec->gpe = ecdt_ptr->gpe;
871 boot_ec->handle = ACPI_ROOT_OBJECT;
873 printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
874 status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
876 /* Check that acpi_get_devices actually find something */
877 if (ACPI_FAILURE(status) || !boot_ec->handle)
881 ret = ec_install_handlers(boot_ec);
892 static int __init acpi_ec_init(void)
899 acpi_ec_dir = proc_mkdir(ACPI_EC_CLASS, acpi_root_dir);
903 /* Now register the driver for the EC */
904 result = acpi_bus_register_driver(&acpi_ec_driver);
906 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
913 subsys_initcall(acpi_ec_init);
915 /* EC driver currently not unloadable */
917 static void __exit acpi_ec_exit(void)
920 acpi_bus_unregister_driver(&acpi_ec_driver);
922 remove_proc_entry(ACPI_EC_CLASS, acpi_root_dir);
928 static int __init acpi_ec_set_intr_mode(char *str)
932 if (!get_option(&str, &intr))
935 acpi_ec_mode = (intr) ? EC_INTR : EC_POLL;
937 printk(KERN_NOTICE PREFIX "%s mode.\n", intr ? "interrupt" : "polling");
942 __setup("ec_intr=", acpi_ec_set_intr_mode);