aw87519_audio.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef __AW87519_H__
  2. #define __AW87519_H__
  3. unsigned char aw87519_spk_cfg_default[] = {
  4. 0x69, 0x80,
  5. 0x69, 0xB7,
  6. 0x01, 0xF0,
  7. 0x02, 0x09,
  8. 0x03, 0xE8,
  9. 0x04, 0x11,
  10. 0x05, 0x10,
  11. 0x06, 0x43,
  12. 0x07, 0x4E,
  13. 0x08, 0x03,
  14. 0x09, 0x08,
  15. 0x0A, 0x4A,
  16. 0x60, 0x16,
  17. 0x61, 0x20,
  18. 0x62, 0x01,
  19. 0x63, 0x0B,
  20. 0x64, 0xC5,
  21. 0x65, 0xA4,
  22. 0x66, 0x78,
  23. 0x67, 0xC4,
  24. 0x68, 0XD0
  25. };
  26. unsigned char aw87519_rcv_cfg_default[] = {
  27. 0x69, 0x80,
  28. 0x69, 0xB7,
  29. 0x01, 0xF8,
  30. 0x02, 0x09,
  31. 0x03, 0xC8,
  32. 0x04, 0x11,
  33. 0x05, 0x05,
  34. 0x06, 0x53,
  35. 0x07, 0x4E,
  36. 0x08, 0x0B,
  37. 0x09, 0x08,
  38. 0x0A, 0x4B,
  39. 0x60, 0x16,
  40. 0x61, 0x20,
  41. 0x62, 0x01,
  42. 0x63, 0x0B,
  43. 0x64, 0xC5,
  44. 0x65, 0xA4,
  45. 0x66, 0x78,
  46. 0x67, 0xC4,
  47. 0x68, 0XD0
  48. };
  49. /******************************************************
  50. *
  51. *Load config function
  52. *This driver will use load firmware if AW20036_BIN_CONFIG be defined
  53. *****************************************************/
  54. //#define AWINIC_CFG_UPDATE_DELAY
  55. #define AW_I2C_RETRIES 5
  56. #define AW_I2C_RETRY_DELAY 2
  57. #define AW_READ_CHIPID_RETRIES 5
  58. #define AW_READ_CHIPID_RETRY_DELAY 2
  59. #define REG_CHIPID 0x00
  60. #define REG_SYSCTRL 0x01
  61. #define REG_BATSAFE 0x02
  62. #define REG_BSTOVR 0x03
  63. #define REG_BSTVPR 0x04
  64. #define REG_PAGR 0x05
  65. #define REG_PAGC3OPR 0x06
  66. #define REG_PAGC3PR 0x07
  67. #define REG_PAGC2OPR 0x08
  68. #define REG_PAGC2PR 0x09
  69. #define REG_PAGC1PR 0x0A
  70. #define AW87519_CHIPID 0x59
  71. #define AW87519_REG_MAX 11
  72. struct aw87519_container {
  73. int len;
  74. unsigned char data[];
  75. };
  76. struct aw87519 {
  77. struct i2c_client *i2c_client;
  78. int reset_gpio;
  79. unsigned char hwen_flag;
  80. unsigned char spk_cfg_update_flag;
  81. unsigned char rcv_cfg_update_flag;
  82. struct hrtimer cfg_timer;
  83. struct mutex cfg_lock;
  84. struct work_struct cfg_work;
  85. struct delayed_work ram_work;
  86. };
  87. /*******************************************************************************
  88. * aw87519 functions
  89. ******************************************************************************/
  90. unsigned char aw87519_audio_receiver(void);
  91. unsigned char aw87519_audio_speaker(void);
  92. unsigned char aw87519_audio_off(void);
  93. #endif