1 #ifndef __ASM_MACH_PXA168_H
2 #define __ASM_MACH_PXA168_H
6 extern struct sys_timer pxa168_timer;
7 extern void __init pxa168_init_irq(void);
8 extern void pxa168_clear_keypad_wakeup(void);
10 #include <linux/i2c.h>
11 #include <linux/i2c/pxa-i2c.h>
12 #include <mach/devices.h>
13 #include <plat/pxa3xx_nand.h>
14 #include <video/pxa168fb.h>
15 #include <plat/pxa27x_keypad.h>
16 #include <mach/cputype.h>
17 #include <linux/pxa168_eth.h>
19 extern struct pxa_device_desc pxa168_device_uart1;
20 extern struct pxa_device_desc pxa168_device_uart2;
21 extern struct pxa_device_desc pxa168_device_uart3;
22 extern struct pxa_device_desc pxa168_device_twsi0;
23 extern struct pxa_device_desc pxa168_device_twsi1;
24 extern struct pxa_device_desc pxa168_device_pwm1;
25 extern struct pxa_device_desc pxa168_device_pwm2;
26 extern struct pxa_device_desc pxa168_device_pwm3;
27 extern struct pxa_device_desc pxa168_device_pwm4;
28 extern struct pxa_device_desc pxa168_device_ssp1;
29 extern struct pxa_device_desc pxa168_device_ssp2;
30 extern struct pxa_device_desc pxa168_device_ssp3;
31 extern struct pxa_device_desc pxa168_device_ssp4;
32 extern struct pxa_device_desc pxa168_device_ssp5;
33 extern struct pxa_device_desc pxa168_device_nand;
34 extern struct pxa_device_desc pxa168_device_fb;
35 extern struct pxa_device_desc pxa168_device_keypad;
36 extern struct pxa_device_desc pxa168_device_eth;
38 static inline int pxa168_add_uart(int id)
40 struct pxa_device_desc *d = NULL;
43 case 1: d = &pxa168_device_uart1; break;
44 case 2: d = &pxa168_device_uart2; break;
45 case 3: d = &pxa168_device_uart3; break;
51 return pxa_register_device(d, NULL, 0);
54 static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
55 struct i2c_board_info *info, unsigned size)
57 struct pxa_device_desc *d = NULL;
61 case 0: d = &pxa168_device_twsi0; break;
62 case 1: d = &pxa168_device_twsi1; break;
67 ret = i2c_register_board_info(id, info, size);
71 return pxa_register_device(d, data, sizeof(*data));
74 static inline int pxa168_add_pwm(int id)
76 struct pxa_device_desc *d = NULL;
79 case 1: d = &pxa168_device_pwm1; break;
80 case 2: d = &pxa168_device_pwm2; break;
81 case 3: d = &pxa168_device_pwm3; break;
82 case 4: d = &pxa168_device_pwm4; break;
87 return pxa_register_device(d, NULL, 0);
90 static inline int pxa168_add_ssp(int id)
92 struct pxa_device_desc *d = NULL;
95 case 1: d = &pxa168_device_ssp1; break;
96 case 2: d = &pxa168_device_ssp2; break;
97 case 3: d = &pxa168_device_ssp3; break;
98 case 4: d = &pxa168_device_ssp4; break;
99 case 5: d = &pxa168_device_ssp5; break;
103 return pxa_register_device(d, NULL, 0);
106 static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
108 return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
111 static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
113 return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
116 static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
119 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
121 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
124 static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
126 return pxa_register_device(&pxa168_device_eth, data, sizeof(*data));
128 #endif /* __ASM_MACH_PXA168_H */