#include <common.h>
#include <errno.h>
-#include <pwm.h>
#include <asm/io.h>
#include <asm/arch/pwm.h>
#include <asm/arch/clk.h>
-int pwm_enable(int pwm_id)
+int s5p_pwm_enable(int pwm_id)
{
const struct s5p_timer *pwm =
#if defined(CONFIG_ARCH_NEXELL)
return 0;
}
-void pwm_disable(int pwm_id)
+void s5p_pwm_disable(int pwm_id)
{
const struct s5p_timer *pwm =
#if defined(CONFIG_ARCH_NEXELL)
#define NS_IN_SEC 1000000000UL
-int pwm_config(int pwm_id, int duty_ns, int period_ns)
+int s5p_pwm_config(int pwm_id, int duty_ns, int period_ns)
{
const struct s5p_timer *pwm =
#if defined(CONFIG_ARCH_NEXELL)
return 0;
}
-int pwm_init(int pwm_id, int div, int invert)
+int s5p_pwm_init(int pwm_id, int div, int invert)
{
u32 val;
const struct s5p_timer *pwm =
val |= TCON_INVERTER(pwm_id);
writel(val, &pwm->tcon);
- pwm_enable(pwm_id);
+ s5p_pwm_enable(pwm_id);
return 0;
}
#include <asm/arch/clk.h>
#include <linux/delay.h>
-/* Use the old PWM interface for now */
-#undef CONFIG_DM_PWM
-#include <pwm.h>
-
DECLARE_GLOBAL_DATA_PTR;
unsigned long get_current_tick(void);
int timer_init(void)
{
/* PWM Timer 4 */
- pwm_init(4, MUX_DIV_4, 0);
- pwm_config(4, 100000, 100000);
- pwm_enable(4);
+ s5p_pwm_init(4, MUX_DIV_4, 0);
+ s5p_pwm_config(4, 100000, 100000);
+ s5p_pwm_enable(4);
/* Use this as the current monotonic time in us */
gd->arch.timer_reset_value = 0;
unsigned int tcnto4;
unsigned int tintcstat;
};
+
+int s5p_pwm_init (int pwm_id, int div, int invert);
+int s5p_pwm_config (int pwm_id, int duty_ns, int period_ns);
+int s5p_pwm_enable (int pwm_id);
+void s5p_pwm_disable (int pwm_id);
#endif /* __ASSEMBLY__ */
#endif
unsigned int tcnto4;
unsigned int tintcstat;
};
+
+int s5p_pwm_init (int pwm_id, int div, int invert);
+int s5p_pwm_config (int pwm_id, int duty_ns, int period_ns);
+int s5p_pwm_enable (int pwm_id);
+void s5p_pwm_disable (int pwm_id);
#endif /* __ASSEMBLY__ */
#endif
unsigned int tcnto4;
unsigned int tintcstat;
};
+
+int s5p_pwm_init (int pwm_id, int div, int invert);
+int s5p_pwm_config (int pwm_id, int duty_ns, int period_ns);
+int s5p_pwm_enable (int pwm_id);
+void s5p_pwm_disable (int pwm_id);
#endif /* __ASSEMBLY__ */
#endif
#elif defined(BACKLIGHT_CH)
/* pwm backlight ON: HIGH, ON: LOW */
- pwm_init(BACKLIGHT_CH,
+ s5p_pwm_init(BACKLIGHT_CH,
BACKLIGHT_DIV, BACKLIGHT_INV);
- pwm_config(BACKLIGHT_CH,
+ s5p_pwm_config(BACKLIGHT_CH,
TO_DUTY_NS(BACKLIGHT_DUTY, BACKLIGHT_HZ),
TO_PERIOD_NS(BACKLIGHT_HZ));
#endif
#include <errno.h>
#include <asm/io.h>
#include <asm/arch/clk.h>
+#include <asm/arch/pwm.h>
#include <i2c.h>
-#include <pwm.h>
#include <irq_func.h>
/* range: 1080~1970 */
period_ns -= 1525;
- return pwm_config(PWM_CH, period_ns >> 1, period_ns);
+ return s5p_pwm_config(PWM_CH, period_ns >> 1, period_ns);
}
static void wait_one_tick(void)