mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 14:43:58 +08:00
staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
38f36d8146
commit
31b7e846bd
@ -1289,18 +1289,18 @@ static void _ResetDigitalProcedure1_92C(struct rtw_adapter *padapter,
|
||||
i. SYS_FUNC_EN 0x02[10]= 1 enable MCU register,
|
||||
(8051 enable)
|
||||
******************************/
|
||||
u16 valu16 = 0;
|
||||
u16 valu16;
|
||||
rtl8723au_write8(padapter, REG_MCUFWDL, 0);
|
||||
|
||||
valu16 = rtl8723au_read16(padapter, REG_SYS_FUNC_EN);
|
||||
/* reset MCU , 8051 */
|
||||
rtl8723au_write16(padapter, REG_SYS_FUNC_EN,
|
||||
valu16 & (~FEN_CPUEN));
|
||||
valu16 & ~FEN_CPUEN);
|
||||
|
||||
valu16 = rtl8723au_read16(padapter, REG_SYS_FUNC_EN) & 0x0FFF;
|
||||
/* reset MAC */
|
||||
rtl8723au_write16(padapter, REG_SYS_FUNC_EN,
|
||||
valu16 | (FEN_HWPDN | FEN_ELDR));
|
||||
valu16 | FEN_HWPDN | FEN_ELDR);
|
||||
|
||||
valu16 = rtl8723au_read16(padapter, REG_SYS_FUNC_EN);
|
||||
/* enable MCU , 8051 */
|
||||
@ -1308,15 +1308,17 @@ static void _ResetDigitalProcedure1_92C(struct rtw_adapter *padapter,
|
||||
valu16 | FEN_CPUEN);
|
||||
} else {
|
||||
u8 retry_cnts = 0;
|
||||
u8 val8;
|
||||
|
||||
val8 = rtl8723au_read8(padapter, REG_MCUFWDL);
|
||||
|
||||
/* 2010/08/12 MH For USB SS, we can not stop 8051 when we
|
||||
are trying to enter IPS/HW&SW radio off. For
|
||||
S3/S4/S5/Disable, we can stop 8051 because */
|
||||
/* we will init FW when power on again. */
|
||||
/* If we want to SS mode, we can not reset 8051. */
|
||||
if (rtl8723au_read8(padapter, REG_MCUFWDL) & BIT(1)) {
|
||||
if ((val8 & BIT(1)) && padapter->bFWReady) {
|
||||
/* IF fw in RAM code, do reset */
|
||||
if (padapter->bFWReady) {
|
||||
/* 2010/08/25 MH Accordign to RD alfred's
|
||||
suggestion, we need to disable other */
|
||||
/* HRCV INT to influence 8051 reset. */
|
||||
@ -1328,25 +1330,21 @@ static void _ResetDigitalProcedure1_92C(struct rtw_adapter *padapter,
|
||||
rtl8723au_write8(padapter, REG_FSIMR, 0x00);
|
||||
|
||||
/* 8051 reset by self */
|
||||
rtl8723au_write8(padapter, REG_HMETFR + 3,
|
||||
0x20);
|
||||
rtl8723au_write8(padapter, REG_HMETFR + 3, 0x20);
|
||||
|
||||
while ((retry_cnts++ < 100) &&
|
||||
(FEN_CPUEN &
|
||||
rtl8723au_read16(padapter,
|
||||
REG_SYS_FUNC_EN))) {
|
||||
(rtl8723au_read16(padapter, REG_SYS_FUNC_EN) &
|
||||
FEN_CPUEN)) {
|
||||
udelay(50); /* us */
|
||||
}
|
||||
|
||||
if (retry_cnts >= 100) {
|
||||
/* Reset MAC and Enable 8051 */
|
||||
rtl8723au_write8(padapter,
|
||||
REG_SYS_FUNC_EN + 1,
|
||||
0x50);
|
||||
REG_SYS_FUNC_EN + 1, 0x50);
|
||||
mdelay(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Reset MAC and Enable 8051 */
|
||||
rtl8723au_write8(padapter, REG_SYS_FUNC_EN + 1, 0x54);
|
||||
rtl8723au_write8(padapter, REG_MCUFWDL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user