Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f293501c authored by Steve Glendinning's avatar Steve Glendinning Committed by David S. Miller
Browse files

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: default avatarSteve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2382b15b
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -941,6 +941,16 @@ static int smsc95xx_reset(struct usbnet *dev)
	if (netif_msg_ifup(dev))
	if (netif_msg_ifup(dev))
		devdbg(dev, "ID_REV = 0x%08x", read_buf);
		devdbg(dev, "ID_REV = 0x%08x", read_buf);


	/* Configure GPIO pins as LED outputs */
	write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
		LED_GPIO_CFG_FDX_LED;
	ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf);
	if (ret < 0) {
		devwarn(dev, "Failed to write LED_GPIO_CFG register, ret=%d",
			ret);
		return ret;
	}

	/* Init Tx */
	/* Init Tx */
	write_buf = 0;
	write_buf = 0;
	ret = smsc95xx_write_reg(dev, FLOW, write_buf);
	ret = smsc95xx_write_reg(dev, FLOW, write_buf);
+3 −0
Original line number Original line Diff line number Diff line
@@ -99,6 +99,9 @@
#define PM_CTL_WUPS_MULTI_		(0x00000003)
#define PM_CTL_WUPS_MULTI_		(0x00000003)


#define LED_GPIO_CFG			(0x24)
#define LED_GPIO_CFG			(0x24)
#define LED_GPIO_CFG_SPD_LED		(0x01000000)
#define LED_GPIO_CFG_LNK_LED		(0x00100000)
#define LED_GPIO_CFG_FDX_LED		(0x00010000)


#define GPIO_CFG			(0x28)
#define GPIO_CFG			(0x28)