wmt_cfg_parser.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #ifndef _WMT_CFG_PARSER_H_
  2. #define _WMT_CFG_PARSER_H_
  3. #include <linux/version.h>
  4. #include <linux/init.h>
  5. #include <linux/module.h>
  6. #include <linux/types.h>
  7. #include <linux/kernel.h>
  8. #include <linux/fs.h>
  9. #include <linux/cdev.h>
  10. #include <linux/sched.h>
  11. #include <linux/poll.h>
  12. #include <asm/current.h>
  13. #include <asm/uaccess.h>
  14. #include <linux/wait.h>
  15. #include <linux/time.h>
  16. #include <linux/delay.h>
  17. #include <linux/vmalloc.h>
  18. #include <linux/firmware.h>
  19. #include <linux/kthread.h>
  20. #include <linux/jiffies.h>
  21. #include <linux/slab.h>
  22. #include <linux/err.h>
  23. /*******************************************************************************
  24. * M A C R O S
  25. ********************************************************************************
  26. */
  27. #ifdef DFT_TAG
  28. #undef DFT_TAG
  29. #endif
  30. #define DFT_TAG "[WMT-CCCI]"
  31. #define WMT_CCCI_LOG_LOUD 4
  32. #define WMT_CCCI_LOG_DBG 3
  33. #define WMT_CCCI_LOG_INFO 2
  34. #define WMT_CCCI_LOG_WARN 1
  35. #define WMT_CCCI_LOG_ERR 0
  36. extern unsigned int wmtCcciLogLvl;
  37. #define WMT_CCCI_LOUD_FUNC(fmt, arg...) \
  38. do { \
  39. if (wmtCcciLogLvl >= WMT_CCCI_LOG_LOUD) \
  40. pr_debug(DFT_TAG "[L]%s:" fmt, __func__ , ##arg); \
  41. } while (0)
  42. #define WMT_CCCI_INFO_FUNC(fmt, arg...) \
  43. do { \
  44. if (wmtCcciLogLvl >= WMT_CCCI_LOG_INFO) \
  45. pr_debug(DFT_TAG "[I]%s:" fmt, __func__ , ##arg); \
  46. } while (0)
  47. #define WMT_CCCI_WARN_FUNC(fmt, arg...) \
  48. do { \
  49. if (wmtCcciLogLvl >= WMT_CCCI_LOG_WARN) \
  50. pr_warn(DFT_TAG "[W]%s:" fmt, __func__ , ##arg); \
  51. } while (0)
  52. #define WMT_CCCI_ERR_FUNC(fmt, arg...) \
  53. do { \
  54. if (wmtCcciLogLvl >= WMT_CCCI_LOG_ERR) \
  55. pr_err(DFT_TAG "[E]%s(%d):" fmt, __func__ , __LINE__, ##arg); \
  56. } while (0)
  57. #define WMT_CCCI_DBG_FUNC(fmt, arg...) \
  58. do { \
  59. if (wmtCcciLogLvl >= WMT_CCCI_LOG_DBG) \
  60. pr_debug(DFT_TAG "[D]%s:" fmt, __func__ , ##arg); \
  61. } while (0)
  62. #define wmt_ccci_assert(condition) \
  63. do { \
  64. if (!(condition)) \
  65. pr_err(DFT_TAG "%s, %d, (%s)\n", __FILE__, __LINE__, #condition); \
  66. } while (0)
  67. #ifndef NAME_MAX
  68. #define NAME_MAX 256
  69. #endif
  70. #define WMT_CFG_FILE "WMT_SOC.cfg"
  71. #define WMT_CFG_FILE_PREFIX "/system/etc/firmware/"
  72. /*******************************************************************************
  73. * D A T A T Y P E S
  74. ********************************************************************************
  75. */
  76. typedef struct _WMT_CONF_FILE_ {
  77. unsigned char cfgExist;
  78. unsigned char coex_wmt_ant_mode;
  79. /*GPS LNA setting */
  80. unsigned char wmt_gps_lna_pin;
  81. unsigned char wmt_gps_lna_enable;
  82. /*GPS co-clock setting */
  83. unsigned int co_clock_flag;
  84. } WMT_CONF_FILE, *P_WMT_CONF_FILE;
  85. typedef struct _WMT_PARSER_CONF_FOR_CCCI_ {
  86. WMT_CONF_FILE rWmtCfgFile;
  87. unsigned char cWmtCfgName[NAME_MAX + 1];
  88. const struct firmware *pWmtCfg;
  89. } WMT_PARSER_CONF_FOR_CCCI, *P_WMT_PARSER_CONF_FOR_CCCI;
  90. #endif