component.h 896 B

1234567891011121314151617181920212223242526272829303132
  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. #endif