pxa910.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef __ASM_MACH_PXA910_H
  2. #define __ASM_MACH_PXA910_H
  3. extern void pxa910_timer_init(void);
  4. extern void __init icu_init_irq(void);
  5. extern void __init pxa910_init_irq(void);
  6. #include <linux/i2c.h>
  7. #include <linux/i2c/pxa-i2c.h>
  8. #include <linux/platform_data/mtd-nand-pxa3xx.h>
  9. #include <video/mmp_disp.h>
  10. #include "devices.h"
  11. extern struct pxa_device_desc pxa910_device_uart1;
  12. extern struct pxa_device_desc pxa910_device_uart2;
  13. extern struct pxa_device_desc pxa910_device_twsi0;
  14. extern struct pxa_device_desc pxa910_device_twsi1;
  15. extern struct pxa_device_desc pxa910_device_pwm1;
  16. extern struct pxa_device_desc pxa910_device_pwm2;
  17. extern struct pxa_device_desc pxa910_device_pwm3;
  18. extern struct pxa_device_desc pxa910_device_pwm4;
  19. extern struct pxa_device_desc pxa910_device_nand;
  20. extern struct platform_device pxa168_device_u2o;
  21. extern struct platform_device pxa168_device_u2ootg;
  22. extern struct platform_device pxa168_device_u2oehci;
  23. extern struct pxa_device_desc pxa910_device_disp;
  24. extern struct pxa_device_desc pxa910_device_fb;
  25. extern struct pxa_device_desc pxa910_device_panel;
  26. extern struct platform_device pxa910_device_gpio;
  27. extern struct platform_device pxa910_device_rtc;
  28. static inline int pxa910_add_uart(int id)
  29. {
  30. struct pxa_device_desc *d = NULL;
  31. switch (id) {
  32. case 1: d = &pxa910_device_uart1; break;
  33. case 2: d = &pxa910_device_uart2; break;
  34. }
  35. if (d == NULL)
  36. return -EINVAL;
  37. return pxa_register_device(d, NULL, 0);
  38. }
  39. static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,
  40. struct i2c_board_info *info, unsigned size)
  41. {
  42. struct pxa_device_desc *d = NULL;
  43. int ret;
  44. switch (id) {
  45. case 0: d = &pxa910_device_twsi0; break;
  46. case 1: d = &pxa910_device_twsi1; break;
  47. default:
  48. return -EINVAL;
  49. }
  50. ret = i2c_register_board_info(id, info, size);
  51. if (ret)
  52. return ret;
  53. return pxa_register_device(d, data, sizeof(*data));
  54. }
  55. static inline int pxa910_add_pwm(int id)
  56. {
  57. struct pxa_device_desc *d = NULL;
  58. switch (id) {
  59. case 1: d = &pxa910_device_pwm1; break;
  60. case 2: d = &pxa910_device_pwm2; break;
  61. case 3: d = &pxa910_device_pwm3; break;
  62. case 4: d = &pxa910_device_pwm4; break;
  63. default:
  64. return -EINVAL;
  65. }
  66. return pxa_register_device(d, NULL, 0);
  67. }
  68. static inline int pxa910_add_nand(struct pxa3xx_nand_platform_data *info)
  69. {
  70. return pxa_register_device(&pxa910_device_nand, info, sizeof(*info));
  71. }
  72. #endif /* __ASM_MACH_PXA910_H */