summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
Commit message (Collapse)AuthorAgeFilesLines
* ACPI: EC: "DEBUG" needs to be defined earlierMárton Németh2008-01-231-3/+3
| | | | | | | | The "DEBUG" symbol needs to be defined before #including <linux/kernel.h> to get the pr_debug() working. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: add leading zeros to debug messagesMárton Németh2008-01-231-4/+4
| | | | | | | | Add leading zeros to pr_debug() calls. For example if x=0x0a, the format "0x%2x" will result the string "0x a", the format "0x%2.2x" will result "0x0a". Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: fix dmesg spam regressionAlexey Starikovskiy2008-01-231-1/+11
| | | | | | | | | Return OBF_1 optimization workaround 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>
* ACPI: EC: Enable boot EC before bus_scanAlexey Starikovskiy2008-01-011-1/+13
| | | | | | | | | | | Some _STA methods called during bus_scan() might require EC region handler, which might be enabled later in the scan. Enable it explicitly before scan to avoid errors. Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9627 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* Pull bugzilla-9327 into release branchLen Brown2007-11-201-19/+42
|\ | | | | | | | | | | | | | | Conflicts: drivers/acpi/ec.c Signed-off-by: Len Brown <len.brown@intel.com>
| * ACPI: EC: Workaround for optimized controllers (version 3)Alexey Starikovskiy2007-11-201-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some controllers fail to send confirmation GPE after address or data write. Detect this and don't expect such confirmation in future. This is a generalization of previous workaround (66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address. Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9327 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Romano Giannetti <romano.giannetti@gmail.com> Tested-by: Mats Johannesson Signed-off-by: Len Brown <len.brown@intel.com>
| * ACPI: EC: use printk_ratelimit(), add some DEBUG mode messagesMárton Németh2007-11-201-19/+31
| | | | | | | | | | | | | | | | | | | | Sometimes it is usefull to see raw protocol dump. Uncomment '#define DEBUG' at the beginning of file to make EC really verbose. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
| * Revert "ACPI: EC: Workaround for optimized controllers"Len Brown2007-11-201-22/+13
| | | | | | | | This reverts commit f2d68935ba08cf80f151bbdb5628381184e4a498.
* | Pull fluff into release branchLen Brown2007-11-201-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/acpi/ec.c Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: Add missing spaces to printk formatJoe Perches2007-11-191-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Len Brown <len.brown@intel.com>
* | | Pull bugzilla-9327 into release branchLen Brown2007-11-201-13/+22
|\ \ \ | | |/ | |/|
| * | ACPI: EC: Workaround for optimized controllersAlexey Starikovskiy2007-11-191-13/+22
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Some controllers fail to send confirmation GPE after address write. Detect this and don't expect such confirmation in future. This is a generalization of previous workaround (66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address. http://bugzilla.kernel.org/show_bug.cgi?id=9327 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Romano Giannetti <romano.giannetti@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
* / ACPI: EC: Don't init EC early if it has no _INIAlexey Starikovskiy2007-11-191-0/+8
|/ | | | | | | | | | | | | | | | Option to init EC early inserted to handle #8598 ASUS problem, introduced several others. EC driver in this particular case has fake _INI method, not present on other machines, which don't need or break from this workaround, so lets use its presence as a flag for early init. http://bugzilla.kernel.org/show_bug.cgi?id=9262 http://bugzilla.kernel.org/show_bug.cgi?id=8598 https://bugzilla.novell.com/show_bug.cgi?id=334806 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: fix use-after-freeAdrian Bunk2007-10-251-2/+2
| | | | | | | | | | | | This patch fixes a use-after-free introduced by commit 30c08574da0ead1a47797ce028218ce5b2de61c7 (ACPI: EC: Add new query handler to list head) Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Output changes to operational modeAlexey Starikovskiy2007-10-251-3/+14
| | | | | | | | Insert printk() for every change in operational mode. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Add workaround for "optimized" controllersAlexey Starikovskiy2007-10-251-1/+9
| | | | | | | | | | 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>
* ACPI: EC: Don't re-enable GPE for each transaction.Alexey Starikovskiy2007-10-251-5/+0
| | | | | | | | | | | | | | With the auto selection of operation mode, absence of GPEs does not really degrade performance, so let PM code to handle enabling/disabling GPEs. This is a revert of 5d57a6a55ec0bdcb952dbcd3f8ffcde8a3ee9413, which was meant to be temporary. Reference: http://bugzilla.kernel.org/show_bug.cgi?id=7977 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: auto select interrupt modeAlexey Starikovskiy2007-10-251-35/+16
| | | | | | | | | Start in POLL mode, and if we receive confirmation GPE, switch to INT mode. If confirmations are not sent, switch back to POLL. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Don't expect interrupt after last readAlexey Starikovskiy2007-10-251-1/+3
| | | | | | | | There is no interrupt after last read according to spec, so don't set bit that we are expecting one. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Replace atomic variables with bitsAlexey Starikovskiy2007-10-251-41/+38
| | | | | | | | | | Number of flags is about to be increased, so it is better to put them all into bits. No functional changes. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
* Pull bugzilla-8709 into release branchLen Brown2007-10-101-51/+39
|\
| * ACPI: EC: Drop ECDT-based boot_ec as soon as we find DSDT-based one.Alexey Starikovskiy2007-09-051-51/+39
| | | | | | | | | | | | | | | | | | ASUS notebooks have numerous problems with EC initialization This patch tries to work around three known issues reported in bugzilla 8598, 8709 and 8909/8919. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* | ACPI: EC: Add new query handler to list head.Alexey Starikovskiy2007-09-271-2/+1
|/ | | | | Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Check if boot_ec was really found in DSDTAlexey Starikovskiy2007-08-301-1/+2
| | | | | | | | | | acpi_get_devices() returns success if it did not find any device. We have to check for this case. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Daniel Ritz <daniel.ritz-ml@swissonline.ch> Tested-by: Luca <kronos.it@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ACPI: EC: revert fix for bugzilla 8709Alexey Starikovskiy2007-08-241-16/+31
| | | | | | | | This is a manual revert of 7c010de7506954e973abfab5c5999c5a97f7a73e, a fix that broke another ASUS in 8909 and 8919. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Fix "no battery" regressionAlexey Starikovskiy2007-08-141-0/+17
| | | | | | | | | Restore deleted call to register query methods. http://bugzilla.kernel.org/show_bug.cgi?id=8886 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI EC: remove potential deadlock from ECAlexey Starikovskiy2007-08-111-2/+0
| | | | | | Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: fix run-together printk linesMeelis Roos2007-08-031-1/+1
| | | | | Signed-off-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: acpi_ec_remove(): fix use-after-freeAdrian Bunk2007-08-031-2/+2
| | | | | | | | | | | This patch fixes an obvious use-after-free introduced by commit 837012ede14a8fc088be3682c964da7fc6af026b. Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Switch from boot_ec as soon as we find its desc in DSDT.Alexey Starikovskiy2007-08-031-29/+16
| | | | | | | | | | Some ASUS laptops fail to use boot time EC and need to eventually switch to one described in DSDT. http://bugzilla.kernel.org/show_bug.cgi?id=8709 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: fix build warningLen Brown2007-08-031-13/+0
| | | | | | drivers/acpi/ec.c:657: warning: ‘acpi_ec_register_query_methods’ defined but not used Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: If ECDT is not found, look up EC in DSDT.Alexey Starikovskiy2007-08-031-22/+28
| | | | | | | | | | | | | | Some ASUS laptops access EC space from device _INI methods, but do not provide ECDT for early EC setup. In order to make them function properly, there is a need to find EC is DSDT before any _INI is called. Similar functionality was turned on by acpi_fake_ecdt=1 command line before. Now it is on all the time. http://bugzilla.kernel.org/show_bug.cgi?id=8598 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Remove noisy debug printk fron EC driver.Alexey Starikovskiy2007-08-031-1/+0
| | | | | | | ACPI: EC: Handler for query 0x57 is not found! Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI ↵Thomas Renninger2007-07-231-2/+6
| | | | | | | | | | drivers modpost is going to use these to create e.g. acpi:ACPI0001 in modules.alias. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI EC: Add support for non-AML EC query handlersAlexey Starikovskiy2007-06-231-50/+125
| | | | | Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI EC: drop usage of ACPI_DEBUG_PRINT as too heavy weightAlexey Starikovskiy2007-06-231-14/+6
| | | | | Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI EC: Re-factor EC space handler to avoid using label/goto for cycle.Alexey Starikovskiy2007-06-231-39/+17
| | | | | Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
* acpi,msi-laptop: Fall back to EC polling mode for MSI laptop specific EC ↵Lennart Poettering2007-05-101-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commands The ACPI EC that is used in MSI laptops knows some non-standard commands for changing the screen brighntess and a few other things, which are used by the msi-laptop.c driver. Unfortunately for these commands no GPE events for IBF and OBF are triggered. Since nowadays the EC code uses the ec_intr=1 mode by default, this causes these operations to timeout, although they don't fail. In result, all operations that you can do with the msi-laptop.c driver take more or less 1s to complete, which is awfully slow. In one of the more recent kernels (2.6.20?) the EC subsystem has been revamped. With that change the EC timeout has been increased. before that increase the MSI EC accesses were slow -- but not *that* slow, hence I took notice of this limitation of the MSI EC hardware only very recently. The standard EC operations on the MSI EC as defined in the ACPI spec support GPE events properly. The following patch adds a new argument "force_poll" to the ec_transaction() function (and friends). If set to 1, the function will poll for IBF/OBF even if ec_intr=1 is enabled. If set to 0 the current behaviour is used. The msi-laptop driver is modified to make use of this new flag, so that OBF/IBF is polled for the special MSI EC transactions -- but only for them. Signed-off-by: Lennart Poettering <mzxreary@0pointer.de> Acked-by: Alexey Starikovskiy <aystarik@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Block queries until EC is fully initializedAlexey Starikovskiy2007-03-091-1/+4
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Cleanup of EC initializationAlexey Starikovskiy2007-03-091-19/+13
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: first_ec is better to be acpi_ec than acpi_device.Alexey Starikovskiy2007-03-091-28/+13
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Rename ec_ecdt to more informative boot_ecAlexey Starikovskiy2007-03-091-23/+20
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Clean ECDT and namespace parsing.Alexey Starikovskiy2007-03-091-96/+109
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Put install handlers into separate function.Alexey Starikovskiy2007-03-091-60/+27
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Remove casts to/from void* from ec.cAlexey Starikovskiy2007-03-091-7/+6
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: enable burst functionality in EC.Alexey Starikovskiy2007-03-091-52/+37
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: "Fake ECDT" workaround is not needed any longer.Alexey Starikovskiy2007-03-091-81/+0
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: EC: Don't use Global Lock if not asked to do soAlexey Starikovskiy2007-03-091-3/+0
| | | | | Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: ec: fix race in status register accessAlexey Starikovskiy2007-03-091-17/+23
| | | | | | | | | | | | | | | | | | | Delay the read of the EC status register until after the event that caused it occurs -- otherwise it is possible to read and act on stale status that was associated with the previous event. Do this with a perpetually incrementing "event_count" to detect when a new event occurs and it is safe to read status. There is no workaround for polling mode -- it is inherently exposed to reading and acting on stale status, since it doesn't have an interrupt to tell it the event completed. http://bugzilla.kernel.org/show_bug.cgi?id=8110 Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* Pull fluff into release branchLen Brown2007-02-161-3/+2
|\ | | | | | | | | | | | | | | | | Conflicts: arch/x86_64/pci/mmconfig.c drivers/acpi/bay.c Signed-off-by: Len Brown <len.brown@intel.com>