From patchwork Tue Oct 8 03:30:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Suriyan Ramasami X-Patchwork-Id: 281314 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C3B002C0090 for ; Tue, 8 Oct 2013 15:00:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 043104A098; Tue, 8 Oct 2013 06:00:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nZYHex8Zlybt; Tue, 8 Oct 2013 05:59:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5967B4A090; Tue, 8 Oct 2013 05:59:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE09C4A090 for ; Tue, 8 Oct 2013 05:59:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7MYRWIk3QJ8k for ; Tue, 8 Oct 2013 05:59:49 +0200 (CEST) X-Greylist: delayed 1251 seconds by postgrey-1.27 at theia; Tue, 08 Oct 2013 05:59:42 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by theia.denx.de (Postfix) with ESMTPS id 2E8404A08B for ; Tue, 8 Oct 2013 05:59:42 +0200 (CEST) Received: by mail-pb0-f51.google.com with SMTP id jt11so7998064pbb.24 for ; Mon, 07 Oct 2013 20:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=WNoGghVjmt9MW+8+WiL7gp2KiwEEiyE+9/CNh9qUeME=; b=b1cYXh/meTw9WaiSI4H+6jT3obBcZjCsy34JXe19p0iHDIlH92O8tjfq8/K3l16Exj 5FpCaHQsK5Kb2gulZS/Kf6/jlzHzXzvXafmLG9XL4MnsmZz0lFEzDTV9RuUftvp28Ppw MC7e4K2dlThkdKlBSMbLfxO7zTszZ4MxrFx7uz6ZBpJ8eIowqs4KQhzhnNMif6ggm1A3 cuWyxdBbIRpikVJD7v/egzeppki49VBspgcKFKzxdNf8YzHTj/yx2DAm0IPiLiNjZcoY 3wEnhP1pl2DuMF+92nlUqCXnRwLlzu5zfgbQ9j9oJX4QxuBSyG7v3LsPk/f42ZDapiMJ C1PQ== X-Received: by 10.67.5.132 with SMTP id cm4mr703902pad.186.1381203065081; Mon, 07 Oct 2013 20:31:05 -0700 (PDT) Received: from localhost.localdomain (75-101-50-252.dsl.static.sonic.net. [75.101.50.252]) by mx.google.com with ESMTPSA id qf7sm43558500pac.14.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 07 Oct 2013 20:31:04 -0700 (PDT) From: Suriyan Ramasami To: u-boot@lists.denx.de Date: Mon, 7 Oct 2013 20:30:58 -0700 Message-Id: <1381203058-4588-1-git-send-email-suriyan.r@gmail.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Subject: [U-Boot] [Patch v1 1/1] usb:smsx95xx LED activity for USB net driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add LED activity for SMSX95XX USB Ether driver. Signed-off-by: “Suriyan Ramasami" Acked-by: Simon Glass --- drivers/usb/eth/smsc95xx.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c index 15fd9a9..7bf0a34 100644 --- a/drivers/usb/eth/smsc95xx.c +++ b/drivers/usb/eth/smsc95xx.c @@ -14,6 +14,12 @@ /* SMSC LAN95xx based USB 2.0 Ethernet Devices */ +/* LED defines */ +#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) + /* Tx command words */ #define TX_CMD_A_FIRST_SEG_ 0x00002000 #define TX_CMD_A_LAST_SEG_ 0x00001000 @@ -591,6 +597,14 @@ static int smsc95xx_init(struct eth_device *eth, bd_t *bd) return ret; debug("ID_REV = 0x%08x\n", 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) + return ret; + debug("LED_GPIO_CFG set\n"); + /* Init Tx */ write_buf = 0; ret = smsc95xx_write_reg(dev, FLOW, write_buf);