Subject: [PATCH] [acpi ec] Add proc interface - Creates "info" file that exports identical information to legacy driver Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/ec/proc.c | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) applies-to: f8483eb27427f621bac8177324e7556ebf2b147d fceb62e5a32590b6997bc784e9536ad391ad92a7 diff --git a/drivers/acpi/drivers/ec/proc.c b/drivers/acpi/drivers/ec/proc.c index c65fb27..88235dd 100644 --- a/drivers/acpi/drivers/ec/proc.c +++ b/drivers/acpi/drivers/ec/proc.c @@ -13,4 +13,33 @@ #include "ec.h" -acpi_driver_proc_none(ec); +static int read_info(struct seq_file *seq, void *offset) +{ + struct acpi_dev * ad = seq->private; + struct acpi_ec * ec = dev_get_drvdata(&ad->dev); + + seq_printf(seq, "gpe bit: 0x%02x\n", + (u32) ec->e_gpe_bit); + seq_printf(seq, "ports: 0x%02x, 0x%02x\n", + (u32) ec->e_status.address, + (u32) ec->e_data.address); + seq_printf(seq, "use global lock: %s\n", + ec->e_global_lock ? "yes" : "no"); + + /* + * Q: Why are we enabling the GPE on every read() ? + */ + acpi_enable_gpe(NULL, ec->e_gpe_bit, ACPI_NOT_ISR); + return 0; +} + +static int open_info(struct inode *inode, struct file *file) +{ + return single_open(file, read_info, PDE(inode)->data); +} + +static struct acpi_proc_file ec_files[] = { + proc_file_ro(info), +}; + +acpi_driver_proc(ec); --- 0.99.9.GIT