Blame view

include/linux/component.h 1.33 KB
2a41e6070   Russell King   drivers/base: pro...
1
2
  #ifndef COMPONENT_H
  #define COMPONENT_H
ce657b1cd   Russell King   component: add su...
3
  #include <linux/stddef.h>
2a41e6070   Russell King   drivers/base: pro...
4
5
6
  struct device;
  
  struct component_ops {
ce657b1cd   Russell King   component: add su...
7
8
9
10
  	int (*bind)(struct device *comp, struct device *master,
  		    void *master_data);
  	void (*unbind)(struct device *comp, struct device *master,
  		       void *master_data);
2a41e6070   Russell King   drivers/base: pro...
11
12
13
14
  };
  
  int component_add(struct device *, const struct component_ops *);
  void component_del(struct device *, const struct component_ops *);
ce657b1cd   Russell King   component: add su...
15
16
  int component_bind_all(struct device *master, void *master_data);
  void component_unbind_all(struct device *master, void *master_data);
2a41e6070   Russell King   drivers/base: pro...
17
18
19
20
  
  struct master;
  
  struct component_master_ops {
ce657b1cd   Russell King   component: add su...
21
22
  	int (*bind)(struct device *master);
  	void (*unbind)(struct device *master);
2a41e6070   Russell King   drivers/base: pro...
23
  };
2a41e6070   Russell King   drivers/base: pro...
24
25
  void component_master_del(struct device *,
  	const struct component_master_ops *);
6955b5825   Russell King   component: add su...
26
27
28
29
  struct component_match;
  
  int component_master_add_with_match(struct device *,
  	const struct component_master_ops *, struct component_match *);
ce657b1cd   Russell King   component: add su...
30
31
32
  void component_match_add_release(struct device *master,
  	struct component_match **matchptr,
  	void (*release)(struct device *, void *),
6955b5825   Russell King   component: add su...
33
  	int (*compare)(struct device *, void *), void *compare_data);
ce657b1cd   Russell King   component: add su...
34
35
36
37
38
39
40
  static inline void component_match_add(struct device *master,
  	struct component_match **matchptr,
  	int (*compare)(struct device *, void *), void *compare_data)
  {
  	component_match_add_release(master, matchptr, NULL, compare,
  				    compare_data);
  }
2a41e6070   Russell King   drivers/base: pro...
41
  #endif