blob: 6ae2b26abbf7c2207512029dd153080629013af7 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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_
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/kobject.h>
16#include <linux/pm.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080017
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080018struct sys_device;
Ben Cheng4b29af02012-03-07 16:14:53 -080019
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080020struct sysdev_class {
21 struct list_head drivers;
Ben Cheng4b29af02012-03-07 16:14:53 -080022
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080023 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};
Ben Cheng4b29af02012-03-07 16:14:53 -080028
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029struct 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};
Ben Cheng4b29af02012-03-07 16:14:53 -080034
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) struct sysdev_class_attribute attr_##_name = { .attr = {.name = __stringify(_name), .mode = _mode }, .show = _show, .store = _store, };
Ben Cheng4b29af02012-03-07 16:14:53 -080036
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037struct 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};
Ben Cheng4b29af02012-03-07 16:14:53 -080045
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080046struct sys_device {
47 u32 id;
48 struct sysdev_class * cls;
49 struct kobject kobj;
50};
Ben Cheng4b29af02012-03-07 16:14:53 -080051
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080052struct 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};
Ben Cheng4b29af02012-03-07 16:14:53 -080057
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080058#define SYSDEV_ATTR(_name,_mode,_show,_store) struct sysdev_attribute attr_##_name = { .attr = {.name = __stringify(_name), .mode = _mode }, .show = _show, .store = _store, };
Ben Cheng4b29af02012-03-07 16:14:53 -080059
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080060#endif