Commit Graph

58 Commits

Author SHA1 Message Date
Len Brown
723fe2ca82 ACPI: ec: enable printk on cmdline use
if somebody uses "ec_intr=", lets be sure to
capture that in the dmesg even in the non-debug case.

Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-06 00:02:07 -05:00
Guillaume Chazarain
c6e19194b6 ACPI: EC: move verbose printk to debug build only
The recent EC cleanup left a printk enabled on handler evaluation
resulting in a bunch of messages on normal operation, like so:

ACPI: EC: evaluating _Q60

Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-02 00:12:19 -05:00
Burman Yan
36bcbec7ce ACPI: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 16:54:54 -05:00
Len Brown
706b75ddbe Pull ec into test branch 2006-12-20 02:52:33 -05:00
Adrian Bunk
a854e08a5a ACPI: make drivers/acpi/ec.c:ec_ecdt static
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 00:44:39 -05:00
Len Brown
463e7c7cf9 Pull trivial into test branch
Conflicts:

	drivers/acpi/ec.c
2006-12-16 00:45:07 -05:00
Alexey Starikovskiy
6ccedb10e3 ACPI: ec: Lindent once again
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:09 -05:00
Alexey Starikovskiy
3261ff4db3 ACPI: ec: Change #define to enums there possible.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:09 -05:00
Alexey Starikovskiy
78d0af3392 ACPI: ec: Style changes.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy
523953b41e ACPI: ec: Acquire Global Lock under EC mutex.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy
50c1e1138c ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy
a86e277259 ACPI: ec: Rename gpe_bit to gpe
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy
c787a8551e ACPI: ec: Change semaphore to mutex.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy
5d0c288b73 ACPI: ec: Query only single query at a time.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy
e41334c0a6 ACPI: ec: Remove calls to clear_gpe() and enable_gpe(), as these are handled at
dispatch_gpe() level.

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy
af3fd1404f ACPI: ec: Remove expect_event and all races around it.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy
bec5a1e060 ACPI: ec: Read status register from check_status() function
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy
5c4064124a ACPI: ec: Increase timeout from 50 to 500 ms to handle old slow machines.
http://bugzilla.kernel.org/show_bug.cgi?id=7466

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:05 -05:00
Alexey Starikovskiy
5d57a6a55e ACPI: ec: Enable EC GPE at beginning of transaction
Temporary measure until resume sequence is right.

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:05 -05:00
Alexey Starikovskiy
d91df1aaa9 ACPI: ec: Allow for write semantics in any command.
Check for transaction attributes, not command index to decide on event to
expect.

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:04 -05:00
Randy Dunlap
616362de2f ACPI: make ec_transaction not extern
Fix sparse warning:
drivers/acpi/ec.c:372:12: warning: function 'ec_transaction' with external linkage has definition

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-27 01:47:34 -04:00
Lennart Poettering
ab9e43c640 ACPI: EC: export ec_transaction() for msi-laptop driver
Signed-off-by: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:56 -04:00
Denis M. Sadykov
6ffb221a82 ACPI: EC: Simplify acpi_hw_low_level*() with inb()/outb().
Simplify acpi_hw_low_level_xxx() functions to inb() and outb().

Signed-off-by: Alexey Y. Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:56 -04:00
Denis M. Sadykov
8e0341ba79 ACPI: EC: Unify poll and interrupt gpe handlers
Signed-off-by: Alexey Y. Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:55 -04:00
Denis M. Sadykov
3576cf619b ACPI: EC: Unify poll and interrupt mode transaction functions
Signed-off-by: Alexey Y. Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:55 -04:00
Denis M. Sadykov
703959d47e ACPI: EC: Remove unused variables and duplicated code
Signed-off-by: Alexey Y. Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:54 -04:00
Denis M. Sadykov
7c6db5e512 ACPI: EC: Remove unnecessary delay added by previous transation patch.
Remove unnecessary delay (50 ms) while reading data from EC in interrupt mode.

Signed-off-by: Alexey Y. Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:53 -04:00
Lennart Poettering
d7a76e4cb3 ACPI: consolidate functions in acpi ec driver
Unify the following functions:

    acpi_ec_poll_read()
    acpi_ec_poll_write()
    acpi_ec_poll_query()
    acpi_ec_intr_read()
    acpi_ec_intr_write()
    acpi_ec_intr_query()

into:

    acpi_ec_poll_transaction()
    acpi_ec_intr_transaction()

These new functions take as arguments an ACPI EC command, a few bytes
to write to the EC data register and a buffer for a few bytes to read
from the EC data register. The old _read(), _write(), _query() are
just special cases of these functions.

Then unified the code in acpi_ec_poll_transaction() and
acpi_ec_intr_transaction() a little more. Both functions are now just
wrappers around the new acpi_ec_transaction_unlocked() function. The
latter contains the EC access logic, the two original
function now just do their special way of locking and call the the
new function for the actual work.

This saves a lot of very similar code. The primary reason for doing
this, however, is that my driver for MSI 270 laptops needs to issue
some non-standard EC commands in a safe way. Due to this I added a new
exported function similar to ec_write()/ec_write() which is called
ec_transaction() and is essentially just a wrapper around
acpi_ec_{poll,intr}_transaction().

Signed-off-by: Lennart Poettering <mzxreary@0pointer.de>
Acked-by: Luming Yu <luming.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14 00:49:52 -04:00
Arjan van de Ven
d75080328a ACPI: add 'const' to several ACPI file_operations
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-07-10 00:04:29 -04:00
Vladimir Lebedev
49fee981fa ACPI: fix battery on HP NX6125
EC problem was cause of both battery and AC issues.
http://bugzilla.kernel.org/show_bug.cgi?id=6455

Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-28 12:44:45 -04:00
Patrick Mochel
d550d98d33 ACPI: delete tracing macros from drivers/acpi/*.c
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-27 00:41:40 -04:00
Len Brown
6468463abd ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-27 00:01:06 -04:00
Thomas Renninger
a6fc67202e ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-26 23:58:43 -04:00
Len Brown
5b542e4422 Pull bugzilla-5764 into release branch 2006-06-15 21:34:21 -04:00
Len Brown
60e04a5c53 Pull ec into release branch 2006-06-15 15:35:37 -04:00
Len Brown
b3899c6613 Pull acpica into release branch 2006-06-15 15:19:48 -04:00
Alexey Starikovskiy
b8d35192c5 ACPI: execute Notify() handlers on new thread
http://bugzilla.kernel.org/show_bug.cgi?id=5534

Thanks to Peter Wainwright for isolating the issue.
Thanks to Andi Kleen and Bob Moore for feedback.
Thanks to Richard Mace and others for testing.
Updates by Konstantin Karasyov.

Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-14 02:43:23 -04:00
Rich Townsend
f9a6ee1afb ACPI: replace spin_lock_irq with mutex for ec poll mode
http://bugzilla.kernel.org/show_bug.cgi?id=5764

Signed-off-by: Luming Yu <luming.yu@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-05-19 00:49:52 -04:00
Jiri Slaby
ff2fc3e9e3 ACPI: EC acpi-ecdt-uid-hack
On some boxes ecdt uid may be equal to 0, so do not test for uids equality,
so that fake handler will be unconditionally removed to allow loading the
real one.

See http://bugzilla.kernel.org/show_bug.cgi?id=6111

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Luming Yu <luming.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-01 22:33:06 -05:00
OGAWA Hirofumi
9b41046cd0 [PATCH] Don't pass boot parameters to argv_init[]
The boot cmdline is parsed in parse_early_param() and
parse_args(,unknown_bootoption).

And __setup() is used in obsolete_checksetup().

	start_kernel()
		-> parse_args()
			-> unknown_bootoption()
				-> obsolete_checksetup()

If __setup()'s callback (->setup_func()) returns 1 in
obsolete_checksetup(), obsolete_checksetup() thinks a parameter was
handled.

If ->setup_func() returns 0, obsolete_checksetup() tries other
->setup_func().  If all ->setup_func() that matched a parameter returns 0,
a parameter is seted to argv_init[].

Then, when runing /sbin/init or init=app, argv_init[] is passed to the app.
If the app doesn't ignore those arguments, it will warning and exit.

This patch fixes a wrong usage of it, however fixes obvious one only.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:53 -08:00
Len Brown
9fdb62af92 [ACPI] merge 3549 4320 4485 4588 4980 5483 5651 acpica asus fops pnpacpi branches into release
Signed-off-by: Len Brown <len.brown@intel.com>
2006-01-24 17:52:48 -05:00
Arjan van de Ven
858119e159 [PATCH] Unlinline a bunch of other functions
Remove the "inline" keyword from a bunch of big functions in the kernel with
the goal of shrinking it by 30kb to 40kb

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-14 18:27:06 -08:00
Bob Moore
50eca3eb89 [ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)

All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".

The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available.  Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)

Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.

acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-12-10 00:20:25 -05:00
Len Brown
1e8df53c92 [ACPI] Embedded Controller (EC) driver printk syntax update
no functional changes

Signed-off-by: Len Brown <len.brown@intel.com>
2005-12-05 16:48:54 -05:00
Len Brown
53f11d4ff8 [ACPI] Enable Embedded Controller (EC) interrupt mode by default
"ec_intr=0" reverts to polling
"ec_burst=" no longer exists.

Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: Luming Yu <luming.yu@intel.com>
2005-12-05 16:47:30 -05:00
Len Brown
02b28a33aa [ACPI] Embedded Controller (EC) driver syntax update
"intr" largely replaces "burst" for syntax to follow semantics
"poll" largely replaces "polling" for economy of expression
append "interrupt mode" or "polling mode" to dmesg line

no functional changes

Signed-off-by: Len Brown <len.brown@intel.com>
2005-12-05 16:37:16 -05:00
Luming Yu
06a2a3855e [ACPI] Disable EC burst mode w/o disabling EC interrupts
Need to de-couple the concept of polling/interrupts
vs burst/non-burst.

http://bugzilla.kernel.org/show_bug.cgi?id=4980

Signed-off-by: Luming Yu <luming.yu@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-12-01 21:00:53 -05:00
Len Brown
eca008c813 [ACPI] handle ACPICA 20050916's acpi_resource.type rename
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-22 00:28:05 -04:00
Len Brown
50526df605 [ACPI] Lindent drivers/acpi/ec.c
necessary for clean merge from acpi-2.6.12 to-akpm

Signed-off-by: Len Brown <len.brown@intel.com>
2005-08-11 17:33:10 -04:00
Luming Yu
716e084edb [ACPI] Fix "ec_burst=1" mode latency issue
http://bugzilla.kernel.org/show_bug.cgi?id=3851

Signed-off-by: Luming Yu <luming.yu@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-08-11 17:30:51 -04:00