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