cm44xx.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * OMAP4 CM1, CM2 module low-level functions
  3. *
  4. * Copyright (C) 2010 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. * These functions are intended to be used only by the cminst44xx.c file.
  12. * XXX Perhaps we should just move them there and make them static.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/types.h>
  16. #include <linux/errno.h>
  17. #include <linux/err.h>
  18. #include <linux/io.h>
  19. #include "iomap.h"
  20. #include "common.h"
  21. #include "cm.h"
  22. #include "cm1_44xx.h"
  23. #include "cm2_44xx.h"
  24. #include "cm-regbits-44xx.h"
  25. /* CM1 hardware module low-level functions */
  26. /* Read a register in CM1 */
  27. u32 omap4_cm1_read_inst_reg(s16 inst, u16 reg)
  28. {
  29. return __raw_readl(OMAP44XX_CM1_REGADDR(inst, reg));
  30. }
  31. /* Write into a register in CM1 */
  32. void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 reg)
  33. {
  34. __raw_writel(val, OMAP44XX_CM1_REGADDR(inst, reg));
  35. }
  36. /* Read a register in CM2 */
  37. u32 omap4_cm2_read_inst_reg(s16 inst, u16 reg)
  38. {
  39. return __raw_readl(OMAP44XX_CM2_REGADDR(inst, reg));
  40. }
  41. /* Write into a register in CM2 */
  42. void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 reg)
  43. {
  44. __raw_writel(val, OMAP44XX_CM2_REGADDR(inst, reg));
  45. }