rt_driver.h 701 B

123456789101112131415161718192021222324252627282930313233
  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. #ifdef RT_USING_DEVICE_OPS
  13. const struct rt_device_ops *dev_ops;
  14. #endif
  15. const struct filesystem_ops *fops;
  16. const char *name;
  17. enum rt_device_class_type dev_type;
  18. int device_priv_data_size;
  19. int device_size;
  20. int flag;
  21. const struct rt_device_id *dev_match;
  22. int (*probe)(struct rt_device *dev);
  23. int (*init)(struct rt_device *dev);
  24. int (*remove)(struct rt_device *dev);
  25. const void *ops; /* driver-specific operations */
  26. };
  27. typedef struct rt_driver *rt_driver_t;
  28. #endif