summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm
diff options
context:
space:
mode:
authorDonghwa Lee <dh09.lee@samsung.com>2011-03-07 21:11:42 +0000
committerAlbert Aribaud <albert.aribaud@free.fr>2011-03-27 19:19:54 +0200
commit3f129280b3f1df51387447d8366ab6c3b6607547 (patch)
tree5debf976e9d236c4735455eba71fd694756b72e5 /arch/arm/include/asm
parentecc7cedd5ae1d63b50094efeb392a5925ec0f1de (diff)
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')
-rw-r--r--arch/arm/include/asm/arch-s5pc1xx/pwm.h19
-rw-r--r--arch/arm/include/asm/arch-s5pc2xx/pwm.h19
2 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-s5pc1xx/pwm.h b/arch/arm/include/asm/arch-s5pc1xx/pwm.h
index 0369968d4a..de4dbce076 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;
diff --git a/arch/arm/include/asm/arch-s5pc2xx/pwm.h b/arch/arm/include/asm/arch-s5pc2xx/pwm.h
index 0369968d4a..de4dbce076 100644
--- a/arch/arm/include/asm/arch-s5pc2xx/pwm.h
+++ b/arch/arm/include/asm/arch-s5pc2xx/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;