clock.c 906 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * linux/arch/arm/mach-nomadik/clock.c
  3. *
  4. * Copyright (C) 2009 Alessandro Rubini
  5. */
  6. #include <linux/kernel.h>
  7. #include <linux/module.h>
  8. #include <linux/errno.h>
  9. #include <linux/clk.h>
  10. #include <asm/clkdev.h>
  11. #include "clock.h"
  12. /*
  13. * The nomadik board uses generic clocks, but the serial pl011 file
  14. * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them
  15. */
  16. unsigned long clk_get_rate(struct clk *clk)
  17. {
  18. return clk->rate;
  19. }
  20. EXPORT_SYMBOL(clk_get_rate);
  21. /* enable and disable do nothing */
  22. int clk_enable(struct clk *clk)
  23. {
  24. return 0;
  25. }
  26. EXPORT_SYMBOL(clk_enable);
  27. void clk_disable(struct clk *clk)
  28. {
  29. }
  30. EXPORT_SYMBOL(clk_disable);
  31. /* Create a clock structure with the given name */
  32. int nmdk_clk_create(struct clk *clk, const char *dev_id)
  33. {
  34. struct clk_lookup *clkdev;
  35. clkdev = clkdev_alloc(clk, NULL, dev_id);
  36. if (!clkdev)
  37. return -ENOMEM;
  38. clkdev_add(clkdev);
  39. return 0;
  40. }