component.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef COMPONENT_H
  2. #define COMPONENT_H
  3. struct device;
  4. struct component_ops {
  5. int (*bind)(struct device *, struct device *, void *);
  6. void (*unbind)(struct device *, struct device *, void *);
  7. };
  8. int component_add(struct device *, const struct component_ops *);
  9. void component_del(struct device *, const struct component_ops *);
  10. int component_bind_all(struct device *, void *);
  11. void component_unbind_all(struct device *, void *);
  12. struct master;
  13. struct component_master_ops {
  14. int (*add_components)(struct device *, struct master *);
  15. int (*bind)(struct device *);
  16. void (*unbind)(struct device *);
  17. };
  18. int component_master_add(struct device *, const struct component_master_ops *);
  19. void component_master_del(struct device *,
  20. const struct component_master_ops *);
  21. int component_master_add_child(struct master *master,
  22. int (*compare)(struct device *, void *), void *compare_data);
  23. struct component_match;
  24. int component_master_add_with_match(struct device *,
  25. const struct component_master_ops *, struct component_match *);
  26. void component_match_add(struct device *, struct component_match **,
  27. int (*compare)(struct device *, void *), void *compare_data);
  28. #endif