aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLennart Poettering <mzxreary@0pointer.de>2006-09-05 12:12:24 -0400
committerLen Brown <len.brown@intel.com>2006-10-14 00:49:52 -0400
commitd7a76e4cb3b4469b1eccb6204c053e3ebcd4c196 (patch)
treedb53dad0c84af4741a3888f96bb297ab328db78b /include
parentb4bd8c66435a8cdf8c90334fb3b517a23ff2ab95 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/acpi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 88b5dfd8ee12..2b0c955590fe 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -494,6 +494,9 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
494 494
495extern int ec_read(u8 addr, u8 *val); 495extern int ec_read(u8 addr, u8 *val);
496extern int ec_write(u8 addr, u8 val); 496extern int ec_write(u8 addr, u8 val);
497extern int ec_transaction(u8 command,
498 const u8 *wdata, unsigned wdata_len,
499 u8 *rdata, unsigned rdata_len);
497 500
498#endif /*CONFIG_ACPI_EC*/ 501#endif /*CONFIG_ACPI_EC*/
499 502