pwm.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2016 Google, Inc
  4. * (C) Copyright 2008-2014 Rockchip Electronics
  5. */
  6. #ifndef _ASM_ARCH_PWM_H
  7. #define _ASM_ARCH_PWM_H
  8. struct rk3288_pwm {
  9. u32 cnt;
  10. u32 period_hpr;
  11. u32 duty_lpr;
  12. u32 ctrl;
  13. };
  14. check_member(rk3288_pwm, ctrl, 0xc);
  15. #define RK_PWM_DISABLE (0 << 0)
  16. #define RK_PWM_ENABLE (1 << 0)
  17. #define PWM_ONE_SHOT (0 << 1)
  18. #define PWM_CONTINUOUS (1 << 1)
  19. #define RK_PWM_CAPTURE (1 << 2)
  20. #define PWM_DUTY_POSTIVE (1 << 3)
  21. #define PWM_DUTY_NEGATIVE (0 << 3)
  22. #define PWM_DUTY_MASK (1 << 3)
  23. #define PWM_INACTIVE_POSTIVE (1 << 4)
  24. #define PWM_INACTIVE_NEGATIVE (0 << 4)
  25. #define PWM_INACTIVE_MASK (1 << 4)
  26. #define PWM_OUTPUT_LEFT (0 << 5)
  27. #define PWM_OUTPUT_CENTER (1 << 5)
  28. #define PWM_LP_ENABLE (1 << 8)
  29. #define PWM_LP_DISABLE (0 << 8)
  30. #define PWM_SEL_SCALE_CLK (1 << 9)
  31. #define PWM_SEL_SRC_CLK (0 << 9)
  32. #endif