From patchwork Sun Jan 21 12:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ziyang Huang X-Patchwork-Id: 13524576 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 922DEC47DAF for ; Sun, 21 Jan 2024 12:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bHgxEF2C5CWaowVhLGrViCwBOGFbI6QC7mqlcgCDHAo=; b=ffTG8rF7Z/eQsD 3UoYqoONlvoZvgziANCa4LTYSmUpcIduswRh4+OdaZWY5fKqrYmSv5bVezVUa3hB0sDhPWuZM6gMr xY207BxXnb7+zxfIFrVPd+U0JJnA/2XmMNekFppOus1KNwQLGqc6DG1DtCaKMujOQGry1COiK501N FV15eea7a7RAKuz2L/vGwSiWSVDYZoBUpzLwqZY+bIMvz++6/dqhrCsQHeQZ3/j8NK/P9I3exzDZd ZiEfPL4YkocAPKXf86U6zJQvD6ubXSBA9cxxLb5ZrnC8DCY+aOvyi1bibZVwufgbi15hUKAlpRtkN yMXSYx00QH8eVtBEcmWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rRXB3-009X05-1Q; Sun, 21 Jan 2024 12:43:53 +0000 Received: from mail-tyzapc01olkn20800.outbound.protection.outlook.com ([2a01:111:f403:280c::800] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rRXAt-009WqY-2l; Sun, 21 Jan 2024 12:43:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CZZnQashbBdTY91tUp5wZJwGiEqaPOkkgNEPKjsKcGetu7W5TOe/wN0DjefMAMRnY479pc75MTBAPxuwxn4pLXQyKOkMecfiLcgiOQDM5iY1Npk/AGnRULuIvlCwos91MYjezbJz0R7gVE7l7RzYLpicNii2yZ7f4HOgalIExYqoskI1iMQYb9jeMcNOY5LDHc0OuDMzgc4tcgB2Hnze1EnEnbnMG/jmv/Yz0+NkSZb2s8/ajz34vlhLuVUU5ucnmqmjRwoqHPvCx7nxyOvNWlBpLHMlG/rkzNeuJoFCgpamqe5h/xVzqgp1q+NjNEhPbT9eiOzlYEqHSJ49FWRZ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CeF/Np6r3wx5dMVJ4z8gk42WxkpVi8rIybYiu1roWII=; b=JE1dcNOcZOYsb+fZoiLugcAgKI1miA9aByBFhXt0RvYMtBumBgo7jU5Je78b8XgzyH0Q1Sk3rch9Vm7GvNhPaRDsgk3nlG1jTFS9zt4s8dypp7M4fidvZcMOnhFA/oS5kwwKGi5P72qOmfKHdzNKoxIbxejp/jp7C2OhFxQmoaTfUT93VPEHEBP5awCQrDuvVGkmcuLHHrZ8PtOvt4e80kJJWeT6/V1xZBlGRC5UDXcZRxTeZfsLKJHl7gGTB81lZNZGymewR5W/ogE5o73+vMYaKuPQVD7JhjJsvd/WTPauEIrMBeGdpHzFLCaw3+KH8BYmTWMNlz68+TkzPCIQ5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CeF/Np6r3wx5dMVJ4z8gk42WxkpVi8rIybYiu1roWII=; b=TaKEfFnnBYW/pnO2zI8PizUvSmp5B9x1e0BQ2LuARhqNndSp4/b7f6aiB7cn8sqNN1hAfV/ZLOcSKWEyFl74tQXOLpnZR/czUb6waCduR0h1mhYPoTxw3Qv3+GTuvDsPAA4iuymgOx17edL1JKNkV+ybeSulu2UHfisETvlbXgSghhNy3DCYTeFY1b2khXTcvbxmJyTx4Z4S6opx5WNV175dy8QoW8u9XYVT+kOFfGfTLP3SEBAeqKCIOTynyZ1Wcl3TwkQ3Tb5WwYhDrDOVsNOpJfhasaD4/oRNLh2EiHYSS0ftYQgMApVn/V87Y8frJNiByaEnF9cxHsSNW7P0ug== Received: from TYZPR01MB5556.apcprd01.prod.exchangelabs.com (2603:1096:400:363::9) by OSQPR01MB6119.apcprd01.prod.exchangelabs.com (2603:1096:604:27b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.30; Sun, 21 Jan 2024 12:43:36 +0000 Received: from TYZPR01MB5556.apcprd01.prod.exchangelabs.com ([fe80::bcb7:50f4:7a16:4ec0]) by TYZPR01MB5556.apcprd01.prod.exchangelabs.com ([fe80::bcb7:50f4:7a16:4ec0%7]) with mapi id 15.20.7181.019; Sun, 21 Jan 2024 12:43:36 +0000 From: Ziyang Huang To: mcoquelin.stm32@gmail.com Cc: alexandre.torgue@foss.st.com, richardcochran@gmail.com, p.zabel@pengutronix.de, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, Ziyang Huang Subject: [PATCH 6/8] net: mdio: ipq4019: support reset control Date: Sun, 21 Jan 2024 20:42:35 +0800 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [6eQm7VelkNsE2KT1NBJq/W242KG1dVYWwqvIXC+ZwKZnQo77a+eDuw==] X-ClientProxiedBy: PH8PR21CA0009.namprd21.prod.outlook.com (2603:10b6:510:2ce::26) To TYZPR01MB5556.apcprd01.prod.exchangelabs.com (2603:1096:400:363::9) X-Microsoft-Original-Message-ID: <20240121124237.3328702-6-hzyitc@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR01MB5556:EE_|OSQPR01MB6119:EE_ X-MS-Office365-Filtering-Correlation-Id: 9af9ed1d-9519-4440-ef77-08dc1a7e95e6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g1lKhGeYf37neibm5/CFAXSAjsas+WKF3Vih7Ut6qxMjpdliQwGdju2leiNvl1BY5J3HXydxAHfBIsv+Nqifxh5YOboh4S2lN3XGyJ4XbIWrGOHrd9gXSgP4d7XSe8UFiZhchyuScbVfN8IUsy/2PJ2K+0eTM04XZHZ1IqADgRlQ5ts9/uCkoWoq3xQNk++MH0Qtp3IwHibCJxyrNdC71Mh54jGzRpSLjAcMUICGdDTg8bKQ/Daz9nFl68RI2cwwZOIy0sH1TEdCh/tzi7WQoKsIbh/6++FG7CEtdym8vDQPD2qKugsGsIXIG95t97YuG4L1j5uMJ+CLTGhZRi0FF1/J9ZtYGEyIXqCcj3xKxUZTTZQgssK/NuYEjeg3vJwoe5tQdGIUDbSfccMonjJTexmLT3G4c+Bp7R25XGun/BbFAiC++3TtqQ6VfLznLf8x69rdrFzz/Fh5RuWp3GIiQuJDN/12CYSvMrHVK1UcSh8xoRTE7Z3iXSFj6aIh42X+miK76cW7bP0RQAdEH7K34og8c6PNp4XRrEJSDRx/mLck4IGue2dsPT1Wex67NgPkmyvcdLH9l0DrB55P3VloiMGjep40Z4nONI688GhVmd0mimPB9al4jDG504VqME/S X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RJHehYWzhK/vGFTqjyK+gW51WGFcaRqSxdFWnLzK7okowacFhIfslGcv+xf/UYf7rqSlPO2MntZ1uvQP22vZ3YHQdk0ezrQVlzkLVL3870++D1en5sREZlDxZ+qGqVnLydMDU6eeIayVxpXQCvZIZAgHbks15DZbnThXZS2H/GV1u6XSVm8WB47w+tfHpdlsOCP6aWvg2mOhpz5AgbprTjpnvGuzpWHmWD126Ed0W3xD3NcApTzFzsT8y9bY8ysmlcXotaqD9hcIac+mUJISmlzD32MWaU+tSG3lXBcYuG7SrmGxuHONqtz2bRHCXcbNBxOZljpQIlx8FNGFmcetLZrTdVSJnGjwLpocZzK4xlYB878DEgvgKHEcSYU7sUpy25keuADomz+XEYOJwLZ7fqwKPuJ7hfO5yvOoW1qX0f54UIUIGXe2WBM02bR0ZSCIij4k/+hKlzpGPdihXmvXMOm/7XjUUkixF5ziphz3Dq77xV9aWePW+GOqP28xgIMYy5RBYhP2N6M0ugalyYjyJJlGXdAgwLhAsovfyjr04kbElNcztdt82v1VmiS+0WC9oDrR5Q0QnFZAiJtpigwNfSGjr8DgfZKb0ohWAOMOVLjWzAPuRG6KwoZIaWOA8BniPPVCRb4h5fvU4hMKC3BhlUVBZUpct6wKoLJlnAR5TXc5BFpNsBmHAtZbaEy93LjpIYNmmKikcpX52tjrDED5WApnsRpazbiljyHSIVi80sVJyqwwN/sEgGOkyefyKEfuBtKh/K2nwW8WBi96HMi1/nEStMC+/RSVw+r+Pf3BLazrdu2wkwo5aftwFKsh7SClcpb//2ecgX+XxXU+gqgaUds3QlB8qcssLvWf5EW7bAm//X1DMsM59VmUAYaM8bOXyvBlGhOnQbEuXtLI03EbskVgUWD/ZygU2UKKC5o+Oyq0CXvAsAb5JuEQYDACpwsY/nlsUkFHB2iLEyiW7V9LqsT66+xuiLPkoF56vzU3hvaM5EGtPgfo4JnE9EcQTXqq0K13eAnX6LoDWIJajen6/6LHJeLEPIt4A9Qf+up+ww/RMCShDevrDPC/jAtabuqipnakM/gkHG8lfJGzVKAs5eigg50oQb3/nkry6QXk7H0XwuLsXEGNHPcIQtrPwVwQTD7dnBYHZo7XvyW4Z7b2530n4CUN29494GuOuyjFsUwX18DOtZHV/26Skb/7s7ndUPS1Soa3CDy/G0oQkwMMJ/7lo1NM0W70BinioOngUdc2TB74xnGyRoZrItckuxeE X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9af9ed1d-9519-4440-ef77-08dc1a7e95e6 X-MS-Exchange-CrossTenant-AuthSource: TYZPR01MB5556.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2024 12:43:36.6943 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSQPR01MB6119 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240121_044343_910415_CD51ECD4 X-CRM114-Status: GOOD ( 11.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Ziyang Huang --- drivers/net/mdio/mdio-ipq4019.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/mdio/mdio-ipq4019.c b/drivers/net/mdio/mdio-ipq4019.c index 78b93de636f5..b52c5e1fb99b 100644 --- a/drivers/net/mdio/mdio-ipq4019.c +++ b/drivers/net/mdio/mdio-ipq4019.c @@ -12,6 +12,7 @@ #include #include #include +#include #define MDIO_MODE_REG 0x40 #define MDIO_ADDR_REG 0x44 @@ -40,6 +41,7 @@ struct ipq4019_mdio_data { void __iomem *membase; void __iomem *eth_ldo_rdy; + struct reset_control *rst; struct clk *mdio_clk; }; @@ -219,6 +221,10 @@ static int ipq_mdio_reset(struct mii_bus *bus) fsleep(IPQ_PHY_SET_DELAY_US); } + ret = reset_control_reset(priv->rst); + if (ret) + return ret; + /* Configure MDIO clock source frequency if clock is specified in the device tree */ ret = clk_set_rate(priv->mdio_clk, IPQ_MDIO_CLK_RATE); if (ret) @@ -248,6 +254,10 @@ static int ipq4019_mdio_probe(struct platform_device *pdev) if (IS_ERR(priv->membase)) return PTR_ERR(priv->membase); + priv->rst = devm_reset_control_array_get_optional_exclusive(&pdev->dev); + if (IS_ERR(priv->rst)) + return PTR_ERR(priv->rst); + priv->mdio_clk = devm_clk_get_optional(&pdev->dev, "gcc_mdio_ahb_clk"); if (IS_ERR(priv->mdio_clk)) return PTR_ERR(priv->mdio_clk);