| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 2 | **************************************************************************** | 
|  | 3 | *** | 
|  | 4 | ***   This header was automatically generated from a Linux kernel header | 
|  | 5 | ***   of the same name, to make information necessary for userspace to | 
|  | 6 | ***   call into the kernel available to libc.  It contains only constants, | 
|  | 7 | ***   structures, and macros generated from the original header, and thus, | 
|  | 8 | ***   contains no copyrightable information. | 
|  | 9 | *** | 
|  | 10 | **************************************************************************** | 
|  | 11 | ****************************************************************************/ | 
|  | 12 | #ifndef _SYSDEV_H_ | 
|  | 13 | #define _SYSDEV_H_ | 
|  | 14 |  | 
|  | 15 | #include <linux/kobject.h> | 
|  | 16 | #include <linux/pm.h> | 
|  | 17 |  | 
|  | 18 | struct sys_device; | 
|  | 19 |  | 
|  | 20 | struct sysdev_class { | 
|  | 21 | struct list_head drivers; | 
|  | 22 |  | 
|  | 23 | int (*shutdown)(struct sys_device *); | 
|  | 24 | int (*suspend)(struct sys_device *, pm_message_t state); | 
|  | 25 | int (*resume)(struct sys_device *); | 
|  | 26 | struct kset kset; | 
|  | 27 | }; | 
|  | 28 |  | 
|  | 29 | struct sysdev_class_attribute { | 
|  | 30 | struct attribute attr; | 
|  | 31 | ssize_t (*show)(struct sysdev_class *, char *); | 
|  | 32 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | 
|  | 33 | }; | 
|  | 34 |  | 
|  | 35 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)  struct sysdev_class_attribute attr_##_name = {   .attr = {.name = __stringify(_name), .mode = _mode },   .show = _show,   .store = _store,  }; | 
|  | 36 |  | 
|  | 37 | struct sysdev_driver { | 
|  | 38 | struct list_head entry; | 
|  | 39 | int (*add)(struct sys_device *); | 
|  | 40 | int (*remove)(struct sys_device *); | 
|  | 41 | int (*shutdown)(struct sys_device *); | 
|  | 42 | int (*suspend)(struct sys_device *, pm_message_t state); | 
|  | 43 | int (*resume)(struct sys_device *); | 
|  | 44 | }; | 
|  | 45 |  | 
|  | 46 | struct sys_device { | 
|  | 47 | u32 id; | 
|  | 48 | struct sysdev_class * cls; | 
|  | 49 | struct kobject kobj; | 
|  | 50 | }; | 
|  | 51 |  | 
|  | 52 | struct sysdev_attribute { | 
|  | 53 | struct attribute attr; | 
|  | 54 | ssize_t (*show)(struct sys_device *, char *); | 
|  | 55 | ssize_t (*store)(struct sys_device *, const char *, size_t); | 
|  | 56 | }; | 
|  | 57 |  | 
|  | 58 | #define SYSDEV_ATTR(_name,_mode,_show,_store)  struct sysdev_attribute attr_##_name = {   .attr = {.name = __stringify(_name), .mode = _mode },   .show = _show,   .store = _store,  }; | 
|  | 59 |  | 
|  | 60 | #endif |