devices.h 1.5 KB

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