Blame view

include/linux/of_device.h 1.82 KB
f898f8dbc   Stephen Rothwell   Begin consolidati...
1
2
  #ifndef _LINUX_OF_DEVICE_H
  #define _LINUX_OF_DEVICE_H
f898f8dbc   Stephen Rothwell   Begin consolidati...
3

f9f5a4669   Grant Likely   of/device: Move s...
4
  #include <linux/platform_device.h>
295960429   Grant Likely   of: remove asm/of...
5
  #include <linux/of_platform.h> /* temporary until merge */
b505ff5e7   Grant Likely   of: kill struct o...
6

f9f5a4669   Grant Likely   of/device: Move s...
7
8
9
10
  #ifdef CONFIG_OF_DEVICE
  #include <linux/device.h>
  #include <linux/of.h>
  #include <linux/mod_devicetable.h>
f898f8dbc   Stephen Rothwell   Begin consolidati...
11

f898f8dbc   Stephen Rothwell   Begin consolidati...
12
  extern const struct of_device_id *of_match_device(
44504b2be   Grant Likely   of: change of_mat...
13
  	const struct of_device_id *matches, const struct device *dev);
c66012253   Grant Likely   of/device: Make o...
14
  extern void of_device_make_bus_id(struct device *dev);
f898f8dbc   Stephen Rothwell   Begin consolidati...
15

8cec0e7b4   Grant Likely   of/device: Add OF...
16
17
18
19
20
  /**
   * of_driver_match_device - Tell if a driver's of_match_table matches a device.
   * @drv: the device_driver structure to test
   * @dev: the device structure to match against
   */
b826291c1   Grant Likely   drivercore/dt: ad...
21
  static inline int of_driver_match_device(struct device *dev,
8cec0e7b4   Grant Likely   of/device: Add OF...
22
23
  					 const struct device_driver *drv)
  {
b1608d69c   Grant Likely   drivercore: rever...
24
  	return of_match_device(drv->of_match_table, dev) != NULL;
8cec0e7b4   Grant Likely   of/device: Add OF...
25
  }
94a0cb1fc   Grant Likely   of/device: Replac...
26
27
  extern struct platform_device *of_dev_get(struct platform_device *dev);
  extern void of_dev_put(struct platform_device *dev);
f898f8dbc   Stephen Rothwell   Begin consolidati...
28

7096d0422   Grant Likely   of/device: Rework...
29
  extern int of_device_add(struct platform_device *pdev);
94a0cb1fc   Grant Likely   of/device: Replac...
30
31
  extern int of_device_register(struct platform_device *ofdev);
  extern void of_device_unregister(struct platform_device *ofdev);
fec738dd4   Joachim Fenkes   [POWERPC] Move of...
32

34a1c1e8c   Grant Likely   of: Modify of_dev...
33
  extern ssize_t of_device_get_modalias(struct device *dev,
09e67ca2c   Stephen Rothwell   [POWERPC] Move of...
34
  					char *str, ssize_t len);
dd27dcda3   Grant Likely   of/device: merge ...
35
36
  
  extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
7096d0422   Grant Likely   of/device: Rework...
37
38
39
40
  static inline void of_device_node_put(struct device *dev)
  {
  	of_node_put(dev->of_node);
  }
dd27dcda3   Grant Likely   of/device: merge ...
41

8cec0e7b4   Grant Likely   of/device: Add OF...
42
43
44
45
46
47
48
  #else /* CONFIG_OF_DEVICE */
  
  static inline int of_driver_match_device(struct device *dev,
  					 struct device_driver *drv)
  {
  	return 0;
  }
eca393016   Grant Likely   of: Merge of_plat...
49
50
51
52
53
  static inline int of_device_uevent(struct device *dev,
  				   struct kobj_uevent_env *env)
  {
  	return -ENODEV;
  }
7096d0422   Grant Likely   of/device: Rework...
54
  static inline void of_device_node_put(struct device *dev) { }
b1608d69c   Grant Likely   drivercore: rever...
55
56
57
58
59
  static inline const struct of_device_id *of_match_device(
  		const struct of_device_id *matches, const struct device *dev)
  {
  	return NULL;
  }
efb2e014f   Grant Likely   of: protect conte...
60
  #endif /* CONFIG_OF_DEVICE */
09e67ca2c   Stephen Rothwell   [POWERPC] Move of...
61

f898f8dbc   Stephen Rothwell   Begin consolidati...
62
  #endif /* _LINUX_OF_DEVICE_H */