diff options
| author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-04-24 10:48:14 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2007-04-25 02:00:27 -0400 |
| commit | 7252374a39d794879f5e47bcfa0a16e7599b27b5 (patch) | |
| tree | f6a0801099b74b9d78ea1240d725b7aa2f6c6a0b /drivers/misc/thinkpad_acpi.h | |
| parent | 176750d68801bfa4a88d1cf54174aa0347d7e5d8 (diff) | |
ACPI: thinkpad-acpi: add infrastructure for the sysfs device attributes
Add infrastructure to deal with sysfs attributes and grouping, and helpers
for common sysfs parsing. Switch driver attributes to use them.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.h')
| -rw-r--r-- | drivers/misc/thinkpad_acpi.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 37860582956f..84fdefe0d200 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h | |||
| @@ -134,6 +134,27 @@ static int dispatch_procfs_write(struct file *file, | |||
| 134 | unsigned long count, void *data); | 134 | unsigned long count, void *data); |
| 135 | static char *next_cmd(char **cmds); | 135 | static char *next_cmd(char **cmds); |
| 136 | 136 | ||
| 137 | /* sysfs support */ | ||
| 138 | struct attribute_set { | ||
| 139 | unsigned int members, max_members; | ||
| 140 | struct attribute_group group; | ||
| 141 | }; | ||
| 142 | |||
| 143 | static struct attribute_set *create_attr_set(unsigned int max_members, | ||
| 144 | const char* name); | ||
| 145 | #define destroy_attr_set(_set) \ | ||
| 146 | kfree(_set); | ||
| 147 | static int add_to_attr_set(struct attribute_set* s, struct attribute *attr); | ||
| 148 | static int add_many_to_attr_set(struct attribute_set* s, | ||
| 149 | struct attribute **attr, | ||
| 150 | unsigned int count); | ||
| 151 | #define register_attr_set_with_sysfs(_attr_set, _kobj) \ | ||
| 152 | sysfs_create_group(_kobj, &_attr_set->group) | ||
| 153 | static void delete_attr_set(struct attribute_set* s, struct kobject *kobj); | ||
| 154 | |||
| 155 | static int parse_strtoul(const char *buf, unsigned long max, | ||
| 156 | unsigned long *value); | ||
| 157 | |||
| 137 | /* Device model */ | 158 | /* Device model */ |
| 138 | static struct platform_device *tpacpi_pdev; | 159 | static struct platform_device *tpacpi_pdev; |
| 139 | static struct class_device *tpacpi_hwmon; | 160 | static struct class_device *tpacpi_hwmon; |
