aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c24xx/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-s3c24xx/include')
-rw-r--r--arch/arm/plat-s3c24xx/include/mach/pwm-clock.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h b/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
index 3194ed329ea..a087de21bc2 100644
--- a/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
+++ b/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
@@ -41,4 +41,15 @@ static inline unsigned int pwm_tdiv_has_div1(void)
return 0;
}
+/**
+ * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
+ * @div: The divisor to calculate the bit information for.
+ *
+ * Turn a divisor into the necessary bit field for TCFG1.
+ */
+static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
+{
+ return ilog2(div) - 1;
+}
+
#define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK