Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1662148 > unrolled thread
| Started by | Hayes Wang <hayeswang@realtek.com> |
|---|---|
| First post | 2017-06-09 11:20 +0200 |
| Last post | 2017-06-09 11:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH net-next 09/11] r8152: check if disabling ALDPS is finished Hayes Wang <hayeswang@realtek.com> - 2017-06-09 11:20 +0200
| From | Hayes Wang <hayeswang@realtek.com> |
|---|---|
| Date | 2017-06-09 11:20 +0200 |
| Subject | [PATCH net-next 09/11] r8152: check if disabling ALDPS is finished |
| Message-ID | <tQoff-88B-11@gated-at.bofh.it> |
Use PLA 0xe000 bit 8 to check if disabling ALDPS is finished.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/usb/r8152.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index f43b7a8..204f4b2 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2836,9 +2836,15 @@ static void r8153_aldps_en(struct r8152 *tp, bool enable)
data |= EN_ALDPS;
ocp_reg_write(tp, OCP_POWER_CFG, data);
} else {
+ int i;
+
data &= ~EN_ALDPS;
ocp_reg_write(tp, OCP_POWER_CFG, data);
- msleep(20);
+ for (i = 0; i < 20; i++) {
+ usleep_range(1000, 2000);
+ if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100)
+ break;
+ }
}
}
--
2.7.4
Back to top | Article view | linux.kernel
csiph-web