Received: by 10.192.165.156 with SMTP id m28csp1993038imm; Thu, 12 Apr 2018 07:00:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx498xCq1D4OizTL2VlBGsH4H+OuYsNBeauBvANdFpnuSVjE3U1xtmaH/v9I06HCD+a7ppIH7 X-Received: by 10.98.105.2 with SMTP id e2mr7834524pfc.1.1523541640481; Thu, 12 Apr 2018 07:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523541640; cv=none; d=google.com; s=arc-20160816; b=Wj/u16+MzSmiacNKFpo3cs/glj0a7Byc+lyGEaYX4N+XMBrL8QbsrhLZsNfjhQZvR6 KrSkw50OkpJ75WQWk/IGR/a6OouR03W3MnRRfHZxwJ1aHlNXH4GC/eDt5L0bepYriaV/ M/FIQiR9dD4xwYB/qEAtlsBddTC5I4bnlJbrFqwjsZ5iVZOcmWfoQnGTYf1gh3mSrPHq Cl8cCZuu7HAjMkQt/SM7vYzm/DyjuMsqrvz6x+h3MenOaxmMEu+UjZrUwt95f00EUyxd L83ME+Qs5Z+uHmaMaM//xnEHiF3/Dog9LuhqTeQ7/JvhC36lmJ8nR4IqbcjbuwZnNON6 igtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=WyhKlmIvCgE1G25hibaf237WAaJyKM7wYPbQ4YUxzQU=; b=QNY6khyeikD8NLEJHODmhJgimCrZ++nRhfaJ3jq1+h/hOuSf+YdYV77vhS+s/YptKU FiIs/IzrkG0jAwwIg4P4RVimHPgwck5zpzv2vT9+dqAj79TwN82bzwTHIxuxWq2aQfx5 Ov3cISe2wzviCEg7qdftXT2AJ2uLXjtB2L5/YXvrR61l85vXpcYxC9g6nHo0xuZz9IwB MgOBCtFi5XYvPyiXvfEPGlZFBs0pRcgUrz3H7OiZJX+FH0HdhbyK29IVwgN+eSLEA3gF Zd69ypC/RnZh66j+w107EULK9ZCiI22K0RJgfQGWTmh6UghRuf0izJRLdvSNrk/wSlkD vBKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@raspberrypi.org header.s=pp header.b=xtAwRmcS; dkim=pass header.i=@raspberrypi-org.20150623.gappssmtp.com header.s=20150623 header.b=o4tJQvMf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si2567928pfi.138.2018.04.12.07.00.01; Thu, 12 Apr 2018 07:00:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@raspberrypi.org header.s=pp header.b=xtAwRmcS; dkim=pass header.i=@raspberrypi-org.20150623.gappssmtp.com header.s=20150623 header.b=o4tJQvMf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752966AbeDLN4l (ORCPT + 99 others); Thu, 12 Apr 2018 09:56:41 -0400 Received: from mx08-00252a01.pphosted.com ([91.207.212.211]:40354 "EHLO mx08-00252a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752668AbeDLNzw (ORCPT ); Thu, 12 Apr 2018 09:55:52 -0400 Received: from pps.filterd (m0102629.ppops.net [127.0.0.1]) by mx08-00252a01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3CDsY1k012745 for ; Thu, 12 Apr 2018 14:55:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pp; bh=WyhKlmIvCgE1G25hibaf237WAaJyKM7wYPbQ4YUxzQU=; b=xtAwRmcSmFQGdvGCNgfhOzACkbpGFLS9Vqh3d0BzIIXKlzdixjY8ma/CL1iGdVmdXj9H AMsWq331u2ldX+5FzRKw6JwsZuwZLdIl68bjpW0dpqFNN4sN8g0UDy+au2dJH67b0C4D pE7XxUOO+4N9qMf08QIsZPoHX/W8Uw3Futxadv+Hert1YDMa+ZM84vZA2nijVU0D060P kIdBXaDm/2KUi+NGbUMK0g+xASFptTZL/wwC9Q3pW4CdC8jio3TviHRUZ0yYOrzRktIJ bD66+zHKm/pMDKl4mY6dUPd3wSM6NiFmgdugduOnoEMlk7gxU/uPZ5zDhEVZag340MG6 8g== Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by mx08-00252a01.pphosted.com with ESMTP id 2h6trdtjrq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Thu, 12 Apr 2018 14:55:51 +0100 Received: by mail-wr0-f199.google.com with SMTP id p17so3043315wre.7 for ; Thu, 12 Apr 2018 06:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WyhKlmIvCgE1G25hibaf237WAaJyKM7wYPbQ4YUxzQU=; b=o4tJQvMfznkSip1iMzK5keRjHqQ6GLqwHv1pulNpOCYLXAZLJhzhGKnCn4wWLaJr6r zXaLAlko5gsiN/n961lKqHCyQK70e+7soobjsyuKhb42t6I0gZ2w8zJR6nFCEK7ghKs+ 2OWRDn7tQlWkCaghowTlL1Bny5hSEBSPjj0qtsf0d+xysBifYUmLYRNcjeY/pVvwus9W ey2vmtxLwhPcyPFBrMdQheiqsn0QK8lIRt1u9z12dA0ZdRwccBX3CvAZFcccgrTjNIaP tc079sm/GwbGFevMKmnGYPtV/pgcK5RfB/GpDDdIQ7Bo5RifDUm3vLCRtwYEGEbqz6hN irBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WyhKlmIvCgE1G25hibaf237WAaJyKM7wYPbQ4YUxzQU=; b=Jtm4PDZUl2OAnR47yDCGUxXNL9Nc0pcNY5SDfUyLsK8jrCL55Ku3xgwB7bLthQINNA gjNyrV3vSwBRNg2Yif6Id+LrUH4LaxBoAvW6xCwzEOuI4J4Ck9Q/jcHCxQUhTonAUmN7 g9uO2B0uYxY09cHmvuFMrHRLyl9iQd1ukPeGS0if27E6bMT3uq7w07mWvmfEi7OngRTq bqXTzXWINgmfu6uwveGImjqbsajhG2UTNDmpmtkmSNv331I21ZvYT0bmVMezA1zfXhtx WR5U+CtLV/06rhg9AIvDOQwkL7Fwkd2NKFXV+tlZc5odWb/kNJ1woQFKQYjjRmMxKxN6 E+BQ== X-Gm-Message-State: ALQs6tDxmDSk0rkI4wYz3YfwHg8Zy6DaOcPgo5RonZU6VOz3ugkQwZM6 Nsty9+2lCVipQkgqW2Ye8tsp3sWoOaFqjQc64BfVgaxek+s1/eNTq9A8mZiggaRhspVsFr2c1oQ BlwG8Xb31pNHwXMHtGRTYThYt X-Received: by 10.28.71.77 with SMTP id u74mr851774wma.149.1523541350430; Thu, 12 Apr 2018 06:55:50 -0700 (PDT) X-Received: by 10.28.71.77 with SMTP id u74mr851763wma.149.1523541350257; Thu, 12 Apr 2018 06:55:50 -0700 (PDT) Received: from buildbot.pitowers.org ([2a00:2381:fdf7:14:3403:8ea9:e6c1:e3f5]) by smtp.gmail.com with ESMTPSA id m83sm3491581wma.17.2018.04.12.06.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Apr 2018 06:55:49 -0700 (PDT) From: Phil Elwell To: Woojung Huh , Microchip Linux Driver Support , Rob Herring , Mark Rutland , "David S. Miller" , Mauro Carvalho Chehab , Greg Kroah-Hartman , Linus Walleij , Andrew Morton , Randy Dunlap , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: Phil Elwell Subject: [PATCH 2/4] lan78xx: Read initial EEE setting from Device Tree Date: Thu, 12 Apr 2018 14:55:34 +0100 Message-Id: <1523541336-145953-3-git-send-email-phil@raspberrypi.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523541336-145953-1-git-send-email-phil@raspberrypi.org> References: <1523541336-145953-1-git-send-email-phil@raspberrypi.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-12_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add two new Device Tree properties: * microchip,eee-enabled - a boolean to enable EEE * microchip,tx-lpi-timer - time in microseconds to wait after TX goes idle before entering the low power state (default 600) Signed-off-by: Phil Elwell --- drivers/net/usb/lan78xx.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index d2727b5..d98397b 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -2080,6 +2080,23 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) mii_adv = (u32)mii_advertise_flowctrl(dev->fc_request_control); phydev->advertising |= mii_adv_to_ethtool_adv_t(mii_adv); + if (of_property_read_bool(dev->udev->dev.of_node, + "microchip,eee-enabled")) { + struct ethtool_eee edata; + + memset(&edata, 0, sizeof(edata)); + edata.cmd = ETHTOOL_SEEE; + edata.advertised = ADVERTISED_1000baseT_Full | + ADVERTISED_100baseT_Full; + edata.eee_enabled = true; + edata.tx_lpi_enabled = true; + if (of_property_read_u32(dev->udev->dev.of_node, + "microchip,tx-lpi-timer", + &edata.tx_lpi_timer)) + edata.tx_lpi_timer = 600; /* non-aggressive */ + (void)lan78xx_set_eee(dev->net, &edata); + } + genphy_config_aneg(phydev); dev->fc_autoneg = phydev->autoneg; -- 2.7.4