kvm tools, setup: Create private directory
[linux-2.6/next.git] / arch / arm / mach-mmp / include / mach / pxa168.h
bloba52b3d2f325ce7a3e6654b3fde2d87ad1af4dce4
1 #ifndef __ASM_MACH_PXA168_H
2 #define __ASM_MACH_PXA168_H
4 struct sys_timer;
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>
18 extern struct pxa_device_desc pxa168_device_uart1;
19 extern struct pxa_device_desc pxa168_device_uart2;
20 extern struct pxa_device_desc pxa168_device_twsi0;
21 extern struct pxa_device_desc pxa168_device_twsi1;
22 extern struct pxa_device_desc pxa168_device_pwm1;
23 extern struct pxa_device_desc pxa168_device_pwm2;
24 extern struct pxa_device_desc pxa168_device_pwm3;
25 extern struct pxa_device_desc pxa168_device_pwm4;
26 extern struct pxa_device_desc pxa168_device_ssp1;
27 extern struct pxa_device_desc pxa168_device_ssp2;
28 extern struct pxa_device_desc pxa168_device_ssp3;
29 extern struct pxa_device_desc pxa168_device_ssp4;
30 extern struct pxa_device_desc pxa168_device_ssp5;
31 extern struct pxa_device_desc pxa168_device_nand;
32 extern struct pxa_device_desc pxa168_device_fb;
33 extern struct pxa_device_desc pxa168_device_keypad;
35 static inline int pxa168_add_uart(int id)
37 struct pxa_device_desc *d = NULL;
39 switch (id) {
40 case 1: d = &pxa168_device_uart1; break;
41 case 2: d = &pxa168_device_uart2; break;
44 if (d == NULL)
45 return -EINVAL;
47 return pxa_register_device(d, NULL, 0);
50 static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
51 struct i2c_board_info *info, unsigned size)
53 struct pxa_device_desc *d = NULL;
54 int ret;
56 switch (id) {
57 case 0: d = &pxa168_device_twsi0; break;
58 case 1: d = &pxa168_device_twsi1; break;
59 default:
60 return -EINVAL;
63 ret = i2c_register_board_info(id, info, size);
64 if (ret)
65 return ret;
67 return pxa_register_device(d, data, sizeof(*data));
70 static inline int pxa168_add_pwm(int id)
72 struct pxa_device_desc *d = NULL;
74 switch (id) {
75 case 1: d = &pxa168_device_pwm1; break;
76 case 2: d = &pxa168_device_pwm2; break;
77 case 3: d = &pxa168_device_pwm3; break;
78 case 4: d = &pxa168_device_pwm4; break;
79 default:
80 return -EINVAL;
83 return pxa_register_device(d, NULL, 0);
86 static inline int pxa168_add_ssp(int id)
88 struct pxa_device_desc *d = NULL;
90 switch (id) {
91 case 1: d = &pxa168_device_ssp1; break;
92 case 2: d = &pxa168_device_ssp2; break;
93 case 3: d = &pxa168_device_ssp3; break;
94 case 4: d = &pxa168_device_ssp4; break;
95 case 5: d = &pxa168_device_ssp5; break;
96 default:
97 return -EINVAL;
99 return pxa_register_device(d, NULL, 0);
102 static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
104 return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
107 static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
109 return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
112 static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
114 if (cpu_is_pxa168())
115 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
117 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
120 #endif /* __ASM_MACH_PXA168_H */