Merge branch 'kirkwood/cleanup' of git://git.infradead.org/users/jcooper/linux into...
[deliverable/linux.git] / arch / arm / mach-mmp / include / mach / pxa910.h
CommitLineData
14c6b5e7
EM
1#ifndef __ASM_MACH_PXA910_H
2#define __ASM_MACH_PXA910_H
3
2728701d
EM
4struct sys_timer;
5
6extern struct sys_timer pxa910_timer;
7extern void __init pxa910_init_irq(void);
8
1a77920e 9#include <linux/i2c.h>
b459396e 10#include <linux/i2c/pxa-i2c.h>
14c6b5e7 11#include <mach/devices.h>
293b2da1 12#include <linux/platform_data/mtd-nand-pxa3xx.h>
14c6b5e7
EM
13
14extern struct pxa_device_desc pxa910_device_uart1;
15extern struct pxa_device_desc pxa910_device_uart2;
1a77920e
EM
16extern struct pxa_device_desc pxa910_device_twsi0;
17extern struct pxa_device_desc pxa910_device_twsi1;
a27ba768
EM
18extern struct pxa_device_desc pxa910_device_pwm1;
19extern struct pxa_device_desc pxa910_device_pwm2;
20extern struct pxa_device_desc pxa910_device_pwm3;
21extern struct pxa_device_desc pxa910_device_pwm4;
a0f266c1 22extern struct pxa_device_desc pxa910_device_nand;
75b1bdf5
NZ
23extern struct platform_device pxa168_device_u2o;
24extern struct platform_device pxa168_device_u2ootg;
25extern struct platform_device pxa168_device_u2oehci;
14c6b5e7 26
157d2644 27extern struct platform_device pxa910_device_gpio;
4128e275 28extern struct platform_device pxa910_device_rtc;
157d2644 29
14c6b5e7
EM
30static inline int pxa910_add_uart(int id)
31{
32 struct pxa_device_desc *d = NULL;
33
34 switch (id) {
35 case 1: d = &pxa910_device_uart1; break;
36 case 2: d = &pxa910_device_uart2; break;
37 }
38
39 if (d == NULL)
40 return -EINVAL;
41
42 return pxa_register_device(d, NULL, 0);
43}
1a77920e
EM
44
45static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
46 struct i2c_board_info *info, unsigned size)
47{
48 struct pxa_device_desc *d = NULL;
49 int ret;
50
51 switch (id) {
52 case 0: d = &pxa910_device_twsi0; break;
53 case 1: d = &pxa910_device_twsi1; break;
54 default:
55 return -EINVAL;
56 }
57
58 ret = i2c_register_board_info(id, info, size);
59 if (ret)
60 return ret;
61
62 return pxa_register_device(d, data, sizeof(*data));
63}
a27ba768
EM
64
65static inline int pxa910_add_pwm(int id)
66{
67 struct pxa_device_desc *d = NULL;
68
69 switch (id) {
70 case 1: d = &pxa910_device_pwm1; break;
71 case 2: d = &pxa910_device_pwm2; break;
72 case 3: d = &pxa910_device_pwm3; break;
73 case 4: d = &pxa910_device_pwm4; break;
74 default:
75 return -EINVAL;
76 }
77
78 return pxa_register_device(d, NULL, 0);
79}
a0f266c1
HZ
80
81static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info)
82{
83 return pxa_register_device(&pxa910_device_nand, info, sizeof(*info));
84}
14c6b5e7 85#endif /* __ASM_MACH_PXA910_H */
This page took 0.21348 seconds and 5 git commands to generate.