aess.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * AESS IP block reset
  3. *
  4. * Copyright (C) 2012 Texas Instruments, Inc.
  5. * Paul Walmsley
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation version 2.
  10. *
  11. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  12. * kind, whether express or implied; without even the implied warranty
  13. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #ifndef __SOUND_AESS_H__
  22. #define __SOUND_AESS_H__
  23. #include <linux/kernel.h>
  24. #include <linux/io.h>
  25. /*
  26. * AESS_AUTO_GATING_ENABLE_OFFSET: offset in bytes of the AESS IP
  27. * block's AESS_AUTO_GATING_ENABLE__1 register from the IP block's
  28. * base address
  29. */
  30. #define AESS_AUTO_GATING_ENABLE_OFFSET 0x07c
  31. /* Register bitfields in the AESS_AUTO_GATING_ENABLE__1 register */
  32. #define AESS_AUTO_GATING_ENABLE_SHIFT 0
  33. /**
  34. * aess_enable_autogating - enable AESS internal autogating
  35. * @oh: struct omap_hwmod *
  36. *
  37. * Enable internal autogating on the AESS. This allows the AESS to
  38. * indicate that it is idle to the OMAP PRCM. Returns 0.
  39. */
  40. static inline void aess_enable_autogating(void __iomem *base)
  41. {
  42. u32 v;
  43. /* Set AESS_AUTO_GATING_ENABLE__1.ENABLE to allow idle entry */
  44. v = 1 << AESS_AUTO_GATING_ENABLE_SHIFT;
  45. writel(v, base + AESS_AUTO_GATING_ENABLE_OFFSET);
  46. }
  47. #endif /* __SOUND_AESS_H__ */