pxa910.h 2.3 KB

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