Lines Matching +full:- +full:sram

18 #include "hw-ops.h"
42 struct ath9k_hw_mci *mci_hw = &ah->btcoex_hw.mci; in ar9003_hw_is_aic_enabled()
46 * HW code and the driver-layer support ready. in ar9003_hw_is_aic_enabled()
50 if (mci_hw->config & ATH_MCI_CONFIG_DISABLE_AIC) in ar9003_hw_is_aic_enabled()
67 for (i = index - 1; i >= 0; i--) { in ar9003_aic_find_valid()
74 i = -1; in ar9003_aic_find_valid()
84 int16_t i = -1; in ar9003_aic_find_index()
87 for (i = ATH_AIC_MAX_AIC_LIN_TABLE - 1; i >= 0; i--) { in ar9003_aic_find_index()
94 i--; in ar9003_aic_find_index()
100 i = -1; in ar9003_aic_find_index()
116 (0x1f & 0x1f); /* -01 dB: 4'd1, 5'd31, 00 dB: 4'd0, 5'd31 */ in ar9003_aic_gain_table()
118 (0x1f & 0x1f); /* -03 dB: 4'd3, 5'd31, -02 dB: 4'd2, 5'd31 */ in ar9003_aic_gain_table()
120 (0x1f & 0x1f); /* -05 dB: 4'd5, 5'd31, -04 dB: 4'd4, 5'd31 */ in ar9003_aic_gain_table()
122 (0x1e & 0x1f); /* -07 dB: 4'd1, 5'd30, -06 dB: 4'd0, 5'd30 */ in ar9003_aic_gain_table()
124 (0x1e & 0x1f); /* -09 dB: 4'd3, 5'd30, -08 dB: 4'd2, 5'd30 */ in ar9003_aic_gain_table()
126 (0x1e & 0x1f); /* -11 dB: 4'd5, 5'd30, -10 dB: 4'd4, 5'd30 */ in ar9003_aic_gain_table()
128 (0xf & 0x1f); /* -13 dB: 4'd1, 5'd15, -12 dB: 4'd0, 5'd15 */ in ar9003_aic_gain_table()
130 (0xf & 0x1f); /* -15 dB: 4'd3, 5'd15, -14 dB: 4'd2, 5'd15 */ in ar9003_aic_gain_table()
132 (0xf & 0x1f); /* -17 dB: 4'd5, 5'd15, -16 dB: 4'd4, 5'd15 */ in ar9003_aic_gain_table()
134 (0x7 & 0x1f); /* -19 dB: 4'd1, 5'd07, -18 dB: 4'd0, 5'd07 */ in ar9003_aic_gain_table()
136 (0x7 & 0x1f); /* -21 dB: 4'd3, 5'd07, -20 dB: 4'd2, 5'd07 */ in ar9003_aic_gain_table()
138 (0x7 & 0x1f); /* -23 dB: 4'd5, 5'd07, -22 dB: 4'd4, 5'd07 */ in ar9003_aic_gain_table()
140 (0x7 & 0x1f); /* -25 dB: 4'd7, 5'd07, -24 dB: 4'd6, 5'd07 */ in ar9003_aic_gain_table()
142 (0x3 & 0x1f); /* -27 dB: 4'd3, 5'd03, -26 dB: 4'd2, 5'd03 */ in ar9003_aic_gain_table()
144 (0x3 & 0x1f); /* -29 dB: 4'd5, 5'd03, -28 dB: 4'd4, 5'd03 */ in ar9003_aic_gain_table()
146 (0x1 & 0x1f); /* -31 dB: 4'd1, 5'd01, -30 dB: 4'd0, 5'd01 */ in ar9003_aic_gain_table()
148 (0x1 & 0x1f); /* -33 dB: 4'd3, 5'd01, -32 dB: 4'd2, 5'd01 */ in ar9003_aic_gain_table()
150 (0x1 & 0x1f); /* -35 dB: 4'd5, 5'd01, -34 dB: 4'd4, 5'd01 */ in ar9003_aic_gain_table()
152 (0x1 & 0x1f); /* -37 dB: 4'd7, 5'd01, -36 dB: 4'd6, 5'd01 */ in ar9003_aic_gain_table()
167 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_cal_start()
177 aic->aic_sram[i] = 0; in ar9003_aic_cal_start()
251 aic->aic_cal_start_time = REG_READ(ah, AR_TSF_L32); in ar9003_aic_cal_start()
258 aic->aic_caled_chan = 0; in ar9003_aic_cal_start()
259 aic->aic_cal_state = AIC_CAL_STATE_STARTED; in ar9003_aic_cal_start()
261 return aic->aic_cal_state; in ar9003_aic_cal_start()
266 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_cal_post_process()
279 struct ath_aic_sram_info sram; in ar9003_aic_cal_post_process() local
280 value = aic->aic_sram[i]; in ar9003_aic_cal_post_process()
282 cal_sram_valid[i] = sram.valid = in ar9003_aic_cal_post_process()
284 sram.rot_quad_att_db = in ar9003_aic_cal_post_process()
286 sram.vga_quad_sign = in ar9003_aic_cal_post_process()
288 sram.rot_dir_att_db = in ar9003_aic_cal_post_process()
290 sram.vga_dir_sign = in ar9003_aic_cal_post_process()
292 sram.com_att_6db = in ar9003_aic_cal_post_process()
295 if (sram.valid) { in ar9003_aic_cal_post_process()
296 dir_path_gain_idx = sram.rot_dir_att_db + in ar9003_aic_cal_post_process()
297 com_att_db_table[sram.com_att_6db]; in ar9003_aic_cal_post_process()
298 quad_path_gain_idx = sram.rot_quad_att_db + in ar9003_aic_cal_post_process()
299 com_att_db_table[sram.com_att_6db]; in ar9003_aic_cal_post_process()
301 dir_path_sign = (sram.vga_dir_sign) ? 1 : -1; in ar9003_aic_cal_post_process()
302 quad_path_sign = (sram.vga_quad_sign) ? 1 : -1; in ar9003_aic_cal_post_process()
331 ((aic_sram[start_idx].dir_path_gain_lin - in ar9003_aic_cal_post_process()
333 (start_idx - i) + ((end_idx - i) >> 1)) / in ar9003_aic_cal_post_process()
334 (end_idx - i) + in ar9003_aic_cal_post_process()
337 ((aic_sram[start_idx].quad_path_gain_lin - in ar9003_aic_cal_post_process()
339 (start_idx - i) + ((end_idx - i) >> 1)) / in ar9003_aic_cal_post_process()
340 (end_idx - i) + in ar9003_aic_cal_post_process()
354 ((aic_sram[start_idx].dir_path_gain_lin - in ar9003_aic_cal_post_process()
356 (i - start_idx) + ((start_idx - end_idx) >> 1)) / in ar9003_aic_cal_post_process()
357 (start_idx - end_idx) + in ar9003_aic_cal_post_process()
360 ((aic_sram[start_idx].quad_path_gain_lin - in ar9003_aic_cal_post_process()
362 (i - start_idx) + ((start_idx - end_idx) >> 1)) / in ar9003_aic_cal_post_process()
363 (start_idx - end_idx) + in ar9003_aic_cal_post_process()
369 (((end_idx - i) * aic_sram[start_idx].dir_path_gain_lin) + in ar9003_aic_cal_post_process()
370 ((i - start_idx) * aic_sram[end_idx].dir_path_gain_lin) + in ar9003_aic_cal_post_process()
371 ((end_idx - start_idx) >> 1)) / in ar9003_aic_cal_post_process()
372 (end_idx - start_idx); in ar9003_aic_cal_post_process()
374 (((end_idx - i) * aic_sram[start_idx].quad_path_gain_lin) + in ar9003_aic_cal_post_process()
375 ((i - start_idx) * aic_sram[end_idx].quad_path_gain_lin) + in ar9003_aic_cal_post_process()
376 ((end_idx - start_idx) >> 1))/ in ar9003_aic_cal_post_process()
377 (end_idx - start_idx); in ar9003_aic_cal_post_process()
381 /* From dir/quad_path_gain_lin to sram. */ in ar9003_aic_cal_post_process()
387 fixed_com_att_db = com_att_db_table[MS(aic->aic_sram[i], in ar9003_aic_cal_post_process()
392 struct ath_aic_sram_info sram; in ar9003_aic_cal_post_process() local
394 sram.vga_dir_sign = in ar9003_aic_cal_post_process()
396 sram.vga_quad_sign = in ar9003_aic_cal_post_process()
400 ar9003_aic_find_index(0, abs(aic_sram[i].dir_path_gain_lin)) - in ar9003_aic_cal_post_process()
403 ar9003_aic_find_index(0, abs(aic_sram[i].quad_path_gain_lin)) - in ar9003_aic_cal_post_process()
406 sram.com_att_6db = in ar9003_aic_cal_post_process()
409 sram.valid = true; in ar9003_aic_cal_post_process()
411 sram.rot_dir_att_db = in ar9003_aic_cal_post_process()
415 sram.rot_quad_att_db = in ar9003_aic_cal_post_process()
420 aic->aic_sram[i] = (SM(sram.vga_dir_sign, in ar9003_aic_cal_post_process()
422 SM(sram.vga_quad_sign, in ar9003_aic_cal_post_process()
424 SM(sram.com_att_6db, in ar9003_aic_cal_post_process()
426 SM(sram.valid, in ar9003_aic_cal_post_process()
428 SM(sram.rot_dir_att_db, in ar9003_aic_cal_post_process()
430 SM(sram.rot_quad_att_db, in ar9003_aic_cal_post_process()
439 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_cal_done()
447 aic->aic_cal_state = AIC_CAL_STATE_DONE; in ar9003_aic_cal_done()
449 aic->aic_cal_state = AIC_CAL_STATE_ERROR; in ar9003_aic_cal_done()
455 struct ath9k_hw_mci *mci_hw = &ah->btcoex_hw.mci; in ar9003_aic_cal_continue()
456 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_cal_continue()
459 num_chan = MS(mci_hw->config, ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN); in ar9003_aic_cal_continue()
462 aic->aic_cal_state = AIC_CAL_STATE_ERROR; in ar9003_aic_cal_continue()
463 return aic->aic_cal_state; in ar9003_aic_cal_continue()
495 if (aic->aic_sram[i] == 0) in ar9003_aic_cal_continue()
496 aic->aic_caled_chan++; in ar9003_aic_cal_continue()
498 aic->aic_sram[i] = value; in ar9003_aic_cal_continue()
505 if ((aic->aic_caled_chan >= num_chan) || cal_once) { in ar9003_aic_cal_continue()
515 return aic->aic_cal_state; in ar9003_aic_cal_continue()
521 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_calibration()
524 switch (aic->aic_cal_state) { in ar9003_aic_calibration()
543 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_start_normal()
546 if (aic->aic_cal_state != AIC_CAL_STATE_DONE) in ar9003_aic_start_normal()
554 REG_WRITE(ah, AR_PHY_AIC_SRAM_DATA_B1, aic->aic_sram[i]); in ar9003_aic_start_normal()
568 aic->aic_enabled = true; in ar9003_aic_start_normal()
575 struct ath9k_hw_aic *aic = &ah->btcoex_hw.aic; in ar9003_aic_cal_reset()
577 aic->aic_cal_state = AIC_CAL_STATE_IDLE; in ar9003_aic_cal_reset()
578 return aic->aic_cal_state; in ar9003_aic_cal_reset()
583 struct ath9k_hw_mci *mci_hw = &ah->btcoex_hw.mci; in ar9003_aic_calibration_single()
587 num_chan = MS(mci_hw->config, ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN); in ar9003_aic_calibration_single()
599 priv_ops->is_aic_enabled = ar9003_hw_is_aic_enabled; in ar9003_hw_attach_aic_ops()