device.h 947 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Arch specific extensions to struct device
  3. *
  4. * This file is released under the GPLv2
  5. */
  6. #ifndef _ASM_POWERPC_DEVICE_H
  7. #define _ASM_POWERPC_DEVICE_H
  8. struct dma_map_ops;
  9. struct device_node;
  10. struct dev_archdata {
  11. /* Optional pointer to an OF device node */
  12. struct device_node *of_node;
  13. /* DMA operations on that device */
  14. struct dma_map_ops *dma_ops;
  15. /*
  16. * When an iommu is in use, dma_data is used as a ptr to the base of the
  17. * iommu_table. Otherwise, it is a simple numerical offset.
  18. */
  19. union {
  20. dma_addr_t dma_offset;
  21. void *iommu_table_base;
  22. } dma_data;
  23. #ifdef CONFIG_SWIOTLB
  24. dma_addr_t max_direct_dma_addr;
  25. #endif
  26. };
  27. static inline void dev_archdata_set_node(struct dev_archdata *ad,
  28. struct device_node *np)
  29. {
  30. ad->of_node = np;
  31. }
  32. static inline struct device_node *
  33. dev_archdata_get_node(const struct dev_archdata *ad)
  34. {
  35. return ad->of_node;
  36. }
  37. struct pdev_archdata {
  38. };
  39. #endif /* _ASM_POWERPC_DEVICE_H */