aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Reis <idor@ti.com>2012-04-23 09:49:19 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-07 11:10:57 -0400
commit16ea4733210d741eeb5413acd261e675a12f980e (patch)
tree54c462ce566218f725927e971050e16e3d611572
parent73395a79df00c3e0101bd7a0229dbbcc065b606a (diff)
wl18xx: FW/PHY arguments added for PG2
PG2 requires 4 new parameters that to be passed to the PHY. Use the actual PHY initialization struct size for the mem size of the PHY_INIT section, to account for additions in params. [Make sure PG1 still gets the original struct - Arik] Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/ti/wl18xx/conf.h4
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c19
-rw-r--r--drivers/net/wireless/ti/wl18xx/reg.h6
3 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/conf.h b/drivers/net/wireless/ti/wl18xx/conf.h
index ffad302b6cb7..4e0f189b2539 100644
--- a/drivers/net/wireless/ti/wl18xx/conf.h
+++ b/drivers/net/wireless/ti/wl18xx/conf.h
@@ -44,6 +44,10 @@ struct wl18xx_conf_phy {
44 u8 clock_valid_on_wake_up; 44 u8 clock_valid_on_wake_up;
45 u8 secondary_clock_setting_time; 45 u8 secondary_clock_setting_time;
46 u8 pwr_limit_reference_11_abg; 46 u8 pwr_limit_reference_11_abg;
47 u8 psat;
48 s8 low_power_val;
49 s8 med_power_val;
50 s8 high_power_val;
47}; 51};
48 52
49struct wl18xx_priv_conf { 53struct wl18xx_priv_conf {
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 57b4a1089d0d..bdf4ee12914d 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -511,6 +511,10 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
511 .enable_tx_low_pwr_on_siso_rdl = 0x00, 511 .enable_tx_low_pwr_on_siso_rdl = 0x00,
512 .rx_profile = 0x00, 512 .rx_profile = 0x00,
513 .pwr_limit_reference_11_abg = 0xc8, 513 .pwr_limit_reference_11_abg = 0xc8,
514 .psat = 0,
515 .low_power_val = 0x00,
516 .med_power_val = 0x0a,
517 .high_power_val = 0x1e,
514 }, 518 },
515}; 519};
516 520
@@ -713,6 +717,7 @@ static void wl18xx_set_mac_and_phy(struct wl1271 *wl)
713 struct wl18xx_priv *priv = wl->priv; 717 struct wl18xx_priv *priv = wl->priv;
714 struct wl18xx_conf_phy *phy = &priv->conf.phy; 718 struct wl18xx_conf_phy *phy = &priv->conf.phy;
715 struct wl18xx_mac_and_phy_params params; 719 struct wl18xx_mac_and_phy_params params;
720 size_t len;
716 721
717 memset(&params, 0, sizeof(params)); 722 memset(&params, 0, sizeof(params));
718 723
@@ -752,9 +757,21 @@ static void wl18xx_set_mac_and_phy(struct wl1271 *wl)
752 757
753 params.board_type = priv->board_type; 758 params.board_type = priv->board_type;
754 759
760 /* for PG2 only */
761 params.psat = phy->psat;
762 params.low_power_val = phy->low_power_val;
763 params.med_power_val = phy->med_power_val;
764 params.high_power_val = phy->high_power_val;
765
766 /* the parameters struct is smaller for PG1 */
767 if (wl->chip.id == CHIP_ID_185x_PG10)
768 len = offsetof(struct wl18xx_mac_and_phy_params, psat) + 1;
769 else
770 len = sizeof(params);
771
755 wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]); 772 wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]);
756 wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&params, 773 wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&params,
757 sizeof(params), false); 774 len, false);
758} 775}
759 776
760static void wl18xx_enable_interrupts(struct wl1271 *wl) 777static void wl18xx_enable_interrupts(struct wl1271 *wl)
diff --git a/drivers/net/wireless/ti/wl18xx/reg.h b/drivers/net/wireless/ti/wl18xx/reg.h
index e81f60913e88..a824b26702a8 100644
--- a/drivers/net/wireless/ti/wl18xx/reg.h
+++ b/drivers/net/wireless/ti/wl18xx/reg.h
@@ -236,6 +236,12 @@ struct wl18xx_mac_and_phy_params {
236 u8 clock_valid_on_wake_up; 236 u8 clock_valid_on_wake_up;
237 u8 secondary_clock_setting_time; 237 u8 secondary_clock_setting_time;
238 u8 board_type; 238 u8 board_type;
239 /* enable point saturation */
240 u8 psat;
241 /* low/medium/high Tx power in dBm */
242 s8 low_power_val;
243 s8 med_power_val;
244 s8 high_power_val;
239 u8 padding[1]; 245 u8 padding[1];
240} __packed; 246} __packed;
241 247