clock.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * arch/sh/kernel/cpu/clock.c - SuperH clock framework
  4. *
  5. * Copyright (C) 2005 - 2009 Paul Mundt
  6. *
  7. * This clock framework is derived from the OMAP version by:
  8. *
  9. * Copyright (C) 2004 - 2008 Nokia Corporation
  10. * Written by Tuukka Tikkanen <[email protected]>
  11. *
  12. * Modified for omap shared clock framework by Tony Lindgren <[email protected]>
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/clk.h>
  17. #include <asm/clock.h>
  18. #include <asm/machvec.h>
  19. int __init clk_init(void)
  20. {
  21. int ret;
  22. #ifndef CONFIG_COMMON_CLK
  23. ret = arch_clk_init();
  24. if (unlikely(ret)) {
  25. pr_err("%s: CPU clock registration failed.\n", __func__);
  26. return ret;
  27. }
  28. #endif
  29. if (sh_mv.mv_clk_init) {
  30. ret = sh_mv.mv_clk_init();
  31. if (unlikely(ret)) {
  32. pr_err("%s: machvec clock initialization failed.\n",
  33. __func__);
  34. return ret;
  35. }
  36. }
  37. #ifndef CONFIG_COMMON_CLK
  38. /* Kick the child clocks.. */
  39. recalculate_root_clocks();
  40. /* Enable the necessary init clocks */
  41. clk_enable_init_clocks();
  42. #endif
  43. return ret;
  44. }