xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-rockchip/pwm.h (revision 6a624b88fcd0fd02f2d87dc1ece949d38fc353be)
1 /*
2  * (C) Copyright 2016 Google, Inc
3  * (C) Copyright 2008-2014 Rockchip Electronics
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7 
8 #ifndef _ASM_ARCH_PWM_H
9 #define _ASM_ARCH_PWM_H
10 
11 struct rockchip_pwm_regs {
12 	unsigned long duty;
13 	unsigned long period;
14 	unsigned long ctrl;
15 	unsigned long version;
16 	unsigned long enable;
17 };
18 
19 #define PWM_CTRL_TIMER_EN		(1 << 0)
20 #define PWM_CTRL_OUTPUT_EN		(1 << 3)
21 
22 #define RK_PWM_DISABLE                  (0 << 0)
23 #define RK_PWM_ENABLE                   (1 << 0)
24 
25 #define PWM_ONE_SHOT                    (0 << 1)
26 #define PWM_CONTINUOUS                  (1 << 1)
27 #define RK_PWM_CAPTURE                  (1 << 2)
28 
29 #define PWM_DUTY_POSTIVE                (1 << 3)
30 #define PWM_DUTY_NEGATIVE               (0 << 3)
31 #define PWM_DUTY_MASK			(1 << 3)
32 
33 #define PWM_INACTIVE_POSTIVE            (1 << 4)
34 #define PWM_INACTIVE_NEGATIVE           (0 << 4)
35 #define PWM_INACTIVE_MASK		(1 << 4)
36 
37 #define PWM_OUTPUT_LEFT                 (0 << 5)
38 #define PWM_OUTPUT_CENTER               (1 << 5)
39 
40 #define PWM_LOCK			(1 << 6)
41 #define PWM_UNLOCK			(0 << 6)
42 
43 #define PWM_LP_ENABLE                   (1 << 8)
44 #define PWM_LP_DISABLE                  (0 << 8)
45 
46 #define PWM_SEL_SCALE_CLK		(1 << 9)
47 #define PWM_SEL_SRC_CLK			(0 << 9)
48 
49 #endif
50