clock.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * arch/sh/kernel/cpu/clock.c - SuperH clock framework
  3. *
  4. * Copyright (C) 2005 - 2009 Paul Mundt
  5. *
  6. * This clock framework is derived from the OMAP version by:
  7. *
  8. * Copyright (C) 2004 - 2008 Nokia Corporation
  9. * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
  10. *
  11. * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
  12. *
  13. * This file is subject to the terms and conditions of the GNU General Public
  14. * License. See the file "COPYING" in the main directory of this archive
  15. * for more details.
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/clk.h>
  20. #include <asm/clock.h>
  21. #include <asm/machvec.h>
  22. int __init clk_init(void)
  23. {
  24. int ret;
  25. ret = arch_clk_init();
  26. if (unlikely(ret)) {
  27. pr_err("%s: CPU clock registration failed.\n", __func__);
  28. return ret;
  29. }
  30. if (sh_mv.mv_clk_init) {
  31. ret = sh_mv.mv_clk_init();
  32. if (unlikely(ret)) {
  33. pr_err("%s: machvec clock initialization failed.\n",
  34. __func__);
  35. return ret;
  36. }
  37. }
  38. /* Kick the child clocks.. */
  39. recalculate_root_clocks();
  40. /* Enable the necessary init clocks */
  41. clk_enable_init_clocks();
  42. return ret;
  43. }