Subject: [PATCH] [acpi ec] Add sysfs interface - Add read-only files to export same info as proc interface - gpe - status_port - data_port - global_lock Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/ec/sysfs.c | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) applies-to: d1622257a7ce916baba2ca0cf6c296d24420d675 9189e1eb9f9aab944b623c6f6637d4f04670a3b8 diff --git a/drivers/acpi/drivers/ec/sysfs.c b/drivers/acpi/drivers/ec/sysfs.c index 7d1eb51..7b80bd8 100644 --- a/drivers/acpi/drivers/ec/sysfs.c +++ b/drivers/acpi/drivers/ec/sysfs.c @@ -8,4 +8,35 @@ #include "ec.h" -acpi_driver_sysfs_none(ec); +static ssize_t gpe_show(struct acpi_dev * ad, char * buf) +{ + struct acpi_ec * ec = dev_get_drvdata(&ad->dev); + return sprintf(buf, "%lu\n", ec->e_gpe_bit); +} + +static ssize_t status_port_show(struct acpi_dev * ad, char * buf) +{ + struct acpi_ec * ec = dev_get_drvdata(&ad->dev); + return sprintf(buf, "%#02x\n", (u32)ec->e_status.address); +} + +static ssize_t data_port_show(struct acpi_dev * ad, char * buf) +{ + struct acpi_ec * ec = dev_get_drvdata(&ad->dev); + return sprintf(buf, "%#02x\n", (u32)ec->e_data.address); +} + +static ssize_t global_lock_show(struct acpi_dev * ad, char * buf) +{ + struct acpi_ec * ec = dev_get_drvdata(&ad->dev); + return sprintf(buf, "%01lu\n", ec->e_global_lock); +} + +static struct acpi_dev_attr ec_attrs[] = { + acpi_dev_attr_ro(gpe), + acpi_dev_attr_ro(status_port), + acpi_dev_attr_ro(data_port), + acpi_dev_attr_ro(global_lock), +}; + +acpi_driver_sysfs(ec); --- 0.99.9.GIT