aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/driver-model
diff options
context:
space:
mode:
authorWanlong Gao <wanlong.gao@gmail.com>2011-05-04 19:55:37 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-06 21:01:05 -0400
commit63dc355a5a8cf296e2b1cc2e4192190dca221129 (patch)
tree6dc32f94ef4bb41197e9dbdd73b416afc16ca874 /Documentation/driver-model
parent880ffb5c6c5c8c8c6efd9efe9355317322b4603b (diff)
driver core: remove the driver-model structures from the documentation
Remove the struct bus_type, class, device, device_driver from the driver-model docs. With another patch add them to device.h, since they are out of date. That will keep things up to date and provide a better way to document this stuff. Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com> Acked-by: Harry Wei <harryxiyou@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation/driver-model')
-rw-r--r--Documentation/driver-model/bus.txt19
-rw-r--r--Documentation/driver-model/class.txt17
-rw-r--r--Documentation/driver-model/device.txt91
-rw-r--r--Documentation/driver-model/driver.txt18
4 files changed, 4 insertions, 141 deletions
diff --git a/Documentation/driver-model/bus.txt b/Documentation/driver-model/bus.txt
index 5001b7511626..6754b2df8aa1 100644
--- a/Documentation/driver-model/bus.txt
+++ b/Documentation/driver-model/bus.txt
@@ -3,24 +3,7 @@ Bus Types
3 3
4Definition 4Definition
5~~~~~~~~~~ 5~~~~~~~~~~
6 6See the kerneldoc for the struct bus_type.
7struct bus_type {
8 char * name;
9
10 struct subsystem subsys;
11 struct kset drivers;
12 struct kset devices;
13
14 struct bus_attribute * bus_attrs;
15 struct device_attribute * dev_attrs;
16 struct driver_attribute * drv_attrs;
17
18 int (*match)(struct device * dev, struct device_driver * drv);
19 int (*hotplug) (struct device *dev, char **envp,
20 int num_envp, char *buffer, int buffer_size);
21 int (*suspend)(struct device * dev, pm_message_t state);
22 int (*resume)(struct device * dev);
23};
24 7
25int bus_register(struct bus_type * bus); 8int bus_register(struct bus_type * bus);
26 9
diff --git a/Documentation/driver-model/class.txt b/Documentation/driver-model/class.txt
index 548505f14aa4..1fefc480a80b 100644
--- a/Documentation/driver-model/class.txt
+++ b/Documentation/driver-model/class.txt
@@ -27,22 +27,7 @@ The device class structure looks like:
27typedef int (*devclass_add)(struct device *); 27typedef int (*devclass_add)(struct device *);
28typedef void (*devclass_remove)(struct device *); 28typedef void (*devclass_remove)(struct device *);
29 29
30struct device_class { 30See the kerneldoc for the struct class.
31 char * name;
32 rwlock_t lock;
33 u32 devnum;
34 struct list_head node;
35
36 struct list_head drivers;
37 struct list_head intf_list;
38
39 struct driver_dir_entry dir;
40 struct driver_dir_entry device_dir;
41 struct driver_dir_entry driver_dir;
42
43 devclass_add add_device;
44 devclass_remove remove_device;
45};
46 31
47A typical device class definition would look like: 32A typical device class definition would look like:
48 33
diff --git a/Documentation/driver-model/device.txt b/Documentation/driver-model/device.txt
index a124f3126b0d..b2ff42685bcb 100644
--- a/Documentation/driver-model/device.txt
+++ b/Documentation/driver-model/device.txt
@@ -2,96 +2,7 @@
2The Basic Device Structure 2The Basic Device Structure
3~~~~~~~~~~~~~~~~~~~~~~~~~~ 3~~~~~~~~~~~~~~~~~~~~~~~~~~
4 4
5struct device { 5See the kerneldoc for the struct device.
6 struct list_head g_list;
7 struct list_head node;
8 struct list_head bus_list;
9 struct list_head driver_list;
10 struct list_head intf_list;
11 struct list_head children;
12 struct device * parent;
13
14 char name[DEVICE_NAME_SIZE];
15 char bus_id[BUS_ID_SIZE];
16
17 spinlock_t lock;
18 atomic_t refcount;
19
20 struct bus_type * bus;
21 struct driver_dir_entry dir;
22
23 u32 class_num;
24
25 struct device_driver *driver;
26 void *driver_data;
27 void *platform_data;
28
29 u32 current_state;
30 unsigned char *saved_state;
31
32 void (*release)(struct device * dev);
33};
34
35Fields
36~~~~~~
37g_list: Node in the global device list.
38
39node: Node in device's parent's children list.
40
41bus_list: Node in device's bus's devices list.
42
43driver_list: Node in device's driver's devices list.
44
45intf_list: List of intf_data. There is one structure allocated for
46 each interface that the device supports.
47
48children: List of child devices.
49
50parent: *** FIXME ***
51
52name: ASCII description of device.
53 Example: " 3Com Corporation 3c905 100BaseTX [Boomerang]"
54
55bus_id: ASCII representation of device's bus position. This
56 field should be a name unique across all devices on the
57 bus type the device belongs to.
58
59 Example: PCI bus_ids are in the form of
60 <bus number>:<slot number>.<function number>
61 This name is unique across all PCI devices in the system.
62
63lock: Spinlock for the device.
64
65refcount: Reference count on the device.
66
67bus: Pointer to struct bus_type that device belongs to.
68
69dir: Device's sysfs directory.
70
71class_num: Class-enumerated value of the device.
72
73driver: Pointer to struct device_driver that controls the device.
74
75driver_data: Driver-specific data.
76
77platform_data: Platform data specific to the device.
78
79 Example: for devices on custom boards, as typical of embedded
80 and SOC based hardware, Linux often uses platform_data to point
81 to board-specific structures describing devices and how they
82 are wired. That can include what ports are available, chip
83 variants, which GPIO pins act in what additional roles, and so
84 on. This shrinks the "Board Support Packages" (BSPs) and
85 minimizes board-specific #ifdefs in drivers.
86
87current_state: Current power state of the device.
88
89saved_state: Pointer to saved state of the device. This is usable by
90 the device driver controlling the device.
91
92release: Callback to free the device after all references have
93 gone away. This should be set by the allocator of the
94 device (i.e. the bus driver that discovered the device).
95 6
96 7
97Programming Interface 8Programming Interface
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index d2cd6fb8ba9e..4421135826a2 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -1,23 +1,7 @@
1 1
2Device Drivers 2Device Drivers
3 3
4struct device_driver { 4See the kerneldoc for the struct device_driver.
5 char * name;
6 struct bus_type * bus;
7
8 struct completion unloaded;
9 struct kobject kobj;
10 list_t devices;
11
12 struct module *owner;
13
14 int (*probe) (struct device * dev);
15 int (*remove) (struct device * dev);
16
17 int (*suspend) (struct device * dev, pm_message_t state);
18 int (*resume) (struct device * dev);
19};
20
21 5
22 6
23Allocation 7Allocation