xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8189fs/hal/phydm/rtl8188f/phydm_rtl8188f.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  *****************************************************************************/
15 
16 /* ************************************************************
17  * include files
18  * ************************************************************ */
19 
20 #include "mp_precomp.h"
21 #include "../phydm_precomp.h"
22 
23 #if (RTL8188F_SUPPORT == 1)
24 
phydm_cck_rssi_8188f(struct dm_struct * dm,u8 lna_idx,u8 vga_idx)25 s8 phydm_cck_rssi_8188f(struct dm_struct *dm, u8 lna_idx, u8 vga_idx)
26 {
27 	s8 rx_pwr_all = 0x00;
28 	switch (lna_idx) {
29 	case 7:
30 		if (vga_idx <= 27)
31 			rx_pwr_all = -100 + 2 * (27 - vga_idx);
32 		else
33 			rx_pwr_all = -100;
34 		break;
35 
36 	case 5:
37 		rx_pwr_all = -74 + 2 * (21 - vga_idx);
38 		break;
39 
40 	case 3:
41 		rx_pwr_all = -60 + 2 * (20 - vga_idx);
42 		break;
43 
44 	case 1:
45 		rx_pwr_all = -44 + 2 * (19 - vga_idx);
46 		break;
47 
48 	default:
49 		break;
50 	}
51 	return rx_pwr_all;
52 }
odm_hw_setting_8188F(struct dm_struct * dm)53 void odm_hw_setting_8188F(struct dm_struct *dm){
54 	if (dm->is_R2R_CCA_MASKT_TIME_SHORT)
55 		odm_set_bb_reg(dm,0x814,0xffff,0x3110);
56 	else
57 		odm_set_bb_reg(dm,0x814,0xffff,0x3d10);
58 }
59 
60 #endif
61