aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/net/asix.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c
index f538013965b0..896449f0cf85 100644
--- a/drivers/usb/net/asix.c
+++ b/drivers/usb/net/asix.c
@@ -898,7 +898,7 @@ static int ax88772_link_reset(struct usbnet *dev)
898 898
899static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 899static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
900{ 900{
901 int ret; 901 int ret, embd_phy;
902 void *buf; 902 void *buf;
903 u16 rx_ctl; 903 u16 rx_ctl;
904 struct asix_data *data = (struct asix_data *)&dev->data; 904 struct asix_data *data = (struct asix_data *)&dev->data;
@@ -919,13 +919,15 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
919 AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0) 919 AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0)
920 goto out2; 920 goto out2;
921 921
922 /* 0x10 is the phy id of the embedded 10/100 ethernet phy */
923 embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
922 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 924 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
923 1, 0, 0, buf)) < 0) { 925 embd_phy, 0, 0, buf)) < 0) {
924 dbg("Select PHY #1 failed: %d", ret); 926 dbg("Select PHY #1 failed: %d", ret);
925 goto out2; 927 goto out2;
926 } 928 }
927 929
928 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0) 930 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0)
929 goto out2; 931 goto out2;
930 932
931 msleep(150); 933 msleep(150);
@@ -933,8 +935,14 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
933 goto out2; 935 goto out2;
934 936
935 msleep(150); 937 msleep(150);
936 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0) 938 if (embd_phy) {
937 goto out2; 939 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0)
940 goto out2;
941 }
942 else {
943 if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0)
944 goto out2;
945 }
938 946
939 msleep(150); 947 msleep(150);
940 rx_ctl = asix_read_rx_ctl(dev); 948 rx_ctl = asix_read_rx_ctl(dev);