diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/ec.c | 60 |
1 files changed, 38 insertions, 22 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 7f07b6806ac0..da67d228c9ea 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -83,28 +83,6 @@ enum { | |||
83 | EC_FLAGS_RESCHEDULE_POLL /* Re-schedule poll */ | 83 | EC_FLAGS_RESCHEDULE_POLL /* Re-schedule poll */ |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static int acpi_ec_remove(struct acpi_device *device, int type); | ||
87 | static int acpi_ec_start(struct acpi_device *device); | ||
88 | static int acpi_ec_stop(struct acpi_device *device, int type); | ||
89 | static int acpi_ec_add(struct acpi_device *device); | ||
90 | |||
91 | static const struct acpi_device_id ec_device_ids[] = { | ||
92 | {"PNP0C09", 0}, | ||
93 | {"", 0}, | ||
94 | }; | ||
95 | |||
96 | static struct acpi_driver acpi_ec_driver = { | ||
97 | .name = "ec", | ||
98 | .class = ACPI_EC_CLASS, | ||
99 | .ids = ec_device_ids, | ||
100 | .ops = { | ||
101 | .add = acpi_ec_add, | ||
102 | .remove = acpi_ec_remove, | ||
103 | .start = acpi_ec_start, | ||
104 | .stop = acpi_ec_stop, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ | 86 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ |
109 | /* External interfaces use first EC only, so remember */ | 87 | /* External interfaces use first EC only, so remember */ |
110 | typedef int (*acpi_ec_query_func) (void *data); | 88 | typedef int (*acpi_ec_query_func) (void *data); |
@@ -924,6 +902,11 @@ int __init acpi_boot_ec_enable(void) | |||
924 | return -EFAULT; | 902 | return -EFAULT; |
925 | } | 903 | } |
926 | 904 | ||
905 | static const struct acpi_device_id ec_device_ids[] = { | ||
906 | {"PNP0C09", 0}, | ||
907 | {"", 0}, | ||
908 | }; | ||
909 | |||
927 | int __init acpi_ec_ecdt_probe(void) | 910 | int __init acpi_ec_ecdt_probe(void) |
928 | { | 911 | { |
929 | int ret; | 912 | int ret; |
@@ -973,6 +956,39 @@ int __init acpi_ec_ecdt_probe(void) | |||
973 | return -ENODEV; | 956 | return -ENODEV; |
974 | } | 957 | } |
975 | 958 | ||
959 | static int acpi_ec_suspend(struct acpi_device *device, pm_message_t state) | ||
960 | { | ||
961 | struct acpi_ec *ec = acpi_driver_data(device); | ||
962 | /* Stop using GPE */ | ||
963 | set_bit(EC_FLAGS_NO_GPE, &ec->flags); | ||
964 | clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); | ||
965 | acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); | ||
966 | return 0; | ||
967 | } | ||
968 | |||
969 | static int acpi_ec_resume(struct acpi_device *device) | ||
970 | { | ||
971 | struct acpi_ec *ec = acpi_driver_data(device); | ||
972 | /* Enable use of GPE back */ | ||
973 | clear_bit(EC_FLAGS_NO_GPE, &ec->flags); | ||
974 | acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); | ||
975 | return 0; | ||
976 | } | ||
977 | |||
978 | static struct acpi_driver acpi_ec_driver = { | ||
979 | .name = "ec", | ||
980 | .class = ACPI_EC_CLASS, | ||
981 | .ids = ec_device_ids, | ||
982 | .ops = { | ||
983 | .add = acpi_ec_add, | ||
984 | .remove = acpi_ec_remove, | ||
985 | .start = acpi_ec_start, | ||
986 | .stop = acpi_ec_stop, | ||
987 | .suspend = acpi_ec_suspend, | ||
988 | .resume = acpi_ec_resume, | ||
989 | }, | ||
990 | }; | ||
991 | |||
976 | static int __init acpi_ec_init(void) | 992 | static int __init acpi_ec_init(void) |
977 | { | 993 | { |
978 | int result = 0; | 994 | int result = 0; |