devices.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* linux/arch/arm/mach-vt8500/devices.h
  2. *
  3. * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef __ARCH_ARM_MACH_VT8500_DEVICES_H
  16. #define __ARCH_ARM_MACH_VT8500_DEVICES_H
  17. #include <linux/platform_device.h>
  18. #include <asm/mach/map.h>
  19. void __init vt8500_init_irq(void);
  20. void __init wm8505_init_irq(void);
  21. void __init vt8500_map_io(void);
  22. void __init wm8505_map_io(void);
  23. void __init vt8500_reserve_mem(void);
  24. void __init wm8505_reserve_mem(void);
  25. void __init vt8500_gpio_init(void);
  26. void __init vt8500_set_resources(void);
  27. void __init wm8505_set_resources(void);
  28. extern unsigned long wmt_ic_base __initdata;
  29. extern unsigned long wmt_sic_base __initdata;
  30. extern unsigned long wmt_gpio_base __initdata;
  31. extern unsigned long wmt_pmc_base __initdata;
  32. extern int wmt_nr_irqs __initdata;
  33. extern int wmt_timer_irq __initdata;
  34. extern int wmt_gpio_ext_irq[8] __initdata;
  35. extern struct map_desc wmt_io_desc[2] __initdata;
  36. static inline struct resource wmt_mmio_res(u32 start, u32 size)
  37. {
  38. struct resource tmp = {
  39. .flags = IORESOURCE_MEM,
  40. .start = start,
  41. .end = start + size - 1,
  42. };
  43. return tmp;
  44. }
  45. static inline struct resource wmt_irq_res(int irq)
  46. {
  47. struct resource tmp = {
  48. .flags = IORESOURCE_IRQ,
  49. .start = irq,
  50. .end = irq,
  51. };
  52. return tmp;
  53. }
  54. static inline void wmt_res_add(struct platform_device *pdev,
  55. const struct resource *res, unsigned int num)
  56. {
  57. if (unlikely(platform_device_add_resources(pdev, res, num)))
  58. pr_err("Failed to assign resources\n");
  59. }
  60. extern struct sys_timer vt8500_timer;
  61. extern struct platform_device vt8500_device_uart0;
  62. extern struct platform_device vt8500_device_uart1;
  63. extern struct platform_device vt8500_device_uart2;
  64. extern struct platform_device vt8500_device_uart3;
  65. extern struct platform_device vt8500_device_uart4;
  66. extern struct platform_device vt8500_device_uart5;
  67. extern struct platform_device vt8500_device_lcdc;
  68. extern struct platform_device vt8500_device_wm8505_fb;
  69. extern struct platform_device vt8500_device_ehci;
  70. extern struct platform_device vt8500_device_ge_rops;
  71. extern struct platform_device vt8500_device_pwm;
  72. extern struct platform_device vt8500_device_pwmbl;
  73. extern struct platform_device vt8500_device_rtc;
  74. #endif