Add linux-next specific files for 20110831
[linux-2.6/next.git] / arch / arm / mach-mmp / include / mach / pxa168.h
blob7fb568d2845b0da8f86c2614b6072b9526b3ee5e
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>
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 struct pxa168_usb_pdata {
39 /* If NULL, default phy init routine for PXA168 would be called */
40 int (*phy_init)(void __iomem *usb_phy_reg_base);
42 /* pdata can be NULL */
43 int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);
45 static inline int pxa168_add_uart(int id)
47 struct pxa_device_desc *d = NULL;
49 switch (id) {
50 case 1: d = &pxa168_device_uart1; break;
51 case 2: d = &pxa168_device_uart2; break;
52 case 3: d = &pxa168_device_uart3; break;
55 if (d == NULL)
56 return -EINVAL;
58 return pxa_register_device(d, NULL, 0);
61 static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
62 struct i2c_board_info *info, unsigned size)
64 struct pxa_device_desc *d = NULL;
65 int ret;
67 switch (id) {
68 case 0: d = &pxa168_device_twsi0; break;
69 case 1: d = &pxa168_device_twsi1; break;
70 default:
71 return -EINVAL;
74 ret = i2c_register_board_info(id, info, size);
75 if (ret)
76 return ret;
78 return pxa_register_device(d, data, sizeof(*data));
81 static inline int pxa168_add_pwm(int id)
83 struct pxa_device_desc *d = NULL;
85 switch (id) {
86 case 1: d = &pxa168_device_pwm1; break;
87 case 2: d = &pxa168_device_pwm2; break;
88 case 3: d = &pxa168_device_pwm3; break;
89 case 4: d = &pxa168_device_pwm4; break;
90 default:
91 return -EINVAL;
94 return pxa_register_device(d, NULL, 0);
97 static inline int pxa168_add_ssp(int id)
99 struct pxa_device_desc *d = NULL;
101 switch (id) {
102 case 1: d = &pxa168_device_ssp1; break;
103 case 2: d = &pxa168_device_ssp2; break;
104 case 3: d = &pxa168_device_ssp3; break;
105 case 4: d = &pxa168_device_ssp4; break;
106 case 5: d = &pxa168_device_ssp5; break;
107 default:
108 return -EINVAL;
110 return pxa_register_device(d, NULL, 0);
113 static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
115 return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
118 static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
120 return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
123 static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
125 if (cpu_is_pxa168())
126 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
128 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
131 static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
133 return pxa_register_device(&pxa168_device_eth, data, sizeof(*data));
135 #endif /* __ASM_MACH_PXA168_H */