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