Commit 97138a1c authored by Steve Glendinning's avatar Steve Glendinning Committed by David S. Miller

smsc75xx: let EEPROM determine GPIO/LED settings

This patch allows the GPIO/LED settings to be configured by the
EEPROM if present, and only sets the default values (LED outputs
for link/activity) when an EEPROM is not detected.
Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f94a929
...@@ -903,7 +903,11 @@ static int smsc75xx_reset(struct usbnet *dev) ...@@ -903,7 +903,11 @@ static int smsc75xx_reset(struct usbnet *dev)
netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x", buf); netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x", buf);
/* Configure GPIO pins as LED outputs */ ret = smsc75xx_read_reg(dev, E2P_CMD, &buf);
check_warn_return(ret, "Failed to read E2P_CMD: %d", ret);
/* only set default GPIO/LED settings if no EEPROM is detected */
if (!(buf & E2P_CMD_LOADED)) {
ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf); ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf);
check_warn_return(ret, "Failed to read LED_GPIO_CFG: %d", ret); check_warn_return(ret, "Failed to read LED_GPIO_CFG: %d", ret);
...@@ -912,6 +916,7 @@ static int smsc75xx_reset(struct usbnet *dev) ...@@ -912,6 +916,7 @@ static int smsc75xx_reset(struct usbnet *dev)
ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf); ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf);
check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d", ret); check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d", ret);
}
ret = smsc75xx_write_reg(dev, FLOW, 0); ret = smsc75xx_write_reg(dev, FLOW, 0);
check_warn_return(ret, "Failed to write FLOW: %d", ret); check_warn_return(ret, "Failed to write FLOW: %d", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment