aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2014-11-30 16:05:04 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-12-02 16:40:00 -0800
commit6e1c29fd9e10af8aff4f9fe628e1ca9d337e90a9 (patch)
treee93d94ea0c23cceb5e75be78b8879eec0c3ff03c /drivers/staging
parent2098778f562123c09cace4a15cd08f0cc26f0e48 (diff)
staging: rtl8723au: Do not write garbage to REG_SPS0_CTRL
Use a separate variable to hold the value of REG_SPS0_CTRL to avoid it getting clobbered and writing out garbage to it, for the case of eRFPowerState == rf_sleep/rf_off && bRegSSPwrLvl == 1. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8723au/hal/usb_halinit.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 762c51427958..6c6601332035 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -776,9 +776,11 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
int bRegSSPwrLvl)
{
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
- u8 value8;
+ u8 value8, sps0;
u8 bytetmp;
+ sps0 = rtl8723au_read8(Adapter, REG_SPS0_CTRL);
+
switch (eRFPowerState) {
case rf_on:
if (bRegSSPwrLvl == 1) {
@@ -788,8 +790,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
/* 2. Force PWM, Enable SPS18_LDO_Marco_Block */
rtl8723au_write8(Adapter, REG_SPS0_CTRL,
- rtl8723au_read8(Adapter, REG_SPS0_CTRL) |
- BIT(0) | BIT(3));
+ sps0 | BIT(0) | BIT(3));
/* 3. restore BB, AFE control register. */
/* RF */
@@ -832,8 +833,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
/* 2. Force PWM, Enable SPS18_LDO_Marco_Block */
rtl8723au_write8(Adapter, REG_SPS0_CTRL,
- rtl8723au_read8(Adapter, REG_SPS0_CTRL) |
- BIT(0) | BIT(3));
+ sps0 | BIT(0) | BIT(3));
/* 3. restore BB, AFE control register. */
/* RF */
@@ -882,11 +882,10 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
break;
case rf_sleep:
case rf_off:
- value8 = rtl8723au_read8(Adapter, REG_SPS0_CTRL);
if (IS_81xxC_VENDOR_UMC_B_CUT(pHalData->VersionID))
- value8 &= ~BIT(0);
+ sps0 &= ~BIT(0);
else
- value8 &= ~(BIT(0) | BIT(3));
+ sps0 &= ~(BIT(0) | BIT(3));
if (bRegSSPwrLvl == 1) {
RT_TRACE(_module_hal_init_c_, _drv_err_, ("SS LVL1\n"));
/* Disable RF and BB only for SelectSuspend. */
@@ -936,7 +935,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
bRFRegOffsetMask, 0);
/* 4. Force PFM , disable SPS18_LDO_Marco_Block */
- rtl8723au_write8(Adapter, REG_SPS0_CTRL, value8);
+ rtl8723au_write8(Adapter, REG_SPS0_CTRL, sps0);
} else { /* Level 2 or others. */
RT_TRACE(_module_hal_init_c_, _drv_err_, ("SS LVL2\n"));
{
@@ -1009,7 +1008,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
bRFRegOffsetMask, 0);
/* 4. Force PFM , disable SPS18_LDO_Marco_Block */
- rtl8723au_write8(Adapter, REG_SPS0_CTRL, value8);
+ rtl8723au_write8(Adapter, REG_SPS0_CTRL, sps0);
/* 2010/10/13 MH/Isaachsu exchange sequence. */
/* h. AFE_PLL_CTRL 0x28[7:0] = 0x80

Privacy Policy