1 #ifndef __ASM_MACH_PXA910_H
2 #define __ASM_MACH_PXA910_H
3
4 extern void pxa910_timer_init(void);
5 extern void __init icu_init_irq(void);
6 extern void __init pxa910_init_irq(void);
7
8 #include <linux/i2c.h>
9 #include <linux/i2c/pxa-i2c.h>
10 #include <mach/devices.h>
11 #include <linux/platform_data/mtd-nand-pxa3xx.h>
12 #include <video/mmp_disp.h>
13
14 extern struct pxa_device_desc pxa910_device_uart1;
15 extern struct pxa_device_desc pxa910_device_uart2;
16 extern struct pxa_device_desc pxa910_device_twsi0;
17 extern struct pxa_device_desc pxa910_device_twsi1;
18 extern struct pxa_device_desc pxa910_device_pwm1;
19 extern struct pxa_device_desc pxa910_device_pwm2;
20 extern struct pxa_device_desc pxa910_device_pwm3;
21 extern struct pxa_device_desc pxa910_device_pwm4;
22 extern struct pxa_device_desc pxa910_device_nand;
23 extern struct platform_device pxa168_device_u2o;
24 extern struct platform_device pxa168_device_u2ootg;
25 extern struct platform_device pxa168_device_u2oehci;
26 extern struct pxa_device_desc pxa910_device_disp;
27 extern struct pxa_device_desc pxa910_device_fb;
28 extern struct pxa_device_desc pxa910_device_panel;
29 extern struct platform_device pxa910_device_gpio;
30 extern struct platform_device pxa910_device_rtc;
31
pxa910_add_uart(int id)32 static inline int pxa910_add_uart(int id)
33 {
34 struct pxa_device_desc *d = NULL;
35
36 switch (id) {
37 case 1: d = &pxa910_device_uart1; break;
38 case 2: d = &pxa910_device_uart2; break;
39 }
40
41 if (d == NULL)
42 return -EINVAL;
43
44 return pxa_register_device(d, NULL, 0);
45 }
46
pxa910_add_twsi(int id,struct i2c_pxa_platform_data * data,struct i2c_board_info * info,unsigned size)47 static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
48 struct i2c_board_info *info, unsigned size)
49 {
50 struct pxa_device_desc *d = NULL;
51 int ret;
52
53 switch (id) {
54 case 0: d = &pxa910_device_twsi0; break;
55 case 1: d = &pxa910_device_twsi1; break;
56 default:
57 return -EINVAL;
58 }
59
60 ret = i2c_register_board_info(id, info, size);
61 if (ret)
62 return ret;
63
64 return pxa_register_device(d, data, sizeof(*data));
65 }
66
pxa910_add_pwm(int id)67 static inline int pxa910_add_pwm(int id)
68 {
69 struct pxa_device_desc *d = NULL;
70
71 switch (id) {
72 case 1: d = &pxa910_device_pwm1; break;
73 case 2: d = &pxa910_device_pwm2; break;
74 case 3: d = &pxa910_device_pwm3; break;
75 case 4: d = &pxa910_device_pwm4; break;
76 default:
77 return -EINVAL;
78 }
79
80 return pxa_register_device(d, NULL, 0);
81 }
82
pxa910_add_nand(struct pxa3xx_nand_platform_data * info)83 static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info)
84 {
85 return pxa_register_device(&pxa910_device_nand, info, sizeof(*info));
86 }
87 #endif /* __ASM_MACH_PXA910_H */
88