diff options
author | Jingchang Lu <b35083@freescale.com> | 2012-09-12 13:30:52 +0800 |
---|---|---|
committer | Andy Voltz <andy.voltz@timesys.com> | 2012-10-17 14:37:21 -0400 |
commit | 4663b72fb93a520b6455579d76ed4c1dff46fb05 (patch) | |
tree | 1ec9d7861aba631fcdf10ed42b778e27dc7e67c4 | |
parent | 7535a20e4ea8d18b1f37f3cf5063573e0718f026 (diff) |
ENGR00180956-1: Add FlexTimer PWM device clock for Faraday
Signed-off-by: Jingchang Lu <b35083@freescale.com>
-rw-r--r-- | arch/arm/mach-mvf/clock.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-mvf/clock.c b/arch/arm/mach-mvf/clock.c index 29cc445fc799..9340d121d25e 100644 --- a/arch/arm/mach-mvf/clock.c +++ b/arch/arm/mach-mvf/clock.c @@ -1613,6 +1613,33 @@ static struct clk i2c_clk[] = { }, }; +static int ftm_pwm_clk_enable(struct clk *pwm_clk) +{ + u32 reg; + /* enable FTM fixed and external clk */ + reg = __raw_readl(MXC_CCM_CSCDR1); + reg |= (0x0F << 25); + __raw_writel(reg, MXC_CCM_CSCDR1); + + return 0; +} +static void ftm_pwm_clk_disable(struct clk *pwm_clk) +{ + u32 reg; + reg = __raw_readl(MXC_CCM_CSCDR1); + reg &= ~(0x0F << 25); + __raw_writel(reg, MXC_CCM_CSCDR1); + +} + +static struct clk ftm_pwm_clk = { + __INIT_CLK_DEBUG(ftm_pwm_clk) + .parent = &ipg_clk, + .enable = ftm_pwm_clk_enable, + .disable = ftm_pwm_clk_disable, + +}; + static struct clk dummy_clk = { .id = 0, }; @@ -1664,6 +1691,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "usb-clk", usb_clk), _REGISTER_CLOCK(NULL, "mvf-usb.0", usb_phy0_clk), _REGISTER_CLOCK(NULL, "mvf-usb.1", usb_phy1_clk), + _REGISTER_CLOCK(NULL, "pwm", ftm_pwm_clk), }; static void clk_tree_init(void) |