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