dev-pwm.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* linux/arch/arm/plat-samsung/dev-pwm.c
  2. *
  3. * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com
  5. *
  6. * Copyright (c) 2007 Ben Dooks
  7. * Copyright (c) 2008 Simtec Electronics
  8. * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
  9. *
  10. * S3C series device definition for the PWM timer
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/platform_device.h>
  18. #include <mach/irqs.h>
  19. #include <plat/devs.h>
  20. #define TIMER_RESOURCE_SIZE (1)
  21. #define TIMER_RESOURCE(_tmr, _irq) \
  22. (struct resource [TIMER_RESOURCE_SIZE]) { \
  23. [0] = { \
  24. .start = _irq, \
  25. .end = _irq, \
  26. .flags = IORESOURCE_IRQ \
  27. } \
  28. }
  29. #define DEFINE_S3C_TIMER(_tmr_no, _irq) \
  30. .name = "s3c24xx-pwm", \
  31. .id = _tmr_no, \
  32. .num_resources = TIMER_RESOURCE_SIZE, \
  33. .resource = TIMER_RESOURCE(_tmr_no, _irq), \
  34. /*
  35. * since we already have an static mapping for the timer,
  36. * we do not bother setting any IO resource for the base.
  37. */
  38. struct platform_device s3c_device_timer[] = {
  39. [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
  40. [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
  41. [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
  42. [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
  43. [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
  44. };
  45. EXPORT_SYMBOL(s3c_device_timer);