pwm.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2009 Samsung Electronics
  4. * Kyungmin Park <kyungmin.park@samsung.com>
  5. * Minkyu Kang <mk7.kang@samsung.com>
  6. */
  7. #ifndef __ASM_ARM_ARCH_PWM_H_
  8. #define __ASM_ARM_ARCH_PWM_H_
  9. #define PRESCALER_0 (8 - 1) /* prescaler of timer 0, 1 */
  10. #define PRESCALER_1 (16 - 1) /* prescaler of timer 2, 3, 4 */
  11. /* Divider MUX */
  12. #define MUX_DIV_1 0 /* 1/1 period */
  13. #define MUX_DIV_2 1 /* 1/2 period */
  14. #define MUX_DIV_4 2 /* 1/4 period */
  15. #define MUX_DIV_8 3 /* 1/8 period */
  16. #define MUX_DIV_16 4 /* 1/16 period */
  17. #define MUX_DIV_SHIFT(x) (x * 4)
  18. #define TCON_OFFSET(x) ((x + 1) * (!!x) << 2)
  19. #define TCON_START(x) (1 << TCON_OFFSET(x))
  20. #define TCON_UPDATE(x) (1 << (TCON_OFFSET(x) + 1))
  21. #define TCON_INVERTER(x) (1 << (TCON_OFFSET(x) + 2))
  22. #define TCON_AUTO_RELOAD(x) (1 << (TCON_OFFSET(x) + 3))
  23. #define TCON4_AUTO_RELOAD (1 << 22)
  24. #ifndef __ASSEMBLY__
  25. struct s5p_timer {
  26. unsigned int tcfg0;
  27. unsigned int tcfg1;
  28. unsigned int tcon;
  29. unsigned int tcntb0;
  30. unsigned int tcmpb0;
  31. unsigned int tcnto0;
  32. unsigned int tcntb1;
  33. unsigned int tcmpb1;
  34. unsigned int tcnto1;
  35. unsigned int tcntb2;
  36. unsigned int tcmpb2;
  37. unsigned int tcnto2;
  38. unsigned int tcntb3;
  39. unsigned int tcmpb3;
  40. unsigned int tcnto3;
  41. unsigned int tcntb4;
  42. unsigned int tcnto4;
  43. unsigned int tintcstat;
  44. };
  45. #endif /* __ASSEMBLY__ */
  46. #endif