Commit fe617af7 authored by Peter 'p2' De Schrijver's avatar Peter 'p2' De Schrijver Committed by Kevin Hilman

OMAP: PM: Hook into PM counters

This patch modifies the clock, clockdomain and OMAP3 specific
powerdomain code to call the PM counter infrastructure whenever one or
more powerdomains might have changed state.
Signed-off-by: default avatarPeter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent ba20bb12
...@@ -1043,5 +1043,7 @@ void omap2_clk_disable_unused(struct clk *clk) ...@@ -1043,5 +1043,7 @@ void omap2_clk_disable_unused(struct clk *clk)
omap2_clk_disable(clk); omap2_clk_disable(clk);
} else } else
_omap2_clk_disable(clk); _omap2_clk_disable(clk);
if (clk->clkdm != NULL)
pwrdm_clkdm_state_switch(clk->clkdm);
} }
#endif #endif
...@@ -574,6 +574,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) ...@@ -574,6 +574,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
omap2_clkdm_wakeup(clkdm); omap2_clkdm_wakeup(clkdm);
pwrdm_wait_transition(clkdm->pwrdm.ptr); pwrdm_wait_transition(clkdm->pwrdm.ptr);
pwrdm_clkdm_state_switch(clkdm);
return 0; return 0;
} }
...@@ -626,6 +627,8 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) ...@@ -626,6 +627,8 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
else else
omap2_clkdm_sleep(clkdm); omap2_clkdm_sleep(clkdm);
pwrdm_clkdm_state_switch(clkdm);
return 0; return 0;
} }
...@@ -170,6 +170,8 @@ static void omap_sram_idle(void) ...@@ -170,6 +170,8 @@ static void omap_sram_idle(void)
printk(KERN_ERR "Invalid mpu state in sram_idle\n"); printk(KERN_ERR "Invalid mpu state in sram_idle\n");
return; return;
} }
pwrdm_pre_transition();
omap2_gpio_prepare_for_retention(); omap2_gpio_prepare_for_retention();
omap_uart_prepare_idle(0); omap_uart_prepare_idle(0);
omap_uart_prepare_idle(1); omap_uart_prepare_idle(1);
...@@ -182,6 +184,9 @@ static void omap_sram_idle(void) ...@@ -182,6 +184,9 @@ static void omap_sram_idle(void)
omap_uart_resume_idle(1); omap_uart_resume_idle(1);
omap_uart_resume_idle(0); omap_uart_resume_idle(0);
omap2_gpio_resume_after_retention(); omap2_gpio_resume_after_retention();
pwrdm_post_transition();
} }
/* /*
...@@ -271,6 +276,7 @@ static int set_pwrdm_state(struct powerdomain *pwrdm, u32 state) ...@@ -271,6 +276,7 @@ static int set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
if (sleep_switch) { if (sleep_switch) {
omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
pwrdm_wait_transition(pwrdm); pwrdm_wait_transition(pwrdm);
pwrdm_state_switch(pwrdm);
} }
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment