Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp311945imp; Thu, 21 Feb 2019 01:53:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IblID02BhGu9D6YwCusv4KqQChSEVCllAvOHIh7vc60SDTUDxP/NPksQ1ivEDhr+dWgR191 X-Received: by 2002:a62:c42:: with SMTP id u63mr38834197pfi.73.1550742821927; Thu, 21 Feb 2019 01:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550742821; cv=none; d=google.com; s=arc-20160816; b=dDvvjRy/R9PPD268UEWTxwUbKX1E9KwedXsdc7fEIiBbxide1BwPULZOkapQVsvTsd 0RpPZ7FVhtj+AWxQ1haxiJ3QwPKKZjUz3GRVL3VMGYaWxGYr54ajti3ZM7ODZ7jiQAAy 45q9cB8FYnxtoUN41fCx4Lma3mHcpd5aMRiX6bH/K3rHepnS95N3GPONVZAuOt5aNdHZ cjJlH7DN0qDn+zHGhrz86ydmDyzVcvX6XNSLic6FhVRbIGBTmKjAjjTyouoLTk9AbpLk y/UlTBhnxCShKlqIdtyxI3P2tLOVU/uVcMAREO8vY8KbJyZZ6Kqkzbr0ajsqDXr833WH J8Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/YKplOaEbGE7bmEaMsqXk6AUvDHM9j21aZ2mLc55Ecs=; b=BGxx4KdFa4cDRUexZiH03Llj6ZxJo8yg5R0fnmAOyrRIrLY1i/lrT6GFZYfVIYmAfQ PPs5SQCR2WQycswxartbMEh4xg/zfj476Lnb9WVqdqLDTJNGwdJZkv2az5UX+/a1jvu6 dVAG/P7m1CcqbdeWBpnGtKFJQWS1FcYoYVSsG3I6ic+QGZ1rfzBSbyAuRG5YtI7Moaok Rigi8MxsweDYsNDOyxo1t0irP9eEmuFp0g+dflak40DLXFs3iNYCF3gEn+dX1T0bTVd8 n+/N4MxBkywG/+/t8SKs+kSX9pNs/DV7OIYwTuT7GElKHNTnKQj/dlY8sv6DTT7jXl4d G6bA== ARC-Authentication-Results: i=1; mx.google.com; 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 l3si3177115plt.307.2019.02.21.01.53.26; Thu, 21 Feb 2019 01:53:41 -0800 (PST) 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; 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 S1727545AbfBUJvl (ORCPT + 99 others); Thu, 21 Feb 2019 04:51:41 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:51049 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbfBUJvi (ORCPT ); Thu, 21 Feb 2019 04:51:38 -0500 X-Originating-IP: 90.88.23.190 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-81-190.w90-88.abo.wanadoo.fr [90.88.23.190]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id C8F7DC0011; Thu, 21 Feb 2019 09:51:34 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com Subject: [PATCH net-next 1/7] net: phy: marvell10g: Use get_features to get the PHY abilities Date: Thu, 21 Feb 2019 10:51:22 +0100 Message-Id: <20190221095128.28188-2-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190221095128.28188-1-maxime.chevallier@bootlin.com> References: <20190221095128.28188-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Alaska family of 10G PHYs has more abilities than the ones listed in PHY_10GBIT_FULL_FEATURES, the exact list depending on the model. Make use of the newly introduced .get_features call to build this list, using genphy_c45_pma_read_abilities to build the list of supported linkmodes, and adding autoneg ability based on what's reported by the AN MMD. .config_init is still used to validate the interface_mode. Signed-off-by: Maxime Chevallier --- drivers/net/phy/marvell10g.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 9ea27acf05ad..65ef469adf58 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -233,8 +233,6 @@ static int mv3310_resume(struct phy_device *phydev) static int mv3310_config_init(struct phy_device *phydev) { - int ret, val; - /* Check that the PHY interface type is compatible */ if (phydev->interface != PHY_INTERFACE_MODE_SGMII && phydev->interface != PHY_INTERFACE_MODE_XAUI && @@ -242,6 +240,12 @@ static int mv3310_config_init(struct phy_device *phydev) phydev->interface != PHY_INTERFACE_MODE_10GKR) return -ENODEV; + return 0; +} + +static int mv3310_get_features(struct phy_device *phydev) +{ + int ret, val; if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) { val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1); if (val < 0) @@ -429,7 +433,7 @@ static struct phy_driver mv3310_drivers[] = { .phy_id = 0x002b09aa, .phy_id_mask = MARVELL_PHY_ID_MASK, .name = "mv88x3310", - .features = PHY_10GBIT_FEATURES, + .get_features = mv3310_get_features, .soft_reset = gen10g_no_soft_reset, .config_init = mv3310_config_init, .probe = mv3310_probe, -- 2.19.2