blob: 4df596c5c201acd21c09f5cd24d71c41a97426c9 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Eric Miaof7426f52010-07-15 22:18:32 +08002#ifndef __MACH_DEVICE_H
3#define __MACH_DEVICE_H
4
Eric Miao49cbe782009-01-20 14:15:18 +08005#include <linux/types.h>
6
7#define MAX_RESOURCE_DMA 2
8
9/* structure for describing the on-chip devices */
10struct 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...) \
21struct 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 Miao14c6b5e2009-03-20 12:50:22 +080031#define PXA910_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
32struct 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 Zhuang2f7e8fa2009-12-04 09:41:28 -050041
42#define MMP2_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
43struct 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 Miao49cbe782009-01-20 14:15:18 +080053extern int pxa_register_device(struct pxa_device_desc *, void *, size_t);
Neil Zhang75b1bdf2012-05-03 14:19:13 +080054extern int pxa_usb_phy_init(void __iomem *phy_reg);
55extern void pxa_usb_phy_deinit(void __iomem *phy_reg);
56
Eric Miaof7426f52010-07-15 22:18:32 +080057#endif /* __MACH_DEVICE_H */