Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / arch / arm / mach-mmp / include / mach / mmp2.h
blob0764f4ecec821e4050d180031896c2e2f0292b80
1 #ifndef __ASM_MACH_MMP2_H
2 #define __ASM_MACH_MMP2_H
4 #include <linux/platform_data/pxa_sdhci.h>
6 extern void mmp2_timer_init(void);
7 extern void __init mmp2_init_icu(void);
8 extern void __init mmp2_init_irq(void);
9 extern void mmp2_clear_pmic_int(void);
11 #include <linux/i2c.h>
12 #include <linux/i2c/pxa-i2c.h>
13 #include <mach/devices.h>
14 #include <linux/platform_data/dma-mmp_tdma.h>
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;
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;
30 extern struct pxa_device_desc mmp2_device_asram;
31 extern struct pxa_device_desc mmp2_device_isram;
33 extern struct platform_device mmp2_device_gpio;
35 static inline int mmp2_add_uart(int id)
37 struct pxa_device_desc *d = NULL;
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;
48 return pxa_register_device(d, NULL, 0);
51 static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data,
52 struct i2c_board_info *info, unsigned size)
54 struct pxa_device_desc *d = NULL;
55 int ret;
57 switch (id) {
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;
64 default:
65 return -EINVAL;
68 ret = i2c_register_board_info(id - 1, info, size);
69 if (ret)
70 return ret;
72 return pxa_register_device(d, data, sizeof(*data));
75 static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data)
77 struct pxa_device_desc *d = NULL;
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;
88 return pxa_register_device(d, data, sizeof(*data));
91 static inline int mmp2_add_asram(struct sram_platdata *data)
93 return pxa_register_device(&mmp2_device_asram, data, sizeof(*data));
96 static inline int mmp2_add_isram(struct sram_platdata *data)
98 return pxa_register_device(&mmp2_device_isram, data, sizeof(*data));
101 #endif /* __ASM_MACH_MMP2_H */