Skip to content

Commit 3cb3234

Browse files
hayesorzdavem330
authored andcommitted
r8152: adjust U2P3 for RTL8153
Use another way to keep disabling the U2P3 for both RTL_VER_03 and RTL_VER_04. Move enabling U2P3 from r8153_init() to r8153_hw_phy_cfg(). The engineer ask the setting should be done after PHY settings. Disable U2P3 first in rtl8153_up(). Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0255275 commit 3cb3234

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

drivers/net/usb/r8152.c

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,7 @@ static void r8153_u2p3en(struct r8152 *tp, bool enable)
24682468
u32 ocp_data;
24692469

24702470
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL);
2471-
if (enable && tp->version != RTL_VER_03 && tp->version != RTL_VER_04)
2471+
if (enable)
24722472
ocp_data |= U2P3_ENABLE;
24732473
else
24742474
ocp_data &= ~U2P3_ENABLE;
@@ -2559,7 +2559,18 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
25592559
} else {
25602560
rtl_runtime_suspend_enable(tp, false);
25612561
r8153_mac_clk_spd(tp, false);
2562-
r8153_u2p3en(tp, true);
2562+
2563+
switch (tp->version) {
2564+
case RTL_VER_03:
2565+
case RTL_VER_04:
2566+
break;
2567+
case RTL_VER_05:
2568+
case RTL_VER_06:
2569+
default:
2570+
r8153_u2p3en(tp, true);
2571+
break;
2572+
}
2573+
25632574
r8153_u1u2en(tp, true);
25642575
}
25652576
}
@@ -2898,6 +2909,17 @@ static void r8153_hw_phy_cfg(struct r8152 *tp)
28982909
r8153_aldps_en(tp, true);
28992910
r8152b_enable_fc(tp);
29002911

2912+
switch (tp->version) {
2913+
case RTL_VER_03:
2914+
case RTL_VER_04:
2915+
break;
2916+
case RTL_VER_05:
2917+
case RTL_VER_06:
2918+
default:
2919+
r8153_u2p3en(tp, true);
2920+
break;
2921+
}
2922+
29012923
set_bit(PHY_RESET, &tp->flags);
29022924
}
29032925

@@ -3143,10 +3165,22 @@ static void rtl8153_up(struct r8152 *tp)
31433165
return;
31443166

31453167
r8153_u1u2en(tp, false);
3168+
r8153_u2p3en(tp, false);
31463169
r8153_aldps_en(tp, false);
31473170
r8153_first_init(tp);
31483171
r8153_aldps_en(tp, true);
3149-
r8153_u2p3en(tp, true);
3172+
3173+
switch (tp->version) {
3174+
case RTL_VER_03:
3175+
case RTL_VER_04:
3176+
break;
3177+
case RTL_VER_05:
3178+
case RTL_VER_06:
3179+
default:
3180+
r8153_u2p3en(tp, true);
3181+
break;
3182+
}
3183+
31503184
r8153_u1u2en(tp, true);
31513185
}
31523186

@@ -3545,7 +3579,6 @@ static void r8153_init(struct r8152 *tp)
35453579
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
35463580

35473581
rtl_tally_reset(tp);
3548-
r8153_u2p3en(tp, true);
35493582
}
35503583

35513584
static int rtl8152_pre_reset(struct usb_interface *intf)

0 commit comments

Comments
 (0)