Skip to content

Commit f293501

Browse files
Steve Glendinningdavem330
authored andcommitted
smsc95xx: configure LED outputs
SMSC LAN9500 has dual purpose GPIO/LED pins, and by default at power-on these are configured as GPIOs. This means that if LEDs are fitted they won't ever light. This patch sets them to be LED outputs for speed, duplex and link/activity. Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2382b15 commit f293501

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/net/usb/smsc95xx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,16 @@ static int smsc95xx_reset(struct usbnet *dev)
941941
if (netif_msg_ifup(dev))
942942
devdbg(dev, "ID_REV = 0x%08x", read_buf);
943943

944+
/* Configure GPIO pins as LED outputs */
945+
write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
946+
LED_GPIO_CFG_FDX_LED;
947+
ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf);
948+
if (ret < 0) {
949+
devwarn(dev, "Failed to write LED_GPIO_CFG register, ret=%d",
950+
ret);
951+
return ret;
952+
}
953+
944954
/* Init Tx */
945955
write_buf = 0;
946956
ret = smsc95xx_write_reg(dev, FLOW, write_buf);

drivers/net/usb/smsc95xx.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
#define PM_CTL_WUPS_MULTI_ (0x00000003)
100100

101101
#define LED_GPIO_CFG (0x24)
102+
#define LED_GPIO_CFG_SPD_LED (0x01000000)
103+
#define LED_GPIO_CFG_LNK_LED (0x00100000)
104+
#define LED_GPIO_CFG_FDX_LED (0x00010000)
102105

103106
#define GPIO_CFG (0x28)
104107

0 commit comments

Comments
 (0)