1#ifndef __ASM_MACH_MMP2_H 2#define __ASM_MACH_MMP2_H 3 4struct sys_timer; 5 6extern struct sys_timer mmp2_timer; 7extern void __init mmp2_init_icu(void); 8extern void __init mmp2_init_irq(void); 9extern void mmp2_clear_pmic_int(void); 10 11#include <linux/i2c.h> 12#include <mach/devices.h> 13#include <plat/i2c.h> 14 15extern struct pxa_device_desc mmp2_device_uart1; 16extern struct pxa_device_desc mmp2_device_uart2; 17extern struct pxa_device_desc mmp2_device_uart3; 18extern struct pxa_device_desc mmp2_device_uart4; 19extern struct pxa_device_desc mmp2_device_twsi1; 20extern struct pxa_device_desc mmp2_device_twsi2; 21extern struct pxa_device_desc mmp2_device_twsi3; 22extern struct pxa_device_desc mmp2_device_twsi4; 23extern struct pxa_device_desc mmp2_device_twsi5; 24extern struct pxa_device_desc mmp2_device_twsi6; 25 26static inline int mmp2_add_uart(int id) 27{ 28 struct pxa_device_desc *d = NULL; 29 30 switch (id) { 31 case 1: d = &mmp2_device_uart1; break; 32 case 2: d = &mmp2_device_uart2; break; 33 case 3: d = &mmp2_device_uart3; break; 34 case 4: d = &mmp2_device_uart4; break; 35 default: 36 return -EINVAL; 37 } 38 39 return pxa_register_device(d, NULL, 0); 40} 41 42static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data, 43 struct i2c_board_info *info, unsigned size) 44{ 45 struct pxa_device_desc *d = NULL; 46 int ret; 47 48 switch (id) { 49 case 1: d = &mmp2_device_twsi1; break; 50 case 2: d = &mmp2_device_twsi2; break; 51 case 3: d = &mmp2_device_twsi3; break; 52 case 4: d = &mmp2_device_twsi4; break; 53 case 5: d = &mmp2_device_twsi5; break; 54 case 6: d = &mmp2_device_twsi6; break; 55 default: 56 return -EINVAL; 57 } 58 59 ret = i2c_register_board_info(id - 1, info, size); 60 if (ret) 61 return ret; 62 63 return pxa_register_device(d, data, sizeof(*data)); 64} 65 66#endif /* __ASM_MACH_MMP2_H */ 67