public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RFC [PATCH] acpi: allow SMBus access
@ 2006-07-02 21:12 Johan Vromans
  2006-07-03  1:51 ` Yu Luming
  2006-07-03  8:22 ` Bruno Ducrot
  0 siblings, 2 replies; 10+ messages in thread
From: Johan Vromans @ 2006-07-02 21:12 UTC (permalink / raw)
  To: linux-kernel, linux-acpi

From: Johan Vromans <jvromans@squirrel.nl>

To get battery readings on some laptops it is necessary to interface
with the SMBus that hangs of the EC. However, the current
implementation of the EC driver does not permit other modules
read/write access.

A trivial solution is to change acpi_ec_read/write from static to
nonstatic, and export the symbols so other modules can use them.

This patch is based on the current 2.6.17 kernel sources.

Signed-off-by: Johan Vromans <jvromans@squirrel.nl>
---

--- linux-2.6.17.i686/drivers/acpi/ec.c.orig	2006-07-02 22:46:35.000000000 +0200
+++ linux-2.6.17.i686/drivers/acpi/ec.c	2006-06-27 10:03:19.000000000 +0200
@@ -305,20 +305,22 @@ end:
 }
 #endif /* ACPI_FUTURE_USAGE */
 
-static int acpi_ec_read(union acpi_ec *ec, u8 address, u32 * data)
+int acpi_ec_read(union acpi_ec *ec, u8 address, u32 * data)
 {
 	if (acpi_ec_poll_mode)
 		return acpi_ec_poll_read(ec, address, data);
 	else
 		return acpi_ec_intr_read(ec, address, data);
 }
-static int acpi_ec_write(union acpi_ec *ec, u8 address, u8 data)
+EXPORT_SYMBOL(acpi_ec_read);
+int acpi_ec_write(union acpi_ec *ec, u8 address, u8 data)
 {
 	if (acpi_ec_poll_mode)
 		return acpi_ec_poll_write(ec, address, data);
 	else
 		return acpi_ec_intr_write(ec, address, data);
 }
+EXPORT_SYMBOL(acpi_ec_write);
 static int acpi_ec_poll_read(union acpi_ec *ec, u8 address, u32 * data)
 {
 	acpi_status status = AE_OK;

-- 
Johan

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-07-06 13:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-02 21:12 RFC [PATCH] acpi: allow SMBus access Johan Vromans
2006-07-03  1:51 ` Yu Luming
2006-07-03  8:22   ` Bruno Ducrot
2006-07-03  8:22 ` Bruno Ducrot
2006-07-03 11:14   ` Johan Vromans
2006-07-03 12:51     ` Bruno Ducrot
2006-07-04  8:09       ` Johan Vromans
2006-07-04  9:35         ` Bruno Ducrot
2006-07-04 11:44           ` Johan Vromans
2006-07-06 13:58             ` Johan Vromans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox