rt_driver.h 714 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __RT_DRIVER_H__
  2. #define __RT_DRIVER_H__
  3. #include <rtdef.h>
  4. #define RT_DRIVER_MATCH_DTS (1<<0)
  5. struct rt_device_id
  6. {
  7. const char *compatible;
  8. void *data;
  9. };
  10. struct rt_driver
  11. {
  12. struct rt_object parent;
  13. #ifdef RT_USING_DEVICE_OPS
  14. const struct rt_device_ops *dev_ops;
  15. #endif
  16. const struct filesystem_ops *fops;
  17. const char *name;
  18. enum rt_device_class_type dev_type;
  19. int device_priv_data_size;
  20. int device_size;
  21. int flag;
  22. int total_device_num;
  23. const struct rt_device_id *dev_match;
  24. int (*probe)(struct rt_device *dev);
  25. int (*init)(struct rt_device *dev);
  26. const void *ops; /* driver-specific operations */
  27. };
  28. typedef struct rt_driver *rt_driver_t;
  29. #endif