]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - arch/arm/mach-mmp/include/mach/mmp2.h
ARM: mmp: register audio sram bank
[mirror_ubuntu-focal-kernel.git] / arch / arm / mach-mmp / include / mach / mmp2.h
CommitLineData
2f7e8fae
HZ
1#ifndef __ASM_MACH_MMP2_H
2#define __ASM_MACH_MMP2_H
3
bfed345e 4#include <linux/platform_data/pxa_sdhci.h>
5382f419 5
2728701d
EM
6struct sys_timer;
7
8extern struct sys_timer mmp2_timer;
9extern void __init mmp2_init_icu(void);
10extern void __init mmp2_init_irq(void);
11extern void mmp2_clear_pmic_int(void);
12
2f7e8fae 13#include <linux/i2c.h>
b459396e 14#include <linux/i2c/pxa-i2c.h>
2f7e8fae 15#include <mach/devices.h>
101bf4c1 16#include <mach/sram.h>
2f7e8fae
HZ
17
18extern struct pxa_device_desc mmp2_device_uart1;
19extern struct pxa_device_desc mmp2_device_uart2;
20extern struct pxa_device_desc mmp2_device_uart3;
21extern struct pxa_device_desc mmp2_device_uart4;
22extern struct pxa_device_desc mmp2_device_twsi1;
23extern struct pxa_device_desc mmp2_device_twsi2;
24extern struct pxa_device_desc mmp2_device_twsi3;
25extern struct pxa_device_desc mmp2_device_twsi4;
26extern struct pxa_device_desc mmp2_device_twsi5;
27extern struct pxa_device_desc mmp2_device_twsi6;
5382f419
ZG
28extern struct pxa_device_desc mmp2_device_sdh0;
29extern struct pxa_device_desc mmp2_device_sdh1;
30extern struct pxa_device_desc mmp2_device_sdh2;
31extern struct pxa_device_desc mmp2_device_sdh3;
101bf4c1 32extern struct pxa_device_desc mmp2_device_asram;
2f7e8fae
HZ
33
34static inline int mmp2_add_uart(int id)
35{
36 struct pxa_device_desc *d = NULL;
37
38 switch (id) {
39 case 1: d = &mmp2_device_uart1; break;
40 case 2: d = &mmp2_device_uart2; break;
41 case 3: d = &mmp2_device_uart3; break;
42 case 4: d = &mmp2_device_uart4; break;
43 default:
44 return -EINVAL;
45 }
46
47 return pxa_register_device(d, NULL, 0);
48}
49
50static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data,
51 struct i2c_board_info *info, unsigned size)
52{
53 struct pxa_device_desc *d = NULL;
54 int ret;
55
56 switch (id) {
fed24055
HZ
57 case 1: d = &mmp2_device_twsi1; break;
58 case 2: d = &mmp2_device_twsi2; break;
59 case 3: d = &mmp2_device_twsi3; break;
60 case 4: d = &mmp2_device_twsi4; break;
61 case 5: d = &mmp2_device_twsi5; break;
62 case 6: d = &mmp2_device_twsi6; break;
2f7e8fae
HZ
63 default:
64 return -EINVAL;
65 }
66
fed24055 67 ret = i2c_register_board_info(id - 1, info, size);
2f7e8fae
HZ
68 if (ret)
69 return ret;
70
71 return pxa_register_device(d, data, sizeof(*data));
72}
73
5382f419
ZG
74static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data)
75{
76 struct pxa_device_desc *d = NULL;
77
78 switch (id) {
79 case 0: d = &mmp2_device_sdh0; break;
80 case 1: d = &mmp2_device_sdh1; break;
81 case 2: d = &mmp2_device_sdh2; break;
82 case 3: d = &mmp2_device_sdh3; break;
83 default:
84 return -EINVAL;
85 }
86
87 return pxa_register_device(d, data, sizeof(*data));
88}
89
101bf4c1
LY
90static inline int mmp2_add_asram(struct sram_platdata *data)
91{
92 return pxa_register_device(&mmp2_device_asram, data, sizeof(*data));
93}
94
2f7e8fae
HZ
95#endif /* __ASM_MACH_MMP2_H */
96