Path: blob/master/arch/arm/mach-mmp/include/mach/mmp2.h
15162 views
#ifndef __ASM_MACH_MMP2_H1#define __ASM_MACH_MMP2_H23#include <plat/sdhci.h>45struct sys_timer;67extern struct sys_timer mmp2_timer;8extern void __init mmp2_init_icu(void);9extern void __init mmp2_init_irq(void);10extern void mmp2_clear_pmic_int(void);1112#include <linux/i2c.h>13#include <linux/i2c/pxa-i2c.h>14#include <mach/devices.h>1516extern struct pxa_device_desc mmp2_device_uart1;17extern struct pxa_device_desc mmp2_device_uart2;18extern struct pxa_device_desc mmp2_device_uart3;19extern struct pxa_device_desc mmp2_device_uart4;20extern struct pxa_device_desc mmp2_device_twsi1;21extern struct pxa_device_desc mmp2_device_twsi2;22extern struct pxa_device_desc mmp2_device_twsi3;23extern struct pxa_device_desc mmp2_device_twsi4;24extern struct pxa_device_desc mmp2_device_twsi5;25extern struct pxa_device_desc mmp2_device_twsi6;26extern struct pxa_device_desc mmp2_device_sdh0;27extern struct pxa_device_desc mmp2_device_sdh1;28extern struct pxa_device_desc mmp2_device_sdh2;29extern struct pxa_device_desc mmp2_device_sdh3;3031static inline int mmp2_add_uart(int id)32{33struct pxa_device_desc *d = NULL;3435switch (id) {36case 1: d = &mmp2_device_uart1; break;37case 2: d = &mmp2_device_uart2; break;38case 3: d = &mmp2_device_uart3; break;39case 4: d = &mmp2_device_uart4; break;40default:41return -EINVAL;42}4344return pxa_register_device(d, NULL, 0);45}4647static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data,48struct i2c_board_info *info, unsigned size)49{50struct pxa_device_desc *d = NULL;51int ret;5253switch (id) {54case 1: d = &mmp2_device_twsi1; break;55case 2: d = &mmp2_device_twsi2; break;56case 3: d = &mmp2_device_twsi3; break;57case 4: d = &mmp2_device_twsi4; break;58case 5: d = &mmp2_device_twsi5; break;59case 6: d = &mmp2_device_twsi6; break;60default:61return -EINVAL;62}6364ret = i2c_register_board_info(id - 1, info, size);65if (ret)66return ret;6768return pxa_register_device(d, data, sizeof(*data));69}7071static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data)72{73struct pxa_device_desc *d = NULL;7475switch (id) {76case 0: d = &mmp2_device_sdh0; break;77case 1: d = &mmp2_device_sdh1; break;78case 2: d = &mmp2_device_sdh2; break;79case 3: d = &mmp2_device_sdh3; break;80default:81return -EINVAL;82}8384return pxa_register_device(d, data, sizeof(*data));85}8687#endif /* __ASM_MACH_MMP2_H */88899091