From patchwork Wed Oct 11 08:18:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 13416847 X-Patchwork-Delegate: geert@linux-m68k.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 26DBACD98FE for ; Wed, 11 Oct 2023 08:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjJKIS1 (ORCPT ); Wed, 11 Oct 2023 04:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbjJKIS1 (ORCPT ); Wed, 11 Oct 2023 04:18:27 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B6C59D for ; Wed, 11 Oct 2023 01:18:25 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.03,214,1694703600"; d="scan'208";a="178887281" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 11 Oct 2023 17:18:24 +0900 Received: from localhost.localdomain (unknown [10.166.15.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 9EFFB400C9ED; Wed, 11 Oct 2023 17:18:24 +0900 (JST) From: Yoshihiro Shimoda To: vkoul@kernel.org, kishon@kernel.org Cc: linux-phy@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 1/2] phy: renesas: r8a779f0-ether-serdes: Reset in .init() Date: Wed, 11 Oct 2023 17:18:16 +0900 Message-Id: <20231011081817.257113-2-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231011081817.257113-1-yoshihiro.shimoda.uh@renesas.com> References: <20231011081817.257113-1-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Reset this PHY in .init() instead of probe() for re-initializing this PHY after probed correctly. Signed-off-by: Yoshihiro Shimoda --- drivers/phy/renesas/r8a779f0-ether-serdes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/renesas/r8a779f0-ether-serdes.c b/drivers/phy/renesas/r8a779f0-ether-serdes.c index 683b19bc411a..ba1109d6bdd9 100644 --- a/drivers/phy/renesas/r8a779f0-ether-serdes.c +++ b/drivers/phy/renesas/r8a779f0-ether-serdes.c @@ -214,6 +214,10 @@ static int r8a779f0_eth_serdes_hw_init(struct r8a779f0_eth_serdes_channel *chann if (dd->initialized) return 0; + reset_control_reset(dd->reset); + + usleep_range(1000, 2000); + ret = r8a779f0_eth_serdes_common_init_ram(dd); if (ret) return ret; @@ -356,8 +360,6 @@ static int r8a779f0_eth_serdes_probe(struct platform_device *pdev) if (IS_ERR(dd->reset)) return PTR_ERR(dd->reset); - reset_control_reset(dd->reset); - for (i = 0; i < R8A779F0_ETH_SERDES_NUM; i++) { struct r8a779f0_eth_serdes_channel *channel = &dd->channel[i]; From patchwork Wed Oct 11 08:18:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 13416849 X-Patchwork-Delegate: geert@linux-m68k.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 62507CD98FF for ; Wed, 11 Oct 2023 08:18:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbjJKIS3 (ORCPT ); Wed, 11 Oct 2023 04:18:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjJKIS2 (ORCPT ); Wed, 11 Oct 2023 04:18:28 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 634A393 for ; Wed, 11 Oct 2023 01:18:27 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.03,214,1694703600"; d="scan'208";a="182677694" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 11 Oct 2023 17:18:24 +0900 Received: from localhost.localdomain (unknown [10.166.15.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id B8BE9400F79B; Wed, 11 Oct 2023 17:18:24 +0900 (JST) From: Yoshihiro Shimoda To: vkoul@kernel.org, kishon@kernel.org Cc: linux-phy@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 2/2] phy: renesas: r8a779f0-ether-serdes: Add .exit() ops Date: Wed, 11 Oct 2023 17:18:17 +0900 Message-Id: <20231011081817.257113-3-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231011081817.257113-1-yoshihiro.shimoda.uh@renesas.com> References: <20231011081817.257113-1-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Add r8a779f0_eth_serdes_exit() to clear the initialized flag for re-initializing this PHY if needed. Signed-off-by: Yoshihiro Shimoda --- drivers/phy/renesas/r8a779f0-ether-serdes.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/phy/renesas/r8a779f0-ether-serdes.c b/drivers/phy/renesas/r8a779f0-ether-serdes.c index ba1109d6bdd9..fc6e398fa3bf 100644 --- a/drivers/phy/renesas/r8a779f0-ether-serdes.c +++ b/drivers/phy/renesas/r8a779f0-ether-serdes.c @@ -261,6 +261,15 @@ static int r8a779f0_eth_serdes_init(struct phy *p) return ret; } +static int r8a779f0_eth_serdes_exit(struct phy *p) +{ + struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); + + channel->dd->initialized = false; + + return 0; +} + static int r8a779f0_eth_serdes_hw_init_late(struct r8a779f0_eth_serdes_channel *channel) { @@ -318,6 +327,7 @@ static int r8a779f0_eth_serdes_set_speed(struct phy *p, int speed) static const struct phy_ops r8a779f0_eth_serdes_ops = { .init = r8a779f0_eth_serdes_init, + .exit = r8a779f0_eth_serdes_exit, .power_on = r8a779f0_eth_serdes_power_on, .set_mode = r8a779f0_eth_serdes_set_mode, .set_speed = r8a779f0_eth_serdes_set_speed,