xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8723ds/hal/phydm/rtl8723d/phydm_rtl8723d.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 
21 #include "mp_precomp.h"
22 #include "../phydm_precomp.h"
23 
24 #if (RTL8723D_SUPPORT == 1)
25 
phydm_cckrssi_8723d(struct dm_struct * dm,u8 lna_idx,u8 vga_idx)26 s8 phydm_cckrssi_8723d(struct dm_struct *dm, u8 lna_idx, u8 vga_idx)
27 {
28 	s8 rx_pwr_all = 0x00;
29 
30 	switch (lna_idx) {
31 	case 0xf:
32 		rx_pwr_all = -46 - (2 * vga_idx);
33 		break;
34 	case 0xa:
35 		rx_pwr_all = -20 - (2 * vga_idx);
36 		break;
37 	case 7:
38 		rx_pwr_all = -10 - (2 * vga_idx);
39 		break;
40 	case 4:
41 		rx_pwr_all = 4 - (2 * vga_idx);
42 		break;
43 	default:
44 		break;
45 	}
46 
47 	return rx_pwr_all;
48 }
49 
50 #endif
51