-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 202491 b: refs/heads/master c: 1195a09 h: refs/heads/master i: 202489: ac04eca 202487: 074f276 v: v3
- Loading branch information
Thomas Renninger
authored and
Matthew Garrett
committed
Aug 3, 2010
1 parent
c4dfcd4
commit de56d48
Showing
6 changed files
with
101 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: cd89e08fa020f5a882f922e3c9e2628235ca6715 | ||
refs/heads/master: 1195a098168fcacfef1cd80d05358e52fb366bf6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include <linux/kernel.h> | ||
#include <linux/acpi.h> | ||
#include <linux/debugfs.h> | ||
#include "internal.h" | ||
|
||
MODULE_AUTHOR("Thomas Renninger <trenn@suse.de>"); | ||
MODULE_DESCRIPTION("ACPI EC sysfs access driver"); | ||
MODULE_LICENSE("GPL"); | ||
|
||
struct sysdev_class acpi_ec_sysdev_class = { | ||
.name = "ec", | ||
}; | ||
|
||
static struct dentry *acpi_ec_debugfs_dir; | ||
|
||
int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count) | ||
{ | ||
struct dentry *dev_dir; | ||
char name[64]; | ||
if (ec_device_count == 0) { | ||
acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL); | ||
if (!acpi_ec_debugfs_dir) | ||
return -ENOMEM; | ||
} | ||
|
||
sprintf(name, "ec%u", ec_device_count); | ||
dev_dir = debugfs_create_dir(name, acpi_ec_debugfs_dir); | ||
if (!dev_dir) { | ||
if (ec_device_count == 0) | ||
debugfs_remove_recursive(acpi_ec_debugfs_dir); | ||
/* TBD: Proper cleanup for multiple ECs */ | ||
return -ENOMEM; | ||
} | ||
|
||
debugfs_create_x32("gpe", 0444, dev_dir, (u32 *)&first_ec->gpe); | ||
debugfs_create_bool("use_global_lock", 0444, dev_dir, | ||
(u32 *)&first_ec->global_lock); | ||
return 0; | ||
} | ||
|
||
static int __init acpi_ec_sys_init(void) | ||
{ | ||
int err = 0; | ||
if (first_ec) | ||
err = acpi_ec_add_debugfs(first_ec, 0); | ||
else | ||
err = -ENODEV; | ||
return err; | ||
} | ||
|
||
static void __exit acpi_ec_sys_exit(void) | ||
{ | ||
debugfs_remove_recursive(acpi_ec_debugfs_dir); | ||
} | ||
|
||
module_init(acpi_ec_sys_init); | ||
module_exit(acpi_ec_sys_exit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters