diff options
author | Donghwa Lee <dh09.lee@samsung.com> | 2011-03-07 21:11:42 (GMT) |
---|---|---|
committer | Albert Aribaud <albert.aribaud@free.fr> | 2011-03-27 17:19:54 (GMT) |
commit | 3f129280b3f1df51387447d8366ab6c3b6607547 (patch) | |
tree | 5debf976e9d236c4735455eba71fd694756b72e5 /arch/arm/include/asm/arch-s5pc1xx | |
parent | ecc7cedd5ae1d63b50094efeb392a5925ec0f1de (diff) | |
download | u-boot-fsl-qoriq-3f129280b3f1df51387447d8366ab6c3b6607547.tar.xz |
ARM: S5P: pwm driver support
This is common pwm driver of S5P.
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'arch/arm/include/asm/arch-s5pc1xx')
-rw-r--r-- | arch/arm/include/asm/arch-s5pc1xx/pwm.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-s5pc1xx/pwm.h b/arch/arm/include/asm/arch-s5pc1xx/pwm.h index 0369968..de4dbce 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/pwm.h +++ b/arch/arm/include/asm/arch-s5pc1xx/pwm.h @@ -22,6 +22,18 @@ #ifndef __ASM_ARM_ARCH_PWM_H_ #define __ASM_ARM_ARCH_PWM_H_ +#define PRESCALER_0 (8 - 1) /* prescaler of timer 0, 1 */ +#define PRESCALER_1 (16 - 1) /* prescaler of timer 2, 3, 4 */ + +/* Divider MUX */ +#define MUX_DIV_1 0 /* 1/1 period */ +#define MUX_DIV_2 1 /* 1/2 period */ +#define MUX_DIV_4 2 /* 1/4 period */ +#define MUX_DIV_8 3 /* 1/8 period */ +#define MUX_DIV_16 4 /* 1/16 period */ + +#define MUX_DIV_SHIFT(x) (x * 4) + /* Interval mode(Auto Reload) of PWM Timer 4 */ #define TCON4_AUTO_RELOAD (1 << 22) /* Update TCNTB4 */ @@ -29,6 +41,13 @@ /* start bit of PWM Timer 4 */ #define TCON4_START (1 << 20) +#define TCON_OFFSET(x) ((x + 1) * (!!x) << 2) + +#define TCON_START(x) (1 << TCON_OFFSET(x)) +#define TCON_UPDATE(x) (1 << (TCON_OFFSET(x) + 1)) +#define TCON_INVERTER(x) (1 << (TCON_OFFSET(x) + 2)) +#define TCON_AUTO_RELOAD(x) (1 << (TCON_OFFSET(x) + 3)) + #ifndef __ASSEMBLY__ struct s5p_timer { unsigned int tcfg0; |