Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / arm / mach-mmp / include / mach / pxa168.h
blobdc03d580a06d64737dab0962bcab81ffa296eddd
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_restart(char, const char *);
9 extern void pxa168_clear_keypad_wakeup(void);
11 #include <linux/i2c.h>
12 #include <linux/i2c/pxa-i2c.h>
13 #include <mach/devices.h>
14 #include <plat/pxa3xx_nand.h>
15 #include <video/pxa168fb.h>
16 #include <plat/pxa27x_keypad.h>
17 #include <mach/cputype.h>
18 #include <linux/pxa168_eth.h>
20 extern struct pxa_device_desc pxa168_device_uart1;
21 extern struct pxa_device_desc pxa168_device_uart2;
22 extern struct pxa_device_desc pxa168_device_uart3;
23 extern struct pxa_device_desc pxa168_device_twsi0;
24 extern struct pxa_device_desc pxa168_device_twsi1;
25 extern struct pxa_device_desc pxa168_device_pwm1;
26 extern struct pxa_device_desc pxa168_device_pwm2;
27 extern struct pxa_device_desc pxa168_device_pwm3;
28 extern struct pxa_device_desc pxa168_device_pwm4;
29 extern struct pxa_device_desc pxa168_device_ssp1;
30 extern struct pxa_device_desc pxa168_device_ssp2;
31 extern struct pxa_device_desc pxa168_device_ssp3;
32 extern struct pxa_device_desc pxa168_device_ssp4;
33 extern struct pxa_device_desc pxa168_device_ssp5;
34 extern struct pxa_device_desc pxa168_device_nand;
35 extern struct pxa_device_desc pxa168_device_fb;
36 extern struct pxa_device_desc pxa168_device_keypad;
37 extern struct pxa_device_desc pxa168_device_eth;
39 struct pxa168_usb_pdata {
40 /* If NULL, default phy init routine for PXA168 would be called */
41 int (*phy_init)(void __iomem *usb_phy_reg_base);
43 /* pdata can be NULL */
44 int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);
46 extern struct platform_device pxa168_device_gpio;
48 static inline int pxa168_add_uart(int id)
50 struct pxa_device_desc *d = NULL;
52 switch (id) {
53 case 1: d = &pxa168_device_uart1; break;
54 case 2: d = &pxa168_device_uart2; break;
55 case 3: d = &pxa168_device_uart3; break;
58 if (d == NULL)
59 return -EINVAL;
61 return pxa_register_device(d, NULL, 0);
64 static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
65 struct i2c_board_info *info, unsigned size)
67 struct pxa_device_desc *d = NULL;
68 int ret;
70 switch (id) {
71 case 0: d = &pxa168_device_twsi0; break;
72 case 1: d = &pxa168_device_twsi1; break;
73 default:
74 return -EINVAL;
77 ret = i2c_register_board_info(id, info, size);
78 if (ret)
79 return ret;
81 return pxa_register_device(d, data, sizeof(*data));
84 static inline int pxa168_add_pwm(int id)
86 struct pxa_device_desc *d = NULL;
88 switch (id) {
89 case 1: d = &pxa168_device_pwm1; break;
90 case 2: d = &pxa168_device_pwm2; break;
91 case 3: d = &pxa168_device_pwm3; break;
92 case 4: d = &pxa168_device_pwm4; break;
93 default:
94 return -EINVAL;
97 return pxa_register_device(d, NULL, 0);
100 static inline int pxa168_add_ssp(int id)
102 struct pxa_device_desc *d = NULL;
104 switch (id) {
105 case 1: d = &pxa168_device_ssp1; break;
106 case 2: d = &pxa168_device_ssp2; break;
107 case 3: d = &pxa168_device_ssp3; break;
108 case 4: d = &pxa168_device_ssp4; break;
109 case 5: d = &pxa168_device_ssp5; break;
110 default:
111 return -EINVAL;
113 return pxa_register_device(d, NULL, 0);
116 static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
118 return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
121 static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
123 return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
126 static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
128 if (cpu_is_pxa168())
129 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
131 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
134 static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
136 return pxa_register_device(&pxa168_device_eth, data, sizeof(*data));
138 #endif /* __ASM_MACH_PXA168_H */