diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2007-10-22 06:18:56 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-10-25 16:31:31 -0400 |
commit | 66c5f4e7367b0085652931b2f3366de29e7ff5ec (patch) | |
tree | b4745520c76a7ce77dff0a7627b933e7c0ddfdeb /drivers/acpi/ec.c | |
parent | 1c55053c21706ccf1fdb26b4bb6d05c4a2782ffe (diff) |
ACPI: EC: Add workaround for "optimized" controllers
Some controllers do not send interrupts for OBF=1 event, but send
them for IBF=0. Add workaround for them.
Reference: http://bugzilla.kernel.org/show_bug.cgi?id=8459
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r-- | drivers/acpi/ec.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 41a21fcdbcb8..202db575d5db 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -75,6 +75,7 @@ enum { | |||
75 | EC_FLAGS_WAIT_GPE = 0, /* Don't check status until GPE arrives */ | 75 | EC_FLAGS_WAIT_GPE = 0, /* Don't check status until GPE arrives */ |
76 | EC_FLAGS_QUERY_PENDING, /* Query is pending */ | 76 | EC_FLAGS_QUERY_PENDING, /* Query is pending */ |
77 | EC_FLAGS_GPE_MODE, /* Expect GPE to be sent for status change */ | 77 | EC_FLAGS_GPE_MODE, /* Expect GPE to be sent for status change */ |
78 | EC_FLAGS_ONLY_IBF_GPE, /* Expect GPE only for IBF = 0 event */ | ||
78 | }; | 79 | }; |
79 | 80 | ||
80 | static int acpi_ec_remove(struct acpi_device *device, int type); | 81 | static int acpi_ec_remove(struct acpi_device *device, int type); |
@@ -172,7 +173,12 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll) | |||
172 | return 0; | 173 | return 0; |
173 | clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags); | 174 | clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags); |
174 | if (acpi_ec_check_status(ec, event)) { | 175 | if (acpi_ec_check_status(ec, event)) { |
175 | clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); | 176 | if (event == ACPI_EC_EVENT_OBF_1) |
177 | /* miss OBF = 1 GPE, don't expect it anymore */ | ||
178 | set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags); | ||
179 | else | ||
180 | /* missing GPEs, switch back to poll mode */ | ||
181 | clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); | ||
176 | return 0; | 182 | return 0; |
177 | } | 183 | } |
178 | } else { | 184 | } else { |
@@ -220,6 +226,8 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command, | |||
220 | clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); | 226 | clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); |
221 | 227 | ||
222 | for (; rdata_len > 0; --rdata_len) { | 228 | for (; rdata_len > 0; --rdata_len) { |
229 | if (test_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags)) | ||
230 | force_poll = 1; | ||
223 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll); | 231 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll); |
224 | if (result) { | 232 | if (result) { |
225 | printk(KERN_ERR PREFIX "read timeout, command = %d\n", | 233 | printk(KERN_ERR PREFIX "read timeout, command = %d\n", |