devices.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef __MACH_DEVICE_H
  2. #define __MACH_DEVICE_H
  3. #include <linux/types.h>
  4. #define MAX_RESOURCE_DMA 2
  5. /* structure for describing the on-chip devices */
  6. struct pxa_device_desc {
  7. const char *dev_name;
  8. const char *drv_name;
  9. int id;
  10. int irq;
  11. unsigned long start;
  12. unsigned long size;
  13. int dma[MAX_RESOURCE_DMA];
  14. };
  15. #define PXA168_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
  16. struct pxa_device_desc pxa168_device_##_name __initdata = { \
  17. .dev_name = "pxa168-" #_name, \
  18. .drv_name = _drv, \
  19. .id = _id, \
  20. .irq = IRQ_PXA168_##_irq, \
  21. .start = _start, \
  22. .size = _size, \
  23. .dma = { _dma }, \
  24. };
  25. #define PXA910_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
  26. struct pxa_device_desc pxa910_device_##_name __initdata = { \
  27. .dev_name = "pxa910-" #_name, \
  28. .drv_name = _drv, \
  29. .id = _id, \
  30. .irq = IRQ_PXA910_##_irq, \
  31. .start = _start, \
  32. .size = _size, \
  33. .dma = { _dma }, \
  34. };
  35. #define MMP2_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
  36. struct pxa_device_desc mmp2_device_##_name __initdata = { \
  37. .dev_name = "mmp2-" #_name, \
  38. .drv_name = _drv, \
  39. .id = _id, \
  40. .irq = IRQ_MMP2_##_irq, \
  41. .start = _start, \
  42. .size = _size, \
  43. .dma = { _dma }, \
  44. }
  45. extern int pxa_register_device(struct pxa_device_desc *, void *, size_t);
  46. extern int pxa_usb_phy_init(void __iomem *phy_reg);
  47. extern void pxa_usb_phy_deinit(void __iomem *phy_reg);
  48. #endif /* __MACH_DEVICE_H */