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