|
Lines 108-113
static struct acpi_ec {
Link Here
|
| 108 |
atomic_t query_pending; |
108 |
atomic_t query_pending; |
| 109 |
atomic_t event_count; |
109 |
atomic_t event_count; |
| 110 |
wait_queue_head_t wait; |
110 |
wait_queue_head_t wait; |
|
|
111 |
u8 handlers_installed; |
| 111 |
} *boot_ec, *first_ec; |
112 |
} *boot_ec, *first_ec; |
| 112 |
|
113 |
|
| 113 |
/* -------------------------------------------------------------------------- |
114 |
/* -------------------------------------------------------------------------- |
|
Lines 708-713
ec_parse_io_ports(struct acpi_resource *
Link Here
|
| 708 |
static int ec_install_handlers(struct acpi_ec *ec) |
709 |
static int ec_install_handlers(struct acpi_ec *ec) |
| 709 |
{ |
710 |
{ |
| 710 |
acpi_status status; |
711 |
acpi_status status; |
|
|
712 |
if (ec->handlers_installed) |
| 713 |
return 0; |
| 711 |
status = acpi_install_gpe_handler(NULL, ec->gpe, |
714 |
status = acpi_install_gpe_handler(NULL, ec->gpe, |
| 712 |
ACPI_GPE_EDGE_TRIGGERED, |
715 |
ACPI_GPE_EDGE_TRIGGERED, |
| 713 |
&acpi_ec_gpe_handler, ec); |
716 |
&acpi_ec_gpe_handler, ec); |
|
Lines 728-734
static int ec_install_handlers(struct ac
Link Here
|
| 728 |
|
731 |
|
| 729 |
/* EC is fully operational, allow queries */ |
732 |
/* EC is fully operational, allow queries */ |
| 730 |
atomic_set(&ec->query_pending, 0); |
733 |
atomic_set(&ec->query_pending, 0); |
| 731 |
|
734 |
ec->handlers_installed = 1; |
| 732 |
return 0; |
735 |
return 0; |
| 733 |
} |
736 |
} |
| 734 |
|
737 |
|
|
Lines 779-785
static int acpi_ec_stop(struct acpi_devi
Link Here
|
| 779 |
status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); |
782 |
status = acpi_remove_gpe_handler(NULL, ec->gpe, &acpi_ec_gpe_handler); |
| 780 |
if (ACPI_FAILURE(status)) |
783 |
if (ACPI_FAILURE(status)) |
| 781 |
return -ENODEV; |
784 |
return -ENODEV; |
| 782 |
|
785 |
ec->handlers_installed = 0; |
| 783 |
return 0; |
786 |
return 0; |
| 784 |
} |
787 |
} |
| 785 |
|
788 |
|
|
Lines 811-816
ec_parse_device(acpi_handle handle, u32
Link Here
|
| 811 |
return AE_CTRL_TERMINATE; |
814 |
return AE_CTRL_TERMINATE; |
| 812 |
} |
815 |
} |
| 813 |
|
816 |
|
|
|
817 |
int __init acpi_boot_ec_enable(void) |
| 818 |
{ |
| 819 |
if (!boot_ec || boot_ec->handlers_installed) |
| 820 |
return 0; |
| 821 |
if (!ec_install_handlers(boot_ec)) { |
| 822 |
first_ec = boot_ec; |
| 823 |
return 0; |
| 824 |
} |
| 825 |
return -EFAULT; |
| 826 |
} |
| 827 |
|
| 814 |
int __init acpi_ec_ecdt_probe(void) |
828 |
int __init acpi_ec_ecdt_probe(void) |
| 815 |
{ |
829 |
{ |
| 816 |
int ret; |
830 |
int ret; |
|
Lines 840-846
int __init acpi_ec_ecdt_probe(void)
Link Here
|
| 840 |
if (ACPI_FAILURE(status) || !boot_ec->handle) |
854 |
if (ACPI_FAILURE(status) || !boot_ec->handle) |
| 841 |
goto error; |
855 |
goto error; |
| 842 |
if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x))) |
856 |
if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x))) |
| 843 |
goto error; |
857 |
return -ENODEV; |
| 844 |
} |
858 |
} |
| 845 |
|
859 |
|
| 846 |
ret = ec_install_handlers(boot_ec); |
860 |
ret = ec_install_handlers(boot_ec); |