aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc/of_device.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-ppc/of_device.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-ppc/of_device.h')
-rw-r--r--include/asm-ppc/of_device.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/include/asm-ppc/of_device.h b/include/asm-ppc/of_device.h
new file mode 100644
index 000000000000..14441c629010
--- /dev/null
+++ b/include/asm-ppc/of_device.h
@@ -0,0 +1,74 @@
1#ifndef __OF_DEVICE_H__
2#define __OF_DEVICE_H__
3
4#include <linux/device.h>
5#include <asm/prom.h>
6
7/*
8 * The of_platform_bus_type is a bus type used by drivers that do not
9 * attach to a macio or similar bus but still use OF probing
10 * mecanism
11 */
12extern struct bus_type of_platform_bus_type;
13
14/*
15 * The of_device is a kind of "base class" that is a superset of
16 * struct device for use by devices attached to an OF node and
17 * probed using OF properties
18 */
19struct of_device
20{
21 struct device_node *node; /* OF device node */
22 u64 dma_mask; /* DMA mask */
23 struct device dev; /* Generic device interface */
24};
25#define to_of_device(d) container_of(d, struct of_device, dev)
26
27/*
28 * Struct used for matching a device
29 */
30struct of_match
31{
32 char *name;
33 char *type;
34 char *compatible;
35 void *data;
36};
37#define OF_ANY_MATCH ((char *)-1L)
38
39extern const struct of_match *of_match_device(
40 const struct of_match *matches, const struct of_device *dev);
41
42extern struct of_device *of_dev_get(struct of_device *dev);
43extern void of_dev_put(struct of_device *dev);
44
45/*
46 * An of_platform_driver driver is attached to a basic of_device on
47 * the "platform bus" (of_platform_bus_type)
48 */
49struct of_platform_driver
50{
51 char *name;
52 struct of_match *match_table;
53 struct module *owner;
54
55 int (*probe)(struct of_device* dev, const struct of_match *match);
56 int (*remove)(struct of_device* dev);
57
58 int (*suspend)(struct of_device* dev, u32 state);
59 int (*resume)(struct of_device* dev);
60 int (*shutdown)(struct of_device* dev);
61
62 struct device_driver driver;
63};
64#define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver)
65
66extern int of_register_driver(struct of_platform_driver *drv);
67extern void of_unregister_driver(struct of_platform_driver *drv);
68extern int of_device_register(struct of_device *ofdev);
69extern void of_device_unregister(struct of_device *ofdev);
70extern struct of_device *of_platform_device_create(struct device_node *np, const char *bus_id);
71extern void of_release_dev(struct device *dev);
72
73#endif /* __OF_DEVICE_H__ */
74