]>
Commit | Line | Data |
---|---|---|
2f7e8fae HZ |
1 | #ifndef __ASM_MACH_MMP2_H |
2 | #define __ASM_MACH_MMP2_H | |
3 | ||
bfed345e | 4 | #include <linux/platform_data/pxa_sdhci.h> |
5382f419 | 5 | |
6bb27d73 | 6 | extern void mmp2_timer_init(void); |
2728701d EM |
7 | extern void __init mmp2_init_icu(void); |
8 | extern void __init mmp2_init_irq(void); | |
9 | extern void mmp2_clear_pmic_int(void); | |
10 | ||
2f7e8fae | 11 | #include <linux/i2c.h> |
b459396e | 12 | #include <linux/i2c/pxa-i2c.h> |
2f7e8fae | 13 | #include <mach/devices.h> |
293b2da1 | 14 | #include <linux/platform_data/dma-mmp_tdma.h> |
2f7e8fae HZ |
15 | |
16 | extern struct pxa_device_desc mmp2_device_uart1; | |
17 | extern struct pxa_device_desc mmp2_device_uart2; | |
18 | extern struct pxa_device_desc mmp2_device_uart3; | |
19 | extern struct pxa_device_desc mmp2_device_uart4; | |
20 | extern struct pxa_device_desc mmp2_device_twsi1; | |
21 | extern struct pxa_device_desc mmp2_device_twsi2; | |
22 | extern struct pxa_device_desc mmp2_device_twsi3; | |
23 | extern struct pxa_device_desc mmp2_device_twsi4; | |
24 | extern struct pxa_device_desc mmp2_device_twsi5; | |
25 | extern struct pxa_device_desc mmp2_device_twsi6; | |
5382f419 ZG |
26 | extern struct pxa_device_desc mmp2_device_sdh0; |
27 | extern struct pxa_device_desc mmp2_device_sdh1; | |
28 | extern struct pxa_device_desc mmp2_device_sdh2; | |
29 | extern struct pxa_device_desc mmp2_device_sdh3; | |
101bf4c1 | 30 | extern struct pxa_device_desc mmp2_device_asram; |
bca7ab31 | 31 | extern struct pxa_device_desc mmp2_device_isram; |
2f7e8fae | 32 | |
157d2644 HZ |
33 | extern struct platform_device mmp2_device_gpio; |
34 | ||
2f7e8fae HZ |
35 | static inline int mmp2_add_uart(int id) |
36 | { | |
37 | struct pxa_device_desc *d = NULL; | |
38 | ||
39 | switch (id) { | |
40 | case 1: d = &mmp2_device_uart1; break; | |
41 | case 2: d = &mmp2_device_uart2; break; | |
42 | case 3: d = &mmp2_device_uart3; break; | |
43 | case 4: d = &mmp2_device_uart4; break; | |
44 | default: | |
45 | return -EINVAL; | |
46 | } | |
47 | ||
48 | return pxa_register_device(d, NULL, 0); | |
49 | } | |
50 | ||
51 | static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data, | |
52 | struct i2c_board_info *info, unsigned size) | |
53 | { | |
54 | struct pxa_device_desc *d = NULL; | |
55 | int ret; | |
56 | ||
57 | switch (id) { | |
fed24055 HZ |
58 | case 1: d = &mmp2_device_twsi1; break; |
59 | case 2: d = &mmp2_device_twsi2; break; | |
60 | case 3: d = &mmp2_device_twsi3; break; | |
61 | case 4: d = &mmp2_device_twsi4; break; | |
62 | case 5: d = &mmp2_device_twsi5; break; | |
63 | case 6: d = &mmp2_device_twsi6; break; | |
2f7e8fae HZ |
64 | default: |
65 | return -EINVAL; | |
66 | } | |
67 | ||
fed24055 | 68 | ret = i2c_register_board_info(id - 1, info, size); |
2f7e8fae HZ |
69 | if (ret) |
70 | return ret; | |
71 | ||
72 | return pxa_register_device(d, data, sizeof(*data)); | |
73 | } | |
74 | ||
5382f419 ZG |
75 | static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data) |
76 | { | |
77 | struct pxa_device_desc *d = NULL; | |
78 | ||
79 | switch (id) { | |
80 | case 0: d = &mmp2_device_sdh0; break; | |
81 | case 1: d = &mmp2_device_sdh1; break; | |
82 | case 2: d = &mmp2_device_sdh2; break; | |
83 | case 3: d = &mmp2_device_sdh3; break; | |
84 | default: | |
85 | return -EINVAL; | |
86 | } | |
87 | ||
88 | return pxa_register_device(d, data, sizeof(*data)); | |
89 | } | |
90 | ||
101bf4c1 LY |
91 | static inline int mmp2_add_asram(struct sram_platdata *data) |
92 | { | |
93 | return pxa_register_device(&mmp2_device_asram, data, sizeof(*data)); | |
94 | } | |
95 | ||
bca7ab31 LY |
96 | static inline int mmp2_add_isram(struct sram_platdata *data) |
97 | { | |
98 | return pxa_register_device(&mmp2_device_isram, data, sizeof(*data)); | |
99 | } | |
100 | ||
2f7e8fae HZ |
101 | #endif /* __ASM_MACH_MMP2_H */ |
102 |