clock-pxa2xx.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * linux/arch/arm/mach-pxa/clock-pxa2xx.c
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/module.h>
  9. #include <linux/kernel.h>
  10. #include <linux/init.h>
  11. #include <linux/io.h>
  12. #include <linux/syscore_ops.h>
  13. #include <mach/pxa2xx-regs.h>
  14. #include "clock.h"
  15. void clk_pxa2xx_cken_enable(struct clk *clk)
  16. {
  17. CKEN |= 1 << clk->cken;
  18. }
  19. void clk_pxa2xx_cken_disable(struct clk *clk)
  20. {
  21. CKEN &= ~(1 << clk->cken);
  22. }
  23. const struct clkops clk_pxa2xx_cken_ops = {
  24. .enable = clk_pxa2xx_cken_enable,
  25. .disable = clk_pxa2xx_cken_disable,
  26. };
  27. #ifdef CONFIG_PM
  28. static uint32_t saved_cken;
  29. static int pxa2xx_clock_suspend(void)
  30. {
  31. saved_cken = CKEN;
  32. return 0;
  33. }
  34. static void pxa2xx_clock_resume(void)
  35. {
  36. CKEN = saved_cken;
  37. }
  38. #else
  39. #define pxa2xx_clock_suspend NULL
  40. #define pxa2xx_clock_resume NULL
  41. #endif
  42. struct syscore_ops pxa2xx_clock_syscore_ops = {
  43. .suspend = pxa2xx_clock_suspend,
  44. .resume = pxa2xx_clock_resume,
  45. };