spi-topcliff-pch: Fix issue for transmitting over 4KByte
[zen-stable.git] / arch / arm / mach-mmp / include / mach / mmp2.h
blobcba22fed2265b431737a5f08cae7055133d52dc5
1 #ifndef __ASM_MACH_MMP2_H
2 #define __ASM_MACH_MMP2_H
4 #include <linux/platform_data/pxa_sdhci.h>
6 struct sys_timer;
8 extern struct sys_timer mmp2_timer;
9 extern void __init mmp2_init_icu(void);
10 extern void __init mmp2_init_irq(void);
11 extern void mmp2_clear_pmic_int(void);
13 #include <linux/i2c.h>
14 #include <linux/i2c/pxa-i2c.h>
15 #include <mach/devices.h>
16 #include <mach/sram.h>
18 extern struct pxa_device_desc mmp2_device_uart1;
19 extern struct pxa_device_desc mmp2_device_uart2;
20 extern struct pxa_device_desc mmp2_device_uart3;
21 extern struct pxa_device_desc mmp2_device_uart4;
22 extern struct pxa_device_desc mmp2_device_twsi1;
23 extern struct pxa_device_desc mmp2_device_twsi2;
24 extern struct pxa_device_desc mmp2_device_twsi3;
25 extern struct pxa_device_desc mmp2_device_twsi4;
26 extern struct pxa_device_desc mmp2_device_twsi5;
27 extern struct pxa_device_desc mmp2_device_twsi6;
28 extern struct pxa_device_desc mmp2_device_sdh0;
29 extern struct pxa_device_desc mmp2_device_sdh1;
30 extern struct pxa_device_desc mmp2_device_sdh2;
31 extern struct pxa_device_desc mmp2_device_sdh3;
32 extern struct pxa_device_desc mmp2_device_asram;
33 extern struct pxa_device_desc mmp2_device_isram;
35 extern struct platform_device mmp2_device_gpio;
37 static inline int mmp2_add_uart(int id)
39 struct pxa_device_desc *d = NULL;
41 switch (id) {
42 case 1: d = &mmp2_device_uart1; break;
43 case 2: d = &mmp2_device_uart2; break;
44 case 3: d = &mmp2_device_uart3; break;
45 case 4: d = &mmp2_device_uart4; break;
46 default:
47 return -EINVAL;
50 return pxa_register_device(d, NULL, 0);
53 static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data,
54 struct i2c_board_info *info, unsigned size)
56 struct pxa_device_desc *d = NULL;
57 int ret;
59 switch (id) {
60 case 1: d = &mmp2_device_twsi1; break;
61 case 2: d = &mmp2_device_twsi2; break;
62 case 3: d = &mmp2_device_twsi3; break;
63 case 4: d = &mmp2_device_twsi4; break;
64 case 5: d = &mmp2_device_twsi5; break;
65 case 6: d = &mmp2_device_twsi6; break;
66 default:
67 return -EINVAL;
70 ret = i2c_register_board_info(id - 1, info, size);
71 if (ret)
72 return ret;
74 return pxa_register_device(d, data, sizeof(*data));
77 static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data)
79 struct pxa_device_desc *d = NULL;
81 switch (id) {
82 case 0: d = &mmp2_device_sdh0; break;
83 case 1: d = &mmp2_device_sdh1; break;
84 case 2: d = &mmp2_device_sdh2; break;
85 case 3: d = &mmp2_device_sdh3; break;
86 default:
87 return -EINVAL;
90 return pxa_register_device(d, data, sizeof(*data));
93 static inline int mmp2_add_asram(struct sram_platdata *data)
95 return pxa_register_device(&mmp2_device_asram, data, sizeof(*data));
98 static inline int mmp2_add_isram(struct sram_platdata *data)
100 return pxa_register_device(&mmp2_device_isram, data, sizeof(*data));
103 #endif /* __ASM_MACH_MMP2_H */