From patchwork Fri Apr 29 11:59:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 66946 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp750264qge; Fri, 29 Apr 2016 05:12:45 -0700 (PDT) X-Received: by 10.194.26.41 with SMTP id i9mr23900116wjg.114.1461931965723; Fri, 29 Apr 2016 05:12:45 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id g1si17150175wjp.9.2016.04.29.05.12.45; Fri, 29 Apr 2016 05:12:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7534FA77C5; Fri, 29 Apr 2016 14:12:44 +0200 (CEST) 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 2F4oDxCa003d; Fri, 29 Apr 2016 14:12:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C6EAA77CA; Fri, 29 Apr 2016 14:11:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1DC7A76D4 for ; Fri, 29 Apr 2016 14:00:13 +0200 (CEST) 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 q-7NBFC60yAj for ; Fri, 29 Apr 2016 14:00:12 +0200 (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 comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by theia.denx.de (Postfix) with ESMTPS id EB7CEA7711 for ; Fri, 29 Apr 2016 13:59:34 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3TBxUle012482; Fri, 29 Apr 2016 06:59:30 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3TBxUNt010097; Fri, 29 Apr 2016 06:59:30 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Fri, 29 Apr 2016 06:59:30 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3TBxUrt029154; Fri, 29 Apr 2016 06:59:30 -0500 Received: from localhost (a0272616local.am.dhcp.ti.com [172.22.131.160]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id u3TBxT909857; Fri, 29 Apr 2016 06:59:30 -0500 (CDT) From: Dan Murphy To: Date: Fri, 29 Apr 2016 06:59:26 -0500 Message-ID: <1461931167-24110-6-git-send-email-dmurphy@ti.com> X-Mailer: git-send-email 2.7.2.333.g70bd996 In-Reply-To: <1461931167-24110-1-git-send-email-dmurphy@ti.com> References: <1461931167-24110-1-git-send-email-dmurphy@ti.com> MIME-Version: 1.0 Cc: michal.simek@xilinx.com, trini@konsulko.com Subject: [U-Boot] [PATCH v7 6/7] net: phy: Add phy_interface_is_sgmii to phy.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a helper to phy.h to identify whether the phy is configured for SGMII all variables. Signed-off-by: Dan Murphy Reviewed-by: Mugunthan V N Reviewed-by: Michal Simek --- v7 - no changes from v6 include/phy.h | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.8.1.116.g7b0d47b _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/include/phy.h b/include/phy.h index 7b2d1ff..ef3eb51 100644 --- a/include/phy.h +++ b/include/phy.h @@ -288,6 +288,17 @@ static inline bool phy_interface_is_rgmii(struct phy_device *phydev) phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID; } +/** + * phy_interface_is_sgmii - Convenience function for testing if a PHY interface + * is SGMII (all variants) + * @phydev: the phy_device struct + */ +static inline bool phy_interface_is_sgmii(struct phy_device *phydev) +{ + return phydev->interface >= PHY_INTERFACE_MODE_SGMII && + phydev->interface <= PHY_INTERFACE_MODE_QSGMII; +} + /* PHY UIDs for various PHYs that are referenced in external code */ #define PHY_UID_CS4340 0x13e51002 #define PHY_UID_TN2020 0x00a19410