of_device.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _ASM_POWERPC_OF_DEVICE_H
  2. #define _ASM_POWERPC_OF_DEVICE_H
  3. #ifdef __KERNEL__
  4. #include <linux/device.h>
  5. #include <linux/mod_devicetable.h>
  6. #include <asm/prom.h>
  7. /*
  8. * The of_device is a kind of "base class" that is a superset of
  9. * struct device for use by devices attached to an OF node and
  10. * probed using OF properties
  11. */
  12. struct of_device
  13. {
  14. struct device_node *node; /* to be obsoleted */
  15. u64 dma_mask; /* DMA mask */
  16. struct device dev; /* Generic device interface */
  17. };
  18. #define to_of_device(d) container_of(d, struct of_device, dev)
  19. extern const struct of_device_id *of_match_node(
  20. const struct of_device_id *matches, const struct device_node *node);
  21. extern const struct of_device_id *of_match_device(
  22. const struct of_device_id *matches, const struct of_device *dev);
  23. extern struct of_device *of_dev_get(struct of_device *dev);
  24. extern void of_dev_put(struct of_device *dev);
  25. extern int of_device_register(struct of_device *ofdev);
  26. extern void of_device_unregister(struct of_device *ofdev);
  27. extern void of_release_dev(struct device *dev);
  28. extern ssize_t of_device_get_modalias(struct of_device *ofdev,
  29. char *str, ssize_t len);
  30. extern int of_device_uevent(struct device *dev,
  31. char **envp, int num_envp, char *buffer, int buffer_size);
  32. #endif /* __KERNEL__ */
  33. #endif /* _ASM_POWERPC_OF_DEVICE_H */