Skip to content

Commit 4214cc5

Browse files
hayesorzdavem330
authored andcommitted
r8152: check if disabling ALDPS is finished
Use PLA 0xe000 bit 8 to check if disabling ALDPS is finished. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent befb2de commit 4214cc5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/usb/r8152.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2836,9 +2836,15 @@ static void r8153_aldps_en(struct r8152 *tp, bool enable)
28362836
data |= EN_ALDPS;
28372837
ocp_reg_write(tp, OCP_POWER_CFG, data);
28382838
} else {
2839+
int i;
2840+
28392841
data &= ~EN_ALDPS;
28402842
ocp_reg_write(tp, OCP_POWER_CFG, data);
2841-
msleep(20);
2843+
for (i = 0; i < 20; i++) {
2844+
usleep_range(1000, 2000);
2845+
if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100)
2846+
break;
2847+
}
28422848
}
28432849
}
28442850

0 commit comments

Comments
 (0)