ARM: delete struct sys_timer
[deliverable/linux.git] / arch / arm / mach-mmp / include / mach / pxa168.h
CommitLineData
49cbe786
EM
1#ifndef __ASM_MACH_PXA168_H
2#define __ASM_MACH_PXA168_H
3
6bb27d73 4extern void pxa168_timer_init(void);
2728701d 5extern void __init pxa168_init_irq(void);
9854a38e 6extern void pxa168_restart(char, const char *);
ab5739a1 7extern void pxa168_clear_keypad_wakeup(void);
2728701d 8
1a77920e 9#include <linux/i2c.h>
b459396e 10#include <linux/i2c/pxa-i2c.h>
49cbe786 11#include <mach/devices.h>
293b2da1 12#include <linux/platform_data/mtd-nand-pxa3xx.h>
58cf68b8 13#include <video/pxa168fb.h>
293b2da1 14#include <linux/platform_data/keypad-pxa27x.h>
ab5739a1 15#include <mach/cputype.h>
80def0dc 16#include <linux/pxa168_eth.h>
161105bc 17#include <linux/platform_data/mv_usb.h>
49cbe786
EM
18
19extern struct pxa_device_desc pxa168_device_uart1;
20extern struct pxa_device_desc pxa168_device_uart2;
26407f81 21extern struct pxa_device_desc pxa168_device_uart3;
1a77920e
EM
22extern struct pxa_device_desc pxa168_device_twsi0;
23extern struct pxa_device_desc pxa168_device_twsi1;
a27ba768
EM
24extern struct pxa_device_desc pxa168_device_pwm1;
25extern struct pxa_device_desc pxa168_device_pwm2;
26extern struct pxa_device_desc pxa168_device_pwm3;
27extern struct pxa_device_desc pxa168_device_pwm4;
7e499228
HZ
28extern struct pxa_device_desc pxa168_device_ssp1;
29extern struct pxa_device_desc pxa168_device_ssp2;
30extern struct pxa_device_desc pxa168_device_ssp3;
31extern struct pxa_device_desc pxa168_device_ssp4;
32extern struct pxa_device_desc pxa168_device_ssp5;
a0f266c1 33extern struct pxa_device_desc pxa168_device_nand;
58cf68b8 34extern struct pxa_device_desc pxa168_device_fb;
6d109465 35extern struct pxa_device_desc pxa168_device_keypad;
80def0dc 36extern struct pxa_device_desc pxa168_device_eth;
49cbe786 37
3abd7f68 38/* pdata can be NULL */
161105bc
NZ
39extern int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata);
40
3abd7f68 41
157d2644
HZ
42extern struct platform_device pxa168_device_gpio;
43
49cbe786
EM
44static inline int pxa168_add_uart(int id)
45{
46 struct pxa_device_desc *d = NULL;
47
48 switch (id) {
49 case 1: d = &pxa168_device_uart1; break;
50 case 2: d = &pxa168_device_uart2; break;
26407f81 51 case 3: d = &pxa168_device_uart3; break;
49cbe786
EM
52 }
53
54 if (d == NULL)
55 return -EINVAL;
56
57 return pxa_register_device(d, NULL, 0);
58}
1a77920e
EM
59
60static inline int pxa168_add_twsi(int id, struct i2c_pxa_platform_data *data,
61 struct i2c_board_info *info, unsigned size)
62{
63 struct pxa_device_desc *d = NULL;
64 int ret;
65
66 switch (id) {
67 case 0: d = &pxa168_device_twsi0; break;
68 case 1: d = &pxa168_device_twsi1; break;
69 default:
70 return -EINVAL;
71 }
72
73 ret = i2c_register_board_info(id, info, size);
74 if (ret)
75 return ret;
76
77 return pxa_register_device(d, data, sizeof(*data));
78}
a27ba768
EM
79
80static inline int pxa168_add_pwm(int id)
81{
82 struct pxa_device_desc *d = NULL;
83
84 switch (id) {
85 case 1: d = &pxa168_device_pwm1; break;
86 case 2: d = &pxa168_device_pwm2; break;
87 case 3: d = &pxa168_device_pwm3; break;
88 case 4: d = &pxa168_device_pwm4; break;
89 default:
90 return -EINVAL;
91 }
92
93 return pxa_register_device(d, NULL, 0);
94}
a0f266c1 95
7e499228
HZ
96static inline int pxa168_add_ssp(int id)
97{
98 struct pxa_device_desc *d = NULL;
99
100 switch (id) {
101 case 1: d = &pxa168_device_ssp1; break;
102 case 2: d = &pxa168_device_ssp2; break;
103 case 3: d = &pxa168_device_ssp3; break;
104 case 4: d = &pxa168_device_ssp4; break;
105 case 5: d = &pxa168_device_ssp5; break;
106 default:
107 return -EINVAL;
108 }
109 return pxa_register_device(d, NULL, 0);
110}
111
a0f266c1
HZ
112static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
113{
114 return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
115}
58cf68b8
MB
116
117static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
118{
119 return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
120}
121
6d109465
MB
122static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
123{
ab5739a1
MB
124 if (cpu_is_pxa168())
125 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
126
6d109465
MB
127 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
128}
129
80def0dc
TU
130static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
131{
132 return pxa_register_device(&pxa168_device_eth, data, sizeof(*data));
133}
49cbe786 134#endif /* __ASM_MACH_PXA168_H */
This page took 0.288223 seconds and 5 git commands to generate.