thead_sys.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*************************************************************************/ /*!
  2. @File
  3. @Title System Description Header
  4. @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
  5. @Description This header provides system-specific declarations and macros
  6. @License Dual MIT/GPLv2
  7. The contents of this file are subject to the MIT license as set out below.
  8. Permission is hereby granted, free of charge, to any person obtaining a copy
  9. of this software and associated documentation files (the "Software"), to deal
  10. in the Software without restriction, including without limitation the rights
  11. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. copies of the Software, and to permit persons to whom the Software is
  13. furnished to do so, subject to the following conditions:
  14. The above copyright notice and this permission notice shall be included in
  15. all copies or substantial portions of the Software.
  16. Alternatively, the contents of this file may be used under the terms of
  17. the GNU General Public License Version 2 ("GPL") in which case the provisions
  18. of GPL are applicable instead of those above.
  19. If you wish to allow use of your version of this file only under the terms of
  20. GPL, and not to allow others to use your version of this file under the terms
  21. of the MIT license, indicate your decision by deleting the provisions above
  22. and replace them with the notice and other provisions required by GPL as set
  23. out in the file called "GPL-COPYING" included in this distribution. If you do
  24. not delete the provisions above, a recipient may use your version of this file
  25. under the terms of either the MIT license or GPL.
  26. This License is also included in this distribution in the file called
  27. "MIT-COPYING".
  28. EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
  29. PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  30. BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  31. PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
  32. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  33. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  34. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  35. */ /**************************************************************************/
  36. #ifndef THEAD_SYS_H
  37. #define THEAD_SYS_H
  38. #include <linux/device.h>
  39. #define ENABLE_THEAD_DEBUG 0
  40. #if ENABLE_THEAD_DEBUG
  41. #define thead_debug(fmt, args...) pr_info("[THEAD_CLK]" fmt, ##args)
  42. #else
  43. #define thead_debug(fmt, args...) do { } while (0)
  44. #endif
  45. struct gpu_plat_if {
  46. struct device *dev;
  47. /* mutex protect for set power state */
  48. struct mutex set_power_state;
  49. struct clk *gpu_cclk;
  50. struct clk *gpu_aclk;
  51. struct regmap *vosys_regmap;
  52. };
  53. struct gpu_plat_if *dt_hw_init(struct device *dev);
  54. void dt_hw_uninit(struct gpu_plat_if *mfg);
  55. int thead_mfg_enable(struct gpu_plat_if *mfg);
  56. void thead_mfg_disable(struct gpu_plat_if *mfg);
  57. #endif /* THEAD_SYS_H*/