Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341931
b: refs/heads/master
c: b835763
h: refs/heads/master
i:
  341929: 7147a31
  341927: 7dd5bdf
v: v3
  • Loading branch information
Piotr Haber authored and John W. Linville committed Nov 30, 2012
1 parent 285e0f5 commit 5c1f6a0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 51 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e21df23894e12937fb3b51197bf5d0c4d7cc8ba
refs/heads/master: b83576341664957978e125f5f5db2f15496980b1
102 changes: 52 additions & 50 deletions trunk/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1860,41 +1860,6 @@ wlc_lcnphy_load_tx_iir_filter(struct brcms_phy *pi, bool is_ofdm, s16 filt_type)
return (filt_index != -1) ? 0 : -1;
}

void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, u16 chanspec)
{
u8 channel = CHSPEC_CHANNEL(chanspec);

wlc_phy_chanspec_radio_set((struct brcms_phy_pub *) pi, chanspec);

wlc_lcnphy_set_chanspec_tweaks(pi, pi->radio_chanspec);

or_phy_reg(pi, 0x44a, 0x44);
write_phy_reg(pi, 0x44a, 0x80);

wlc_lcnphy_radio_2064_channel_tune_4313(pi, channel);
udelay(1000);

wlc_lcnphy_toggle_afe_pwdn(pi);

write_phy_reg(pi, 0x657, lcnphy_sfo_cfg[channel - 1].ptcentreTs20);
write_phy_reg(pi, 0x658, lcnphy_sfo_cfg[channel - 1].ptcentreFactor);

if (CHSPEC_CHANNEL(pi->radio_chanspec) == 14) {
mod_phy_reg(pi, 0x448, (0x3 << 8), (2) << 8);

wlc_lcnphy_load_tx_iir_filter(pi, false, 3);
} else {
mod_phy_reg(pi, 0x448, (0x3 << 8), (1) << 8);

wlc_lcnphy_load_tx_iir_filter(pi, false, 2);
}

wlc_lcnphy_load_tx_iir_filter(pi, true, 0);

mod_phy_reg(pi, 0x4eb, (0x7 << 3), (1) << 3);

}

static u16 wlc_lcnphy_get_pa_gain(struct brcms_phy *pi)
{
u16 pa_gain;
Expand Down Expand Up @@ -1936,6 +1901,21 @@ static void wlc_lcnphy_set_tx_gain(struct brcms_phy *pi,
wlc_lcnphy_enable_tx_gain_override(pi);
}

static u8 wlc_lcnphy_get_bbmult(struct brcms_phy *pi)
{
u16 m0m1;
struct phytbl_info tab;

tab.tbl_ptr = &m0m1;
tab.tbl_len = 1;
tab.tbl_id = LCNPHY_TBL_ID_IQLOCAL;
tab.tbl_offset = 87;
tab.tbl_width = 16;
wlc_lcnphy_read_table(pi, &tab);

return (u8) ((m0m1 & 0xff00) >> 8);
}

static void wlc_lcnphy_set_bbmult(struct brcms_phy *pi, u8 m0)
{
u16 m0m1 = (u16) m0 << 8;
Expand Down Expand Up @@ -3075,21 +3055,6 @@ static void wlc_lcnphy_tx_pwr_ctrl_init(struct brcms_phy_pub *ppi)
wlapi_enable_mac(pi->sh->physhim);
}

static u8 wlc_lcnphy_get_bbmult(struct brcms_phy *pi)
{
u16 m0m1;
struct phytbl_info tab;

tab.tbl_ptr = &m0m1;
tab.tbl_len = 1;
tab.tbl_id = LCNPHY_TBL_ID_IQLOCAL;
tab.tbl_offset = 87;
tab.tbl_width = 16;
wlc_lcnphy_read_table(pi, &tab);

return (u8) ((m0m1 & 0xff00) >> 8);
}

static void wlc_lcnphy_set_pa_gain(struct brcms_phy *pi, u16 gain)
{
mod_phy_reg(pi, 0x4fb,
Expand Down Expand Up @@ -4946,6 +4911,43 @@ void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi)
}
}

void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, u16 chanspec)
{
u8 channel = CHSPEC_CHANNEL(chanspec);

wlc_phy_chanspec_radio_set((struct brcms_phy_pub *)pi, chanspec);

wlc_lcnphy_set_chanspec_tweaks(pi, pi->radio_chanspec);

or_phy_reg(pi, 0x44a, 0x44);
write_phy_reg(pi, 0x44a, 0x80);

wlc_lcnphy_radio_2064_channel_tune_4313(pi, channel);
udelay(1000);

wlc_lcnphy_toggle_afe_pwdn(pi);

write_phy_reg(pi, 0x657, lcnphy_sfo_cfg[channel - 1].ptcentreTs20);
write_phy_reg(pi, 0x658, lcnphy_sfo_cfg[channel - 1].ptcentreFactor);

if (CHSPEC_CHANNEL(pi->radio_chanspec) == 14) {
mod_phy_reg(pi, 0x448, (0x3 << 8), (2) << 8);

wlc_lcnphy_load_tx_iir_filter(pi, false, 3);
} else {
mod_phy_reg(pi, 0x448, (0x3 << 8), (1) << 8);

wlc_lcnphy_load_tx_iir_filter(pi, false, 2);
}

if (pi->sh->boardflags & BFL_FEM)
wlc_lcnphy_load_tx_iir_filter(pi, true, 0);
else
wlc_lcnphy_load_tx_iir_filter(pi, true, 3);

mod_phy_reg(pi, 0x4eb, (0x7 << 3), (1) << 3);
}

void wlc_phy_detach_lcnphy(struct brcms_phy *pi)
{
kfree(pi->u.pi_lcnphy);
Expand Down

0 comments on commit 5c1f6a0

Please sign in to comment.