1 #ifndef __ASM_MACH_PXA168_H
2 #define __ASM_MACH_PXA168_H
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
;
40 case 1: d
= &pxa168_device_uart1
; break;
41 case 2: d
= &pxa168_device_uart2
; break;
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
;
57 case 0: d
= &pxa168_device_twsi0
; break;
58 case 1: d
= &pxa168_device_twsi1
; break;
63 ret
= i2c_register_board_info(id
, info
, size
);
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
;
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;
83 return pxa_register_device(d
, NULL
, 0);
86 static inline int pxa168_add_ssp(int id
)
88 struct pxa_device_desc
*d
= NULL
;
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;
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
)
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 */