aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp/include/mach/pxa910.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mmp/include/mach/pxa910.h')
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h44
1 files changed, 44 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..6ae1ed7a0a9f 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -1,10 +1,18 @@
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
6extern struct pxa_device_desc pxa910_device_uart1; 8extern struct pxa_device_desc pxa910_device_uart1;
7extern struct pxa_device_desc pxa910_device_uart2; 9extern struct pxa_device_desc pxa910_device_uart2;
10extern struct pxa_device_desc pxa910_device_twsi0;
11extern struct pxa_device_desc pxa910_device_twsi1;
12extern struct pxa_device_desc pxa910_device_pwm1;
13extern struct pxa_device_desc pxa910_device_pwm2;
14extern struct pxa_device_desc pxa910_device_pwm3;
15extern struct pxa_device_desc pxa910_device_pwm4;
8 16
9static inline int pxa910_add_uart(int id) 17static inline int pxa910_add_uart(int id)
10{ 18{
@@ -20,4 +28,40 @@ static inline int pxa910_add_uart(int id)
20 28
21 return pxa_register_device(d, NULL, 0); 29 return pxa_register_device(d, NULL, 0);
22} 30}
31
32static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
33 struct i2c_board_info *info, unsigned size)
34{
35 struct pxa_device_desc *d = NULL;
36 int ret;
37
38 switch (id) {
39 case 0: d = &pxa910_device_twsi0; break;
40 case 1: d = &pxa910_device_twsi1; break;
41 default:
42 return -EINVAL;
43 }
44
45 ret = i2c_register_board_info(id, info, size);
46 if (ret)
47 return ret;
48
49 return pxa_register_device(d, data, sizeof(*data));
50}
51
52static inline int pxa910_add_pwm(int id)
53{
54 struct pxa_device_desc *d = NULL;
55
56 switch (id) {
57 case 1: d = &pxa910_device_pwm1; break;
58 case 2: d = &pxa910_device_pwm2; break;
59 case 3: d = &pxa910_device_pwm3; break;
60 case 4: d = &pxa910_device_pwm4; break;
61 default:
62 return -EINVAL;
63 }
64
65 return pxa_register_device(d, NULL, 0);
66}
23#endif /* __ASM_MACH_PXA910_H */ 67#endif /* __ASM_MACH_PXA910_H */