From patchwork Wed Oct 19 08:50:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 13011747 X-Patchwork-Delegate: kuba@kernel.org 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 57FAAC43217 for ; Wed, 19 Oct 2022 13:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbiJSNWY (ORCPT ); Wed, 19 Oct 2022 09:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbiJSNVz (ORCPT ); Wed, 19 Oct 2022 09:21:55 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8DAEF9A9D0; Wed, 19 Oct 2022 06:07:04 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.95,195,1661785200"; d="scan'208";a="137159777" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 19 Oct 2022 17:51:10 +0900 Received: from localhost.localdomain (unknown [10.166.15.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id AD56F400BC17; Wed, 19 Oct 2022 17:51:10 +0900 (JST) From: Yoshihiro Shimoda To: linux@armlinux.org.uk, kabel@kernel.org, andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH RFC 3/3] net: renesas: rswitch: Pass host parameters to phydev Date: Wed, 19 Oct 2022 17:50:52 +0900 Message-Id: <20221019085052.933385-4-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019085052.933385-1-yoshihiro.shimoda.uh@renesas.com> References: <20221019085052.933385-1-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Use of_phy_connect_with_host_params() to pass host parameters to phydev. Otherwise, connected PHY cannot work correctly. Signed-off-by: Yoshihiro Shimoda --- drivers/net/ethernet/renesas/rswitch.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c index c604331bfd88..bb2f1e667210 100644 --- a/drivers/net/ethernet/renesas/rswitch.c +++ b/drivers/net/ethernet/renesas/rswitch.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -1234,11 +1235,19 @@ static void rswitch_phy_remove_link_mode(struct rswitch_device *rdev, static int rswitch_phy_init(struct rswitch_device *rdev, struct device_node *phy) { + DECLARE_PHY_INTERFACE_MASK(host_interfaces); struct phy_device *phydev; int err = 0; - phydev = of_phy_connect(rdev->ndev, phy, rswitch_adjust_link, 0, - rdev->etha->phy_interface); + phy_interface_zero(host_interfaces); + if (rdev->etha->phy_interface == PHY_INTERFACE_MODE_SGMII) + __set_bit(PHY_INTERFACE_MODE_SGMII, host_interfaces); + + phydev = of_phy_connect_with_host_params(rdev->ndev, phy, + rswitch_adjust_link, 0, + rdev->etha->phy_interface, + host_interfaces, + rdev->etha->speed); if (!phydev) { err = -ENOENT; goto out;