mmp2.h 1.7 KB

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