RFC [PATCH] acpi: allow SMBus access

Johan Vromans
2006-07-02T21:12:23Z

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