pxa910.h 2.4 KB

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