Eric Miao | f7426f5 | 2010-07-15 22:18:32 +0800 | [diff] [blame] | 1 | #ifndef __MACH_DEVICE_H |
| 2 | #define __MACH_DEVICE_H |
| 3 | |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
| 6 | #define MAX_RESOURCE_DMA 2 |
| 7 | |
| 8 | /* structure for describing the on-chip devices */ |
| 9 | struct pxa_device_desc { |
| 10 | const char *dev_name; |
| 11 | const char *drv_name; |
| 12 | int id; |
| 13 | int irq; |
| 14 | unsigned long start; |
| 15 | unsigned long size; |
| 16 | int dma[MAX_RESOURCE_DMA]; |
| 17 | }; |
| 18 | |
| 19 | #define PXA168_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \ |
| 20 | struct pxa_device_desc pxa168_device_##_name __initdata = { \ |
| 21 | .dev_name = "pxa168-" #_name, \ |
| 22 | .drv_name = _drv, \ |
| 23 | .id = _id, \ |
| 24 | .irq = IRQ_PXA168_##_irq, \ |
| 25 | .start = _start, \ |
| 26 | .size = _size, \ |
| 27 | .dma = { _dma }, \ |
| 28 | }; |
| 29 | |
Eric Miao | 14c6b5e | 2009-03-20 12:50:22 +0800 | [diff] [blame] | 30 | #define PXA910_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \ |
| 31 | struct pxa_device_desc pxa910_device_##_name __initdata = { \ |
| 32 | .dev_name = "pxa910-" #_name, \ |
| 33 | .drv_name = _drv, \ |
| 34 | .id = _id, \ |
| 35 | .irq = IRQ_PXA910_##_irq, \ |
| 36 | .start = _start, \ |
| 37 | .size = _size, \ |
| 38 | .dma = { _dma }, \ |
| 39 | }; |
Haojian Zhuang | 2f7e8fa | 2009-12-04 09:41:28 -0500 | [diff] [blame] | 40 | |
| 41 | #define MMP2_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \ |
| 42 | struct pxa_device_desc mmp2_device_##_name __initdata = { \ |
| 43 | .dev_name = "mmp2-" #_name, \ |
| 44 | .drv_name = _drv, \ |
| 45 | .id = _id, \ |
| 46 | .irq = IRQ_MMP2_##_irq, \ |
| 47 | .start = _start, \ |
| 48 | .size = _size, \ |
| 49 | .dma = { _dma }, \ |
| 50 | } |
| 51 | |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 52 | extern int pxa_register_device(struct pxa_device_desc *, void *, size_t); |
Eric Miao | f7426f5 | 2010-07-15 22:18:32 +0800 | [diff] [blame] | 53 | #endif /* __MACH_DEVICE_H */ |