Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 912DDC636D7 for ; Thu, 9 Feb 2023 15:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbjBIPOn (ORCPT ); Thu, 9 Feb 2023 10:14:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbjBIPOf (ORCPT ); Thu, 9 Feb 2023 10:14:35 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9545260BA8; Thu, 9 Feb 2023 07:14:32 -0800 (PST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 32FF2100006; Thu, 9 Feb 2023 15:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675955671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z1T2buUEtUaS4iwijK+9hDQD5MTQSBYcjfGbgwJHtZo=; b=aZ1JEgynImYFrGvJgTcRxJ6Bpcv2W4DpjJ/aY65E2KUSnT+hEERXUwbanWLyc//F82Uy8f Lvd3PSTuHd6a/6GeszmypOvPjs1XXW2b177bSOyEMYakIzCAji0ZetUwYKqk3uthc2Dti1 hUEJEpwS+0VHMYdP2+SL8H/PPPJgVfDsJ0la5nuH5abHSI20kJsITBHecKopYY5EgzLbOC QQB76kY1xL/ymHGGjYQ8N6jZPil/S4Zybi4+KtMkOE8rCJucVfnifNB6lu5MLmW2ayh2jH FChxWMw2r9KNMro2jlM3AKqtxEAgVIiAv7UChRO73BZuRgbni/uH5+nVv2AceQ== From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , Wong Vee Khee , =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Kurt Kanzenbach , Revanth Kumar Uppala , Tan Tee Min Cc: Thomas Petazzoni , Herve Codina , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Mohammad Athari Bin Ismail , Jon Hunter , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v3 3/6] net: stmmac: add support to provide pcs from platform data Date: Thu, 9 Feb 2023 16:16:29 +0100 Message-Id: <20230209151632.275883-4-clement.leger@bootlin.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230209151632.275883-1-clement.leger@bootlin.com> References: <20230209151632.275883-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a pcs field in platform_data to allow providing platform data. This is going to be used by the "renesas,rzn1-gmac" compatible driver which can make use of a PCS. Signed-off-by: Clément Léger --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ include/linux/stmmac.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 9a8721227b17..8bf5f73eb4c8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7295,6 +7295,9 @@ int stmmac_dvr_probe(struct device *device, goto error_xpcs_setup; } + if (priv->plat->pcs) + priv->hw->phylink_pcs = priv->plat->pcs; + ret = stmmac_phy_setup(priv); if (ret) { netdev_err(ndev, "failed to setup phy (%d)\n", ret); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index a152678b82b7..104b3d1101c0 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -273,5 +273,6 @@ struct plat_stmmacenet_data { bool use_phy_wol; bool sph_disable; bool serdes_up_after_phy_linkup; + struct phylink_pcs *pcs; }; #endif -- 2.39.0