net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / hal / btc / halbtc8822bwifionly.c
1 #include "mp_precomp.h"
2
3
4 VOID
5 ex_hal8822b_wifi_only_hw_config(
6         IN struct wifi_only_cfg *pwifionlycfg
7         )
8 {
9         /*BB control*/
10         halwifionly_phy_set_bb_reg(pwifionlycfg, 0x4c, 0x01800000, 0x2);
11         /*SW control*/
12         halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcb4, 0xff, 0x77);
13         /*antenna mux switch */
14         halwifionly_phy_set_bb_reg(pwifionlycfg, 0x974, 0x300, 0x3);
15
16         halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1990, 0x300, 0x0);
17
18         halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcbc, 0x80000, 0x0);
19         /*switch to WL side controller and gnt_wl gnt_bt debug signal */
20         halwifionly_phy_set_bb_reg(pwifionlycfg, 0x70, 0xff000000, 0x0e);
21         /*gnt_wl=1 , gnt_bt=0*/
22         halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1704, 0xffffffff, 0x7700);
23         halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1700, 0xffffffff, 0xc00f0038);
24 }
25
26 VOID
27 ex_hal8822b_wifi_only_scannotify(
28         IN struct wifi_only_cfg *pwifionlycfg,
29         IN u1Byte  is_5g
30         )
31 {
32         hal8822b_wifi_only_switch_antenna(pwifionlycfg, is_5g);
33 }
34
35 VOID
36 ex_hal8822b_wifi_only_switchbandnotify(
37         IN struct wifi_only_cfg *pwifionlycfg,
38         IN u1Byte  is_5g
39         )
40 {
41         hal8822b_wifi_only_switch_antenna(pwifionlycfg, is_5g);
42 }
43
44 VOID
45 hal8822b_wifi_only_switch_antenna(IN struct wifi_only_cfg *pwifionlycfg,
46         IN u1Byte  is_5g
47         )
48 {
49
50         if (is_5g)
51                 halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcbc, 0x300, 0x1);
52         else
53                 halwifionly_phy_set_bb_reg(pwifionlycfg, 0xcbc, 0x300, 0x2);
54 }