Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Steve Glendinning and committed by
David S. Miller
f293501c 2382b15b

+13
+10
drivers/net/usb/smsc95xx.c
··· 941 941 if (netif_msg_ifup(dev)) 942 942 devdbg(dev, "ID_REV = 0x%08x", read_buf); 943 943 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 + 944 954 /* Init Tx */ 945 955 write_buf = 0; 946 956 ret = smsc95xx_write_reg(dev, FLOW, write_buf);
+3
drivers/net/usb/smsc95xx.h
··· 99 99 #define PM_CTL_WUPS_MULTI_ (0x00000003) 100 100 101 101 #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) 102 105 103 106 #define GPIO_CFG (0x28) 104 107