1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_MACH_PXA168_H
3 #define __ASM_MACH_PXA168_H
5 #include <linux/reboot.h>
7 extern void pxa168_timer_init(void);
8 extern void __init pxa168_init_irq(void);
9 extern void pxa168_restart(enum reboot_mode, const char *);
10 extern void pxa168_clear_keypad_wakeup(void);
12 #include <linux/i2c.h>
13 #include <linux/platform_data/i2c-pxa.h>
14 #include <linux/platform_data/mtd-nand-pxa3xx.h>
15 #include <video/pxa168fb.h>
16 #include <linux/platform_data/keypad-pxa27x.h>
17 #include <linux/pxa168_eth.h>
18 #include <linux/platform_data/mv_usb.h>
19 #include <linux/soc/mmp/cputype.h>
20 #include <linux/irqchip/mmp.h>
24 extern struct mmp_device_desc pxa168_device_uart1;
25 extern struct mmp_device_desc pxa168_device_uart2;
26 extern struct mmp_device_desc pxa168_device_uart3;
27 extern struct mmp_device_desc pxa168_device_twsi0;
28 extern struct mmp_device_desc pxa168_device_twsi1;
29 extern struct mmp_device_desc pxa168_device_pwm1;
30 extern struct mmp_device_desc pxa168_device_pwm2;
31 extern struct mmp_device_desc pxa168_device_pwm3;
32 extern struct mmp_device_desc pxa168_device_pwm4;
33 extern struct mmp_device_desc pxa168_device_ssp1;
34 extern struct mmp_device_desc pxa168_device_ssp2;
35 extern struct mmp_device_desc pxa168_device_ssp3;
36 extern struct mmp_device_desc pxa168_device_ssp4;
37 extern struct mmp_device_desc pxa168_device_ssp5;
38 extern struct mmp_device_desc pxa168_device_nand;
39 extern struct mmp_device_desc pxa168_device_fb;
40 extern struct mmp_device_desc pxa168_device_keypad;
41 extern struct mmp_device_desc pxa168_device_eth;
43 /* pdata can be NULL */
44 extern int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata);
47 extern struct platform_device pxa168_device_gpio;
49 static inline int pxa168_add_uart(int id)
51 struct mmp_device_desc *d = NULL;
54 case 1: d = &pxa168_device_uart1; break;
55 case 2: d = &pxa168_device_uart2; break;
56 case 3: d = &pxa168_device_uart3; break;
62 return mmp_register_device(d, NULL, 0);
65 static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
66 struct i2c_board_info *info, unsigned size)
68 struct mmp_device_desc *d = NULL;
72 case 0: d = &pxa168_device_twsi0; break;
73 case 1: d = &pxa168_device_twsi1; break;
78 ret = i2c_register_board_info(id, info, size);
82 return mmp_register_device(d, data, sizeof(*data));
85 static inline int pxa168_add_pwm(int id)
87 struct mmp_device_desc *d = NULL;
90 case 1: d = &pxa168_device_pwm1; break;
91 case 2: d = &pxa168_device_pwm2; break;
92 case 3: d = &pxa168_device_pwm3; break;
93 case 4: d = &pxa168_device_pwm4; break;
98 return mmp_register_device(d, NULL, 0);
101 static inline int pxa168_add_ssp(int id)
103 struct mmp_device_desc *d = NULL;
106 case 1: d = &pxa168_device_ssp1; break;
107 case 2: d = &pxa168_device_ssp2; break;
108 case 3: d = &pxa168_device_ssp3; break;
109 case 4: d = &pxa168_device_ssp4; break;
110 case 5: d = &pxa168_device_ssp5; break;
114 return mmp_register_device(d, NULL, 0);
117 static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
119 return mmp_register_device(&pxa168_device_nand, info, sizeof(*info));
122 static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
124 return mmp_register_device(&pxa168_device_fb, mi, sizeof(*mi));
127 static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
130 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
132 return mmp_register_device(&pxa168_device_keypad, data, sizeof(*data));
135 static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
137 return mmp_register_device(&pxa168_device_eth, data, sizeof(*data));
139 #endif /* __ASM_MACH_PXA168_H */