Re: SMBus access
From: Randy.Dunlap
Date: Sat Jul 01 2006 - 17:06:02 EST
On Sat, 01 Jul 2006 22:57:34 +0200 Johan Vromans wrote:
> 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.
>
> Would there be any objections to apply this change?
a. patch should also be sent to linux-acpi@xxxxxxxxxxxxxxx (cc-ed)
b. patch does not apply cleanly to latest kernel
c. missing Signed-off-by: line (see Documentation/SubmittingPatches)
d. incorrect patch filename directory level (see SubmittingPatches)
> -- Johan
>
> --- drivers/acpi/ec.c~ 2006-04-17 13:40:49.000000000 +0200
> +++ drivers/acpi/ec.c 2006-04-22 17:49:13.000000000 +0200
> @@ -305,20 +305,22 @@
> }
> #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;
> -
---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/