diff options
Diffstat (limited to 'arch/arm/mach-mmp/include/mach/pxa910.h')
-rw-r--r-- | arch/arm/mach-mmp/include/mach/pxa910.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h index b7aeaf574c36..a0f0cbee1c07 100644 --- a/arch/arm/mach-mmp/include/mach/pxa910.h +++ b/arch/arm/mach-mmp/include/mach/pxa910.h | |||
@@ -1,10 +1,14 @@ | |||
1 | #ifndef __ASM_MACH_PXA910_H | 1 | #ifndef __ASM_MACH_PXA910_H |
2 | #define __ASM_MACH_PXA910_H | 2 | #define __ASM_MACH_PXA910_H |
3 | 3 | ||
4 | #include <linux/i2c.h> | ||
4 | #include <mach/devices.h> | 5 | #include <mach/devices.h> |
6 | #include <plat/i2c.h> | ||
5 | 7 | ||
6 | extern struct pxa_device_desc pxa910_device_uart1; | 8 | extern struct pxa_device_desc pxa910_device_uart1; |
7 | extern struct pxa_device_desc pxa910_device_uart2; | 9 | extern struct pxa_device_desc pxa910_device_uart2; |
10 | extern struct pxa_device_desc pxa910_device_twsi0; | ||
11 | extern struct pxa_device_desc pxa910_device_twsi1; | ||
8 | 12 | ||
9 | static inline int pxa910_add_uart(int id) | 13 | static inline int pxa910_add_uart(int id) |
10 | { | 14 | { |
@@ -20,4 +24,24 @@ static inline int pxa910_add_uart(int id) | |||
20 | 24 | ||
21 | return pxa_register_device(d, NULL, 0); | 25 | return pxa_register_device(d, NULL, 0); |
22 | } | 26 | } |
27 | |||
28 | static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data, | ||
29 | struct i2c_board_info *info, unsigned size) | ||
30 | { | ||
31 | struct pxa_device_desc *d = NULL; | ||
32 | int ret; | ||
33 | |||
34 | switch (id) { | ||
35 | case 0: d = &pxa910_device_twsi0; break; | ||
36 | case 1: d = &pxa910_device_twsi1; break; | ||
37 | default: | ||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | ret = i2c_register_board_info(id, info, size); | ||
42 | if (ret) | ||
43 | return ret; | ||
44 | |||
45 | return pxa_register_device(d, data, sizeof(*data)); | ||
46 | } | ||
23 | #endif /* __ASM_MACH_PXA910_H */ | 47 | #endif /* __ASM_MACH_PXA910_H */ |