clock.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright 2011 Calxeda, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include <linux/module.h>
  17. #include <linux/kernel.h>
  18. #include <linux/errno.h>
  19. #include <linux/clk.h>
  20. #include <linux/clkdev.h>
  21. struct clk {
  22. unsigned long rate;
  23. };
  24. int clk_enable(struct clk *clk)
  25. {
  26. return 0;
  27. }
  28. void clk_disable(struct clk *clk)
  29. {}
  30. unsigned long clk_get_rate(struct clk *clk)
  31. {
  32. return clk->rate;
  33. }
  34. long clk_round_rate(struct clk *clk, unsigned long rate)
  35. {
  36. return clk->rate;
  37. }
  38. int clk_set_rate(struct clk *clk, unsigned long rate)
  39. {
  40. return 0;
  41. }
  42. static struct clk eclk = { .rate = 200000000 };
  43. static struct clk pclk = { .rate = 150000000 };
  44. static struct clk_lookup lookups[] = {
  45. { .clk = &pclk, .con_id = "apb_pclk", },
  46. { .clk = &pclk, .dev_id = "sp804", },
  47. { .clk = &eclk, .dev_id = "ffe0e000.sdhci", },
  48. { .clk = &pclk, .dev_id = "fff36000.serial", },
  49. };
  50. void __init highbank_clocks_init(void)
  51. {
  52. clkdev_add_table(lookups, ARRAY_SIZE(lookups));
  53. }