Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
awilliam
GitHub Repository: awilliam/linux-vfio
Path: blob/master/arch/arm/mach-mmp/include/mach/mmp2.h
15162 views
1
#ifndef __ASM_MACH_MMP2_H
2
#define __ASM_MACH_MMP2_H
3
4
#include <plat/sdhci.h>
5
6
struct sys_timer;
7
8
extern struct sys_timer mmp2_timer;
9
extern void __init mmp2_init_icu(void);
10
extern void __init mmp2_init_irq(void);
11
extern void mmp2_clear_pmic_int(void);
12
13
#include <linux/i2c.h>
14
#include <linux/i2c/pxa-i2c.h>
15
#include <mach/devices.h>
16
17
extern struct pxa_device_desc mmp2_device_uart1;
18
extern struct pxa_device_desc mmp2_device_uart2;
19
extern struct pxa_device_desc mmp2_device_uart3;
20
extern struct pxa_device_desc mmp2_device_uart4;
21
extern struct pxa_device_desc mmp2_device_twsi1;
22
extern struct pxa_device_desc mmp2_device_twsi2;
23
extern struct pxa_device_desc mmp2_device_twsi3;
24
extern struct pxa_device_desc mmp2_device_twsi4;
25
extern struct pxa_device_desc mmp2_device_twsi5;
26
extern struct pxa_device_desc mmp2_device_twsi6;
27
extern struct pxa_device_desc mmp2_device_sdh0;
28
extern struct pxa_device_desc mmp2_device_sdh1;
29
extern struct pxa_device_desc mmp2_device_sdh2;
30
extern struct pxa_device_desc mmp2_device_sdh3;
31
32
static inline int mmp2_add_uart(int id)
33
{
34
struct pxa_device_desc *d = NULL;
35
36
switch (id) {
37
case 1: d = &mmp2_device_uart1; break;
38
case 2: d = &mmp2_device_uart2; break;
39
case 3: d = &mmp2_device_uart3; break;
40
case 4: d = &mmp2_device_uart4; break;
41
default:
42
return -EINVAL;
43
}
44
45
return pxa_register_device(d, NULL, 0);
46
}
47
48
static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data,
49
struct i2c_board_info *info, unsigned size)
50
{
51
struct pxa_device_desc *d = NULL;
52
int ret;
53
54
switch (id) {
55
case 1: d = &mmp2_device_twsi1; break;
56
case 2: d = &mmp2_device_twsi2; break;
57
case 3: d = &mmp2_device_twsi3; break;
58
case 4: d = &mmp2_device_twsi4; break;
59
case 5: d = &mmp2_device_twsi5; break;
60
case 6: d = &mmp2_device_twsi6; break;
61
default:
62
return -EINVAL;
63
}
64
65
ret = i2c_register_board_info(id - 1, info, size);
66
if (ret)
67
return ret;
68
69
return pxa_register_device(d, data, sizeof(*data));
70
}
71
72
static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data)
73
{
74
struct pxa_device_desc *d = NULL;
75
76
switch (id) {
77
case 0: d = &mmp2_device_sdh0; break;
78
case 1: d = &mmp2_device_sdh1; break;
79
case 2: d = &mmp2_device_sdh2; break;
80
case 3: d = &mmp2_device_sdh3; break;
81
default:
82
return -EINVAL;
83
}
84
85
return pxa_register_device(d, data, sizeof(*data));
86
}
87
88
#endif /* __ASM_MACH_MMP2_H */
89
90
91