module.h 700 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Greybus Module code
  3. *
  4. * Copyright 2016 Google Inc.
  5. * Copyright 2016 Linaro Ltd.
  6. *
  7. * Released under the GPLv2 only.
  8. */
  9. #ifndef __MODULE_H
  10. #define __MODULE_H
  11. struct gb_module {
  12. struct device dev;
  13. struct gb_host_device *hd;
  14. struct list_head hd_node;
  15. u8 module_id;
  16. size_t num_interfaces;
  17. bool disconnected;
  18. struct gb_interface *interfaces[0];
  19. };
  20. #define to_gb_module(d) container_of(d, struct gb_module, dev)
  21. struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
  22. size_t num_interfaces);
  23. int gb_module_add(struct gb_module *module);
  24. void gb_module_del(struct gb_module *module);
  25. void gb_module_put(struct gb_module *module);
  26. #endif /* __MODULE_H */