ar9003_aic.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2015 Qualcomm Atheros Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef AR9003_AIC_H
  17. #define AR9003_AIC_H
  18. #define ATH_AIC_MAX_COM_ATT_DB_TABLE 6
  19. #define ATH_AIC_MAX_AIC_LIN_TABLE 69
  20. #define ATH_AIC_MIN_ROT_DIR_ATT_DB 0
  21. #define ATH_AIC_MIN_ROT_QUAD_ATT_DB 0
  22. #define ATH_AIC_MAX_ROT_DIR_ATT_DB 37
  23. #define ATH_AIC_MAX_ROT_QUAD_ATT_DB 37
  24. #define ATH_AIC_SRAM_AUTO_INCREMENT 0x80000000
  25. #define ATH_AIC_SRAM_GAIN_TABLE_OFFSET 0x280
  26. #define ATH_AIC_SRAM_CAL_OFFSET 0x140
  27. #define ATH_AIC_SRAM_OFFSET 0x00
  28. #define ATH_AIC_MEAS_MAG_THRESH 20
  29. #define ATH_AIC_BT_JUPITER_CTRL 0x66820
  30. #define ATH_AIC_BT_AIC_ENABLE 0x02
  31. enum aic_cal_state {
  32. AIC_CAL_STATE_IDLE = 0,
  33. AIC_CAL_STATE_STARTED,
  34. AIC_CAL_STATE_DONE,
  35. AIC_CAL_STATE_ERROR
  36. };
  37. struct ath_aic_sram_info {
  38. bool valid:1;
  39. bool vga_quad_sign:1;
  40. bool vga_dir_sign:1;
  41. u8 rot_quad_att_db;
  42. u8 rot_dir_att_db;
  43. u8 com_att_6db;
  44. };
  45. struct ath_aic_out_info {
  46. int16_t dir_path_gain_lin;
  47. int16_t quad_path_gain_lin;
  48. struct ath_aic_sram_info sram;
  49. };
  50. u8 ar9003_aic_calibration(struct ath_hw *ah);
  51. u8 ar9003_aic_start_normal(struct ath_hw *ah);
  52. u8 ar9003_aic_cal_reset(struct ath_hw *ah);
  53. u8 ar9003_aic_calibration_single(struct ath_hw *ah);
  54. #endif /* AR9003_AIC_H */