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