cm4xxx.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * OMAP4 CM module functions
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. * Paul Walmsley
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/module.h>
  13. #include <linux/types.h>
  14. #include <linux/delay.h>
  15. #include <linux/spinlock.h>
  16. #include <linux/list.h>
  17. #include <linux/errno.h>
  18. #include <linux/err.h>
  19. #include <linux/io.h>
  20. #include <asm/atomic.h>
  21. #include "cm.h"
  22. /* XXX move this to cm.h */
  23. /* MAX_MODULE_READY_TIME: max milliseconds for module to leave idle */
  24. #define MAX_MODULE_READY_TIME 20000
  25. /*
  26. * OMAP4_PRCM_CM_CLKCTRL_IDLEST_MASK: isolates the IDLEST field in the
  27. * CM_CLKCTRL register.
  28. */
  29. #define OMAP4_PRCM_CM_CLKCTRL_IDLEST_MASK (0x2 << 16)
  30. /*
  31. * OMAP4 prcm_mod u32 fields contain packed data: the CM ID in bit 16 and
  32. * the PRCM module offset address (from the CM module base) in bits 15-0.
  33. */
  34. #define OMAP4_PRCM_MOD_CM_ID_SHIFT 16
  35. #define OMAP4_PRCM_MOD_OFFS_MASK 0xffff
  36. /**
  37. * omap4_cm_wait_idlest_ready - wait for a module to leave idle or standby
  38. * @prcm_mod: PRCM module offset (XXX example)
  39. * @prcm_dev_offs: PRCM device offset (e.g. MCASP XXX example)
  40. *
  41. * XXX document
  42. */
  43. int omap4_cm_wait_idlest_ready(u32 prcm_mod, u8 prcm_dev_offs)
  44. {
  45. /* FIXME: Add clock manager related code */
  46. return 0;
  47. }