Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
14c6b5e7 EM |
2 | #ifndef __ASM_MACH_PXA910_H |
3 | #define __ASM_MACH_PXA910_H | |
4 | ||
6bb27d73 | 5 | extern void pxa910_timer_init(void); |
c052d13c | 6 | extern void __init icu_init_irq(void); |
2728701d EM |
7 | extern void __init pxa910_init_irq(void); |
8 | ||
1a77920e | 9 | #include <linux/i2c.h> |
f15fc9b1 | 10 | #include <linux/platform_data/i2c-pxa.h> |
293b2da1 | 11 | #include <linux/platform_data/mtd-nand-pxa3xx.h> |
333893cd | 12 | #include <video/mmp_disp.h> |
14c6b5e7 | 13 | |
b501fd7b AB |
14 | #include "devices.h" |
15 | ||
14c6b5e7 EM |
16 | extern struct pxa_device_desc pxa910_device_uart1; |
17 | extern struct pxa_device_desc pxa910_device_uart2; | |
1a77920e EM |
18 | extern struct pxa_device_desc pxa910_device_twsi0; |
19 | extern struct pxa_device_desc pxa910_device_twsi1; | |
a27ba768 EM |
20 | extern struct pxa_device_desc pxa910_device_pwm1; |
21 | extern struct pxa_device_desc pxa910_device_pwm2; | |
22 | extern struct pxa_device_desc pxa910_device_pwm3; | |
23 | extern struct pxa_device_desc pxa910_device_pwm4; | |
a0f266c1 | 24 | extern struct pxa_device_desc pxa910_device_nand; |
a225daf7 | 25 | extern struct platform_device pxa168_device_usb_phy; |
75b1bdf5 NZ |
26 | extern struct platform_device pxa168_device_u2o; |
27 | extern struct platform_device pxa168_device_u2ootg; | |
28 | extern struct platform_device pxa168_device_u2oehci; | |
333893cd ZZ |
29 | extern struct pxa_device_desc pxa910_device_disp; |
30 | extern struct pxa_device_desc pxa910_device_fb; | |
31 | extern struct pxa_device_desc pxa910_device_panel; | |
157d2644 | 32 | extern struct platform_device pxa910_device_gpio; |
4128e275 | 33 | extern struct platform_device pxa910_device_rtc; |
157d2644 | 34 | |
14c6b5e7 EM |
35 | static inline int pxa910_add_uart(int id) |
36 | { | |
37 | struct pxa_device_desc *d = NULL; | |
38 | ||
39 | switch (id) { | |
40 | case 1: d = &pxa910_device_uart1; break; | |
41 | case 2: d = &pxa910_device_uart2; break; | |
42 | } | |
43 | ||
44 | if (d == NULL) | |
45 | return -EINVAL; | |
46 | ||
47 | return pxa_register_device(d, NULL, 0); | |
48 | } | |
1a77920e EM |
49 | |
50 | static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data, | |
51 | struct i2c_board_info *info, unsigned size) | |
52 | { | |
53 | struct pxa_device_desc *d = NULL; | |
54 | int ret; | |
55 | ||
56 | switch (id) { | |
57 | case 0: d = &pxa910_device_twsi0; break; | |
58 | case 1: d = &pxa910_device_twsi1; break; | |
59 | default: | |
60 | return -EINVAL; | |
61 | } | |
62 | ||
63 | ret = i2c_register_board_info(id, info, size); | |
64 | if (ret) | |
65 | return ret; | |
66 | ||
67 | return pxa_register_device(d, data, sizeof(*data)); | |
68 | } | |
a27ba768 EM |
69 | |
70 | static inline int pxa910_add_pwm(int id) | |
71 | { | |
72 | struct pxa_device_desc *d = NULL; | |
73 | ||
74 | switch (id) { | |
75 | case 1: d = &pxa910_device_pwm1; break; | |
76 | case 2: d = &pxa910_device_pwm2; break; | |
77 | case 3: d = &pxa910_device_pwm3; break; | |
78 | case 4: d = &pxa910_device_pwm4; break; | |
79 | default: | |
80 | return -EINVAL; | |
81 | } | |
82 | ||
83 | return pxa_register_device(d, NULL, 0); | |
84 | } | |
a0f266c1 HZ |
85 | |
86 | static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info) | |
87 | { | |
88 | return pxa_register_device(&pxa910_device_nand, info, sizeof(*info)); | |
89 | } | |
14c6b5e7 | 90 | #endif /* __ASM_MACH_PXA910_H */ |