From patchwork Wed Sep 15 17:02:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 12496941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B13C433F5 for ; Wed, 15 Sep 2021 17:03:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0AB526121F for ; Wed, 15 Sep 2021 17:03:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0AB526121F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=O+bnH+XSSz7XvgWHK+5YUG+P9Vy9ppgiS5PHggu5CE0=; b=w0hMr3LM9Ugh3z tSHu5k/Y5kl+gUArkqUEyfz0PWyPgVzWbXl3HjrAb7p5zIfPz8U5Ut4ILJi725zlvmCEggvaAesif j21sNQiBvIYfoJslSMvGgHcCir/hGClotoBJodgSiHGlx5o6S41HfmFNbZkD4lWE9xcFRLWuZkp5U L0Hvf+MGRoNoQX+MfTrmphMltb+ZGznfd9jZhIxivZSwPDVvCxBcNGDdn6hrVYSjZO3PTYi/GjX9O T7fuwGuBGhzmhymXVDnoyYPbpcJtPrTpE7V4K1VYa0fXA2NlXxsxQNDb6PaCy8SDXKKzSRxyYo5BP BhulqNq7IWZVWYlh60vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQYJc-009boL-OX; Wed, 15 Sep 2021 17:03:20 +0000 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQYJZ-009bm4-8K for linux-rockchip@lists.infradead.org; Wed, 15 Sep 2021 17:03:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hUicf6Oe/JKKs2moDFOhES2VMncDn5TTejkrOqWETtMqLsnGDxV4F7deGp2w6Rnx/MuyHBOfBnUIXI3btxLV4AaDUkbaholP7UU6/op/IHsRzhqjxwtNObb0Qf/kUic3yL6SI8bl+JNOhbuZQW7kDSL8WzRZbNnHn0nhFS4yqUXAID5xwt/OF9WD9AV3yWqzzcsuNBWg3RFpaH0gxBu0nLrzpPvEEfYYeFMvTPeMB7cTGZhJzExBoyxHpW5VrAAL2iz9tHESod2osABlAY7JpHPZIPvEqUG3kv7dN67hIq/tXuI/6UGY7bZXSwdywsgbbnRIkp4nvm261Bd72NIUEQ== 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; bh=LEfteUfEDiKFVa+86lkR2BdsoVvBGOj6YoZt9fOflmo=; b=m8V1nzRci/93bU/hjarkldW4yNOUtth41y69qypSm7fgyDnppEsVCM89M8aqBJN2QdOZNkRTK/7Kmp/C19FNnGP3jn1dG6oCJ/HulV+MxD7epUwK+Tt3Kzf0iTZiilHHhrHOIW+L76cmntJTdp3mcD2VCHU2VMapj+hzrrGf0+8Qr5EBryEw7kMjlYyBGUGc7Vi72uDccz3BoRMBpnUuMgPbybTPW0rVR9huvC8c3X6TWbaUHcKbs/AMYPOu4ATh5Faudq10h4Gjat5BAh7PLLHlkRME6J9OBzmrKVroPj9ixtR2W1ZJabSRJhd2IFIgN5Biwha9WC7g931Ku+sa7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LEfteUfEDiKFVa+86lkR2BdsoVvBGOj6YoZt9fOflmo=; b=XGxtgzPo2XovR91T+RMV/nF+HTzETWtbpJ+1NuMxKhYF5saHsk7ing20ZfOTjTvJKbJ6tqz6ZkYPXMywJ1kgQtFhg67oVMh8ZMmMDgNyppDEEAeWomCbcV6zDx3gVpVKfO3Cwa3jdLG0RaFJOMuKTtFGS5XZyMpq3QOS1jcrQck= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=wolfvision.net; Received: from DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) by DB9PR08MB7005.eurprd08.prod.outlook.com (2603:10a6:10:2c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 17:03:09 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::452b:e508:9c57:a6e3]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::452b:e508:9c57:a6e3%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 17:03:09 +0000 From: Michael Riesch To: linux-rockchip@lists.infradead.org Cc: Heiko Stuebner , ivan@ivan.computer, punitagrawal@gmail.com, Michael Riesch Subject: [RFC PATCH 1/3] net: stmmac: dwmac-rk: use stmmac helper functions for pm ops and remove Date: Wed, 15 Sep 2021 19:02:53 +0200 Message-Id: <20210915170255.30561-2-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210915170255.30561-1-michael.riesch@wolfvision.net> References: <20210915170255.30561-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from carlos.wolfvision-at.intra (91.118.163.37) by VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 17:03:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58b3636b-3996-4427-592a-08d9786ab1bb X-MS-TrafficTypeDiagnostic: DB9PR08MB7005: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2gSzzvB47Xkx8hfgK7LMhj1l2DAd0hsPoq7tbqiv50qkB4650Dg3NYuKisJTkBnUPCCAZaplxYG7rbiduCWLatrocDtGQPyS4tX6t8wJgWBH2mp+k4TEOi41y+fF3MZznd+L/xZIzoyiXJuwX7Adb13xWwLk2B7ls1hUKhE0fbGn8Z4ee8zNgylWmVaIFQ+am7tYl27bF67gmHFmI3KwSnFqYNTaSebUkWHzMvzh7mZvbitqNvnMHaR+a11EUhtc3LAwNmDMtEt46BPCRj8jAcviYdCymCbkhq/eqUQOvFOJz5pMjxCXRA9ZqVOQod4kWw9Q8Lwjc4F4ZV6C/OlWtIg8aVCCV35wBQeBZbA26/OneiZWXXjp0JMYG+lrTJc6gjQBkt9LDYp5exs9eNQtpH6UvQI44/e5n0pizzJg5UiACWyZyfB4EJaEwVehR4sSbfFkoKjdnqfFA6b9p/SRzrBD35A08LfaY6HCr8AzoCOadaf4s+1NJGuV/UqRXB4ZjD2lDcZbkwSw7u9gOqgjoHxSRBQT5T+SILnUAOkbDYPBvDMyhCIbDi2LlS3/1TbJ8vvULYzLRtxFTpThhjCrtPVlbBmtEVsjkeKIvn1Az2V+fRo3JdVHbiM9DKM681WBBp2VwXmbU3IXn/MNMuptWHSBpdG2rFvEpnKLWwQ15GNWFSASBxoUxri3FOxwLMhiii2Czl08VJysI7iw1jdG8g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4523.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(39840400004)(376002)(136003)(396003)(36756003)(956004)(66476007)(66556008)(66946007)(6666004)(4326008)(8936002)(8676002)(316002)(38350700002)(38100700002)(5660300002)(2906002)(6512007)(186003)(52116002)(86362001)(6506007)(6916009)(44832011)(1076003)(54906003)(107886003)(83380400001)(2616005)(478600001)(26005)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9FdZiWwIbYgwjNQTVrQADCxEgoqbjJgv23f5WP3QAg5Tg1O5jxqRpaV2R3pQ8YtsfwoEypPh3m9yM2wH7NTQZmY/DveflEz+HfwFEEon+pArOO8vqAIa+3TjUfTYOrGWaVMbQfznRsd3fE3QqrHd4V5jzTYrg98bTgwlt24/OCvPfgZ8JNphkD03rrln/JiBs6SbEFpwrllVmWuSq++R+WQO6sFhGQGo/Cry2G7TRBqhWbzfPGqGIhO2EuQJOIOMaTpGIAA2pWnWbqLbIO5JJGQUyatvxl2Px4Ifti4hQq54tVmDRo/ydRALT3uWlapTU0IGVw2N9dJi3qA+PnL5W33PGZZgIWksjnYpP4vefTYLhnPLGXX1SWFriWQBidu7Uus3+k/YEbGQZsUMabWLvTFwwxIARSe19jPYd5GLhNcQCg2h+/LvueDvejLts8nORglsXMbLeH5hCTMHrGWKSLR508OyjIbTLfZGmEXJ/4EtvzNyOQeSp7S8u9uMbLjZzIqaABcoHak99AjNFBwJqfJgrlUSn82O3pBqUwS2smGmN+/Yr0vmm937PGZW9XKtCku8FttvYjhPISNBIXaZ1iQ/NdBhSCrT6o6Gwi1tYjgTGc4zMFvxcmkGCKcEI+Xs9UlqGYebJZMxIXWtodepcquxqtD65XGIYRTwXHwuNsaIhO4r3Ld17RpcqZVccFmoKm24UTaSwgRjfzzA01d0XoPXB564ooJDuDO/M2i0yOkpNU21fYVbCYUk6xGLtsCTnWA25MFkf1RMtL3vtQuJ1OSd2Q1cQOwi06ZxNrAeeBt/49u2ICtuV3to9D7/08bL0SFoT7Gnlhts0m0Yu43Y+GshMyH8uiz/9xfkWpUWYdrFByUj1B89If6hxYt469BcxWb+aJT8SGlGY70Huky1w+2QjGs9ujXpNw2rmm6F8O360BKfuV05bF91dNICrenDigj6Sh+NZcE10TFQ1CDv/05vrBMIEas8AHLT6kZbInSaVXl0co0fqRxY+FMyUU4LPHb3VBY7/LgarNsQ+0yN5JGuLhdeQekvHLfc2ca+ECNAisGeccSpMg+Rpj63ce7HIqypX3IixZVT6FpEDin0goV6+pfH1yzaHGUWUjc1JqOQOcEDhgycVqDb4dgZdqs9blRY1D3QiE8s/iz0+j2B9HeGhbxsnyvRAbSSoFNgMnfrj3mq146kKWkEJw+haYmxYhIp6NeYOJOT4BdRuvFtkqiBY8jRoVeCKgBTT5vUedozXXIgx4O+XGOqnvGvVEdQYrGLdfVcUO67OVTD+JxZubtt/80/dZKwPhjnR4cC9/WCPHIRWsGb5Ie3mLR9VE1Y X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 58b3636b-3996-4427-592a-08d9786ab1bb X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 17:03:09.4387 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +Hw8Zcj4dsAIsYLUIw1o4I7C5Lq3FfNDs3AglBifmpp3GHVlDJcPUPTii1tSP8fKG7SnENJdlOBq5bu4g1ZxDU0xZPvGFWMKsLaxFKEtSYE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7005 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210915_100317_325872_37D1E7CE X-CRM114-Status: GOOD ( 16.14 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Make the stmmac core responsible for suspend, resume and remove by providing callbacks and using helper functions. Signed-off-by: Michael Riesch --- .../net/ethernet/stmicro/stmmac/dwmac-rk.c | 69 +++++-------------- 1 file changed, 16 insertions(+), 53 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index ed817011a94a..0db8be543ee1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -40,7 +40,6 @@ struct rk_priv_data { phy_interface_t phy_iface; int id; struct regulator *regulator; - bool suspended; const struct rk_gmac_ops *ops; bool clk_enabled; @@ -1482,10 +1481,11 @@ static int rk_gmac_check_ops(struct rk_priv_data *bsp_priv) return 0; } -static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) +static int rk_gmac_init(struct platform_device *pdev, void *priv) { int ret; - struct device *dev = &bsp_priv->pdev->dev; + struct device *dev = &pdev->dev; + struct rk_priv_data *bsp_priv = priv; ret = rk_gmac_check_ops(bsp_priv); if (ret) @@ -1534,13 +1534,15 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) return 0; } -static void rk_gmac_powerdown(struct rk_priv_data *gmac) +static void rk_gmac_exit(struct platform_device *pdev, void *priv) { - if (gmac->integrated_phy) - rk_gmac_integrated_phy_powerdown(gmac); + struct rk_priv_data *bsp_priv = priv; - phy_power_on(gmac, false); - gmac_clk_enable(gmac, false); + if (bsp_priv->integrated_phy) + rk_gmac_integrated_phy_powerdown(bsp_priv); + + phy_power_on(bsp_priv, false); + gmac_clk_enable(bsp_priv, false); } static void rk_fix_speed(void *priv, unsigned int speed) @@ -1591,6 +1593,8 @@ static int rk_gmac_probe(struct platform_device *pdev) */ if (!plat_dat->has_gmac4) plat_dat->has_gmac = true; + plat_dat->init = rk_gmac_init; + plat_dat->exit = rk_gmac_exit; plat_dat->fix_mac_speed = rk_fix_speed; plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data); @@ -1603,7 +1607,7 @@ static int rk_gmac_probe(struct platform_device *pdev) if (ret) goto err_remove_config_dt; - ret = rk_gmac_powerup(plat_dat->bsp_priv); + ret = rk_gmac_init(pdev, plat_dat->bsp_priv); if (ret) goto err_remove_config_dt; @@ -1614,54 +1618,13 @@ static int rk_gmac_probe(struct platform_device *pdev) return 0; err_gmac_powerdown: - rk_gmac_powerdown(plat_dat->bsp_priv); + rk_gmac_exit(pdev, plat_dat->bsp_priv); err_remove_config_dt: stmmac_remove_config_dt(pdev, plat_dat); return ret; } -static int rk_gmac_remove(struct platform_device *pdev) -{ - struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev); - int ret = stmmac_dvr_remove(&pdev->dev); - - rk_gmac_powerdown(bsp_priv); - - return ret; -} - -#ifdef CONFIG_PM_SLEEP -static int rk_gmac_suspend(struct device *dev) -{ - struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(dev); - int ret = stmmac_suspend(dev); - - /* Keep the PHY up if we use Wake-on-Lan. */ - if (!device_may_wakeup(dev)) { - rk_gmac_powerdown(bsp_priv); - bsp_priv->suspended = true; - } - - return ret; -} - -static int rk_gmac_resume(struct device *dev) -{ - struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(dev); - - /* The PHY was up for Wake-on-Lan. */ - if (bsp_priv->suspended) { - rk_gmac_powerup(bsp_priv); - bsp_priv->suspended = false; - } - - return stmmac_resume(dev); -} -#endif /* CONFIG_PM_SLEEP */ - -static SIMPLE_DEV_PM_OPS(rk_gmac_pm_ops, rk_gmac_suspend, rk_gmac_resume); - static const struct of_device_id rk_gmac_dwmac_match[] = { { .compatible = "rockchip,px30-gmac", .data = &px30_ops }, { .compatible = "rockchip,rk3128-gmac", .data = &rk3128_ops }, @@ -1680,10 +1643,10 @@ MODULE_DEVICE_TABLE(of, rk_gmac_dwmac_match); static struct platform_driver rk_gmac_dwmac_driver = { .probe = rk_gmac_probe, - .remove = rk_gmac_remove, + .remove = stmmac_pltfr_remove, .driver = { .name = "rk_gmac-dwmac", - .pm = &rk_gmac_pm_ops, + .pm = &stmmac_pltfr_pm_ops, .of_match_table = rk_gmac_dwmac_match, }, }; From patchwork Wed Sep 15 17:02:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 12496945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E921CC433EF for ; Wed, 15 Sep 2021 17:03:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A41F56121F for ; Wed, 15 Sep 2021 17:03:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A41F56121F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=WIML28THprnHA2Soa5DYFPljzPaXbPMKQuHppBXTDnM=; b=0qzT4DPgywkZjK f0IRxiJvcZK7xFG+PDwW8VOvfjRPgOgF1Zr/jMRmzkf7v+0G/yeeOWi1fKvX8KBNaED117/WFvMmR Iy3mWaz6UJwoj3zVbsGv0+wp39TDIZaoiij7VyWqTdfvXrwLGyD3j8VRKDMQCgPCguRtnDWsvzZd+ htAM/sTPs8FJcNrHgtfdFj97/BZVud/83TRo0n86Q4PvKAS4jFdjkjCy9Ce0owfRR2CYrrO5nWv8l 6gS7VRIY/f2VLNK07wTgj4OWQOIP8t81Rb3AzVQrcArElhz6kgRhiFoq3JCkihxPvLp3rj9LR0Tuc ZPp8VOMmVFy7QpEg6PQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQYJd-009boe-Ec; Wed, 15 Sep 2021 17:03:21 +0000 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQYJb-009bm4-5D for linux-rockchip@lists.infradead.org; Wed, 15 Sep 2021 17:03:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHhE2CEo4pQS8JzddV7B8Bwg0Y4CMLXAkJEPJ32X8mAvUm/ftvzqxR2r9IKIA2Dq5/BJYiUcFeme/oyaun3KoatEcSWAnUpy8ppz2cgg3q6bfcvu3dj63O3Ftax1JkAk+nmYrNK9uWXPf+0vBdddNw6Qe5DIAo5pZC+HQtFt2OAjLN/gPvbFFLGij2QoOCg/4yFeB5tmkNVfLP4ovTN6DKADmEQyM5j+nDeCsgm10UjkFgA8/FNfPgSKRVWOASndtHH6nLxDnXqOgyaGzjuD/8j8XgH8uuGO14vcTSQ9MR+PiatN8+n0nHZFJiSTlVyEI+AxJLLAbWKyfgOHK5L7Qw== 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; bh=IhuXPOOyEKiboULLW0c0dJtGcYrjHHuFZvF+4rVyP+g=; b=ezbvOEVCPBkpVHaPM5qqKBvKMPmsCL92l8my4my8aC6Rwu5gbmeeaavi3DtBAYHrVpX+H5MLqReUN+9xL/LiyUVgTg/45KqKxe+QcaJIuTzBx//j/MB4tZhfkFJp+y8eWA3tXbsHI5cWp1snOfJtb24jLklpUwH7WmrK9XvLFOWduN4u1h9kQqz99VK048QLhuRVVsYxfVQmDJlCyMpMsxrTwL1BuNl7Msa/LCnjAu1ySCH9VYONJHyVLFf5lnJ1g1JlkDemdLFUz/9p6iwB8h/smBa7GJGCWMekL8pC1zP2cTdTjzxTKOaz3N/aO/HKJxnC9en//K4SQPkD+ZKOyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IhuXPOOyEKiboULLW0c0dJtGcYrjHHuFZvF+4rVyP+g=; b=QtxK/OZJ6Wle8YiwklWEak1C8zKUIbteZymlgMzKKovRUghmplv0oubuqmdU7EFPJe8PSsM/OoqFxlRbzzhnyoydhAc4ezF6dMnACZgIyh43iPWDiE7Gw3yIfAA2eRuUvZh57VSKGDD1+M5By4NT5kmq8glm5GP4s5UC/oYxOVk= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=wolfvision.net; Received: from DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) by DB9PR08MB7005.eurprd08.prod.outlook.com (2603:10a6:10:2c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 17:03:11 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::452b:e508:9c57:a6e3]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::452b:e508:9c57:a6e3%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 17:03:11 +0000 From: Michael Riesch To: linux-rockchip@lists.infradead.org Cc: Heiko Stuebner , ivan@ivan.computer, punitagrawal@gmail.com, Michael Riesch Subject: [RFC PATCH 2/3] net: stmmac: dwmac-rk: clean up includes Date: Wed, 15 Sep 2021 19:02:54 +0200 Message-Id: <20210915170255.30561-3-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210915170255.30561-1-michael.riesch@wolfvision.net> References: <20210915170255.30561-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from carlos.wolfvision-at.intra (91.118.163.37) by VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 17:03:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9690be6d-6d4b-48f0-8646-08d9786ab29b X-MS-TrafficTypeDiagnostic: DB9PR08MB7005: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:324; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tB5EIOkJVRMROoWojXagtN9bUJgcnAlAzdU5E/pN4TnJzN71kuAtnDjEZEih9palXPS7emTDWC1gT9/DufkiXwYXhu9pjvB3y4SjTep0MUCY5zJMrXF0Um+59XR4u4SLcgFLVxEhiSEuoIbVPpJiMV2PWn0Arc1jKdNBROBihqkWe5npvQeNHYN/KpnX2ggUhtrcyu1bsSWhKSR7DJUMLmB3MR0pqUbpn4QPkNp571nHE85/AbCQnjwijieDf9Dk31bz5pvbGbuBq92HbP9mRY/3roJqF95KS7InYV6sin+sYdnzrZsXcMeR6pfVO0BiQpMCdxqn6Fp3nAWMIgIa6zsTVWA9y5lnpe16we9xTt79fzC/hFhp4uKybg8Fbb3a/ySdK/cYDXCG3fQiyxWwp6+0BqXak0+5FRCTACsedpjzmwjRSLhjY0Hftgkl7DFqSMGJcoE2COC9Y59/aqp/c952TFxGAHZlB3c79Bcb1hrPbbRJd7r3kK5NUSqFTMV3anrdQs2wXuwtsQBOQzICa40r4ZEzWWre2jCkRgGIqSlOvcy/kevGEdFcYkrSekMbILL1S+1iC2MBmVIpYTqo/dNUHnFE8CwSevy6j00dVPx+lk1pI3Dog3UT/Q/xZoQJerVIvhNfbkWe55igAZbUiEGIw5zVj67iCcakqmz9MPnfDhINTuFzFembDsXucPLMKSnDD2O/is3oorqPEh4xIQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4523.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(39840400004)(376002)(136003)(396003)(36756003)(956004)(66476007)(66556008)(66946007)(6666004)(4326008)(8936002)(8676002)(316002)(38350700002)(38100700002)(5660300002)(2906002)(6512007)(186003)(52116002)(86362001)(6506007)(6916009)(44832011)(1076003)(54906003)(107886003)(83380400001)(2616005)(478600001)(26005)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o9J2d3nGL01ShefIOA7RZhBUNtr2K/eR4XFFUbjaRwjZtN63M4QlTW+StFsdd6eUKMW8AeWr/kEQvJPcw2JfPUE7Hv+aNEbAlDy6Fcf7wV2pCxuzyT1bNOXnO+QYjzsNKJAkOwoEvh7z7XombHedAZnoAqgRMP7ni7ZgLiBxni0mq4Pazc4pwHKS6z1Qg66THKrrCYflRlChN4HXQlaev+jiXDtE2KGfS6wCQtNAlMyXWaC9oNFGsRFJlcbEYf5VJqvNUt/gBd5FnU9rfYYu++ZDMtA6by9rTQBfydMTLWQWINkl6Gjziv3kv/CK3/AaNGl8kyI4yUOiokhiNr5PEpl4rHtCawzDru7qrOtt+A0kvy7blR+snbjKrmNs4p8XkPuZBxayuh2oDldg++OaMwOmazknDb7LWXHfdzngqVn2tAoDOWR5tLBHNZawme6fkwo3en8/3HQiRALVNcBUfr9DJ9EzIznSnsRsohV0vnw/djWwcTjjBALm9yP/TXXAOwe1Qbw6u1z5YTeS+Af8YG2UOGxg7/kLjCy5iWtnrcM2xSgtRZI0tAiiQDEqrYa0hjQ+P6USU/CmD0D01OrqXZBKbqCLlRjrqbAu4sI8O2WHF6YqB2OHCNXXXSJUvUKPxqKBXlZ+TDGeLCSkmLeIlKsY7sl4wSkw4ytBV4QGwQETdLm21HmTbxmo3T4BboRS2t6rye4C2VWt8Wh2apGBSezwLc3mTrZ84Xv7biEItrjGEz/OVhWR3PYnjqD8TIe41+wF8uFyUbefJgYq9GkwXOcTFwB4ZwmLqfPh1Gv4t7rxs+l9POpWk55I/rYIG7hIVASVeWh2joBx9i9+WOS8slJBRHcGeJE12I+nPNpf8dQxWKDe3Khj7a8bn/G1PC2TyEcUppi9dg1+L4eZFzvNosahphMjn4jVH0ZojAelZ0lsFdal7jiZjAwMUx5K7mwmGZgqXdM10AIH/0H0jYE917Im8EYX3tqs+ANZijuqAa6ez691hgbt37P2sFAwqPlrFcZZyW4aSfVgWnXIhvVpN6cQZpHxiIF23fKa5IEH6tb4sYBDqhIf9yGOmmjd9/l/fWKY8LYKVedY+WD4GQYBnuHPS+H69kYm9cKumNVZIl0NZISW/wrOI2bOpXF7Nx3VPUq75OXpqe7VMAhK7iURtkVe/JvGFcR38a58Pt3+EdWhcZVrRcvKSeQ0PSBft0cfmFAKw9au9MhRfzvxUzQBNwrUWyq3xGzXVl7DDqZxyVitbqnSKx3DTXd8OyajtYud1FFJymfkqkPR1qQFjb4tJtrafFjlweTaaYi/FOLygnyoB0nRzQIUcTV9UhryzcO6 X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 9690be6d-6d4b-48f0-8646-08d9786ab29b X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 17:03:10.9518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 54jircjlzIokVjoPZnVMg1UDcekVfwTslpizUQwJxFygMitSyvW9e3r2R2aDLkxe/8nng+w07WR3LFQzyp1XIBnYSrhDB1Am3VaDvco+BFk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7005 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210915_100319_223993_7383698A X-CRM114-Status: UNSURE ( 7.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Sort includes alphabetically and remove unused includes. Signed-off-by: Michael Riesch Reviewed-by: Heiko Stuebner --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 0db8be543ee1..96ec7d73a74a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -7,20 +7,16 @@ * Chen-Zhi (Roger Chen) */ -#include -#include #include -#include -#include -#include +#include #include -#include #include +#include +#include #include -#include -#include -#include #include +#include +#include #include "stmmac_platform.h" From patchwork Wed Sep 15 17:02:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 12496943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA2DCC433F5 for ; Wed, 15 Sep 2021 17:03:27 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9831E61242 for ; Wed, 15 Sep 2021 17:03:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9831E61242 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=I2RWLI59UsxO+q9xO88lQ1Pvmjaj9Zfi2f8u30uNpPg=; b=RNHv7n8FJMm4zG OLCt2cdRlCgX+RRNGY6YD29cAw6Nh3uf0liDcTnFGwbmTp9J6SP4oNV93Z8si7K1r1Spup5MUEJ9b DVcHHfSq6qbj5HFMj6JSuLnuagkxaHbrXUCL+n4ww1scO78cyjnKYPIT2DxtxfRNKszGIQ7q4xsCN zBCDcCJoqMU6g9Vt+CiR6lsrirZTUbK52UkjJF2zOGscLsbUF5qnIOV9Tl7oXKxK6m1lLISLzUq0W u5t4JXEO5Ih16qcSDCd10phkePKwHI/EE3e0fRyq1Zq9/iY3FgSWOWGi0Fy6bpIg5mWLj+Pz+548X OXe7X2m15UX5NC0i3AOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQYJf-009bpH-F6; Wed, 15 Sep 2021 17:03:23 +0000 Received: from mail-eopbgr80054.outbound.protection.outlook.com ([40.107.8.54] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mQYJc-009bm4-PD for linux-rockchip@lists.infradead.org; Wed, 15 Sep 2021 17:03:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0OpVPxq2aJGPiRwLDQP8pQwRqNbd2AbIS6LCNdtunhHE4XSiUro9lh23ygBGatpCSpEYSECjNgNwApHmhcTQDGwkW7x8pSyH1vEBo4P/ERBsFS8Mt7RJ1spwutEgvvCsvlKMsxqEPTxfOAjiSpQajCx35TP83QrFzjj5xFIR+5Kn9AyQpIJxf9uKEqiN6ogYan+XV+A9daFF46svwYqYcbzY0UyI/g6fcRbwdRalbxJ/+dMDUbcHlwpkCuOj5WpENk/8f8RGc3CpjV2+MbcDDsPhumM6MNnSG3Wgbmi3u7ch8oEoz8x4ghQKFL8fA/hzGwoRmVJpWE4ugOVNJ3XMQ== 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; bh=8w03m5085gDNwYtwfBaKIFOhlBrLkB4GPqbX9KiMcCM=; b=ErAxdJTgSV6kJbbUuuUAHgqu56/VpN/8hhNm8ubtHIF9xnvsr8+DAU+GoZ80JsKYeDQs75PyaNaxRmHRyigG2+bzMqurwWZtw7oY5Dr86mrgKhZSuDH2fZSQ71ev9wBkRPqq5Xf3a/h4FonHFdotuiRc6+Sme8eWP2G3s82XDEAsb+t+GiNEPGRNyLEfqNwfy58a19104Z+09G21+6GuQdsX7z8icg46iP6tLdli0mSilJjxzyTmQN8MBeJie3DLSJ1PeUf9jJQYXOoyatifodb8lVjWhVfLwLuD0NpUFI4z1lYFEkH7d5WyB4+/ON+YC7FkDI5pKj6OhvV7B3+13A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8w03m5085gDNwYtwfBaKIFOhlBrLkB4GPqbX9KiMcCM=; b=M1YFsyij7/Wl0lwr1S48fkXYlbBDD1YPk/y4jhrAuSP5LWavtaE1j2ZaHpbHR8x2rEVdZn34JbN3zBUG6vTAliEZdLSkVJ+MAQP7Im4O3LbAh/j2nKtjO91S58y9J0zkfb8bv6/ybYdQN/J6dkhQRWD1vN5wvGiGKr68jITtS4A= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=wolfvision.net; Received: from DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) by DB9PR08MB7005.eurprd08.prod.outlook.com (2603:10a6:10:2c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 17:03:12 +0000 Received: from DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::452b:e508:9c57:a6e3]) by DBBPR08MB4523.eurprd08.prod.outlook.com ([fe80::452b:e508:9c57:a6e3%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 17:03:12 +0000 From: Michael Riesch To: linux-rockchip@lists.infradead.org Cc: Heiko Stuebner , ivan@ivan.computer, punitagrawal@gmail.com, Michael Riesch Subject: [RFC PATCH 3/3] net: stmmac: dwmac-rk: use stmmac helper functions for clock management Date: Wed, 15 Sep 2021 19:02:55 +0200 Message-Id: <20210915170255.30561-4-michael.riesch@wolfvision.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210915170255.30561-1-michael.riesch@wolfvision.net> References: <20210915170255.30561-1-michael.riesch@wolfvision.net> X-ClientProxiedBy: VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) To DBBPR08MB4523.eurprd08.prod.outlook.com (2603:10a6:10:c8::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from carlos.wolfvision-at.intra (91.118.163.37) by VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 17:03:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2d5534df-c8cb-4b83-9929-08d9786ab37e X-MS-TrafficTypeDiagnostic: DB9PR08MB7005: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:175; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1MtIE4SJR0pkY8xJrA0iDtowbXyAikpEr8VJAfF547DNaMQR9BY/T7wxTjfVUtioUmkkw18/E2KN7r1DghpGZ0wkxabv6Kud5skISFO4ILDTaj9Wfmh5lE5W43OpH009wEzD4CCsTC276Jxj0bO+C4M/NCgdlnL0rlNRmvV+AqQjLFlo3Ie3ZKw2C0GwWZO3uF5sS8//gjSXfRZFmrqpB8Y9G11ACVBy+1QOA1h63vQYpxtcaymZrSopmlKSBlcyEjpHmgYYwlzgRqPS7DqV1IJTKnTInMPy6qGrIYfE19W2cwCnOPSdfP0vHFs7ReyFauNdun5PdcE4F6MDqXhdKK0CKrQ2Nl1J7HWIWJtiNUpC1Uq3/3ZoO2Re86xLqcbkhvvZW44795i1OdwjGeqvRP6EMf6RyPGZ4TPDlf07RmlK9or3cRCixidFP3kpZgljn+pbirCWKQBan5mwXoHvBRPk5bDw08hrhpFDEoISaUEtkXUIi361kmXQxc17+eTnOehmZgDGdNt2A2odm/ws1sYbGObY7xQYvEOWWViDhw6IagoSwaP6UJ5SuWD6p8wIE2kR73ofE6+oSVxSOEJFQIYSjhEDxA0ViH0Y2jjDUJV+wyu4G64xR/AY4k8SAhzu/siTQb3HemDEhR39a9ih01jhPKpCzdfwi8AMNA+SJWFVJqWT8H3d7iyz+WhecilvVrQT7n/I5ahRrKoBU+IrDg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4523.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(39840400004)(376002)(136003)(396003)(36756003)(956004)(66476007)(66556008)(66946007)(6666004)(4326008)(8936002)(8676002)(316002)(38350700002)(38100700002)(5660300002)(2906002)(6512007)(186003)(52116002)(86362001)(6506007)(6916009)(44832011)(1076003)(54906003)(107886003)(83380400001)(2616005)(478600001)(26005)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O72eBsjxJbCeZPNi4CWB0viOf+1XiniYpgOgj94yGi39zcSsCEl9LMM/RmWI1nL1IM+7vezPqq2aLJdDD9y8iY8p5xegzu2AIDl04JDcHRjjnOPyynS/yTq5kKVWhpwX7X8iczN0+DszIPWMfHEFo3o6md6/UtQexO1a79GW9fXLLK1Tcy/T4uj8ZY6Zcbwz8xjovFLVAA7v3WCaa+Lgw85WDx3oQjaVrsCI8W7jEfQAehHvpeTsnhJfczmY7V6haPwS09bZcFtU8U5tTbIEfwwEgSKjRtS6pB695yIvvwEBpnmZTrNhbYSpsrtLoS3ue/mb4i4EXZgdUDFHkuLjE4u3dQTJzAB5VCoSG3yPcV73CVFJh31W+yWSrDYOX00m2UmFKpC0+eFxCIC/G7HS4Df+IpJmCRvjtjFju3MbghKA1n2DU6WTXh77Ig7Q7KGHCTxKdYgx2gJrZTqEkacNfPcXm4gaIzV8bwagT46hwi2tfRZQsvHW3ZTo+d2oN+QQseIv4d5R1rx903omo5l/KEG0t8W49fN9hVNJPXm3WwJtcd3aHWxdFANciS1pRZQju9kZmG7Jegk7t4W2vUh5eUMdwY4s940/hGSbEam8upaiSw5HHMhjwO8tdlMuoIidnOO+fb72P5bDfpS0GXcy//8tkTjPsFu8qGLnk8DnvQPuvwof3g2ZOzaepnN6R5xNRrDUCAmmgyA67jqCcsCGFdzoKJDrzftd587DHdFGA62/L8MzwiQmgqtcQcKQ+yxaVdozOI/g/3Nypni9iu6QA4CuOv+M5tQOYrfWGMHp3JHdgiT8gCUTPVIbSXvCMlOJ42xJ3NH3GO0FLGCHFWM+IUR4iYo9yPcy9wepsYD3KOlMOsm/RJv6d8jrbfXwydEmgypWz+CnxCvJ4037Bsjra6XRg/NlWFouO4jQ1KHGIhfOiIJDXZbwiF/FhhwtP0EDeoRsHAwqm3X764QhP0976ZdMlpTnaq/duESf38WD9XebKuMc1FNiy/bMdZKT5T4DZXUeyKQGIZe1txSZrcm88bikCk5H6R8cYvzwCmrKmy3iGUqX2eHumO16gY+Sg6/8EGh7qeKfkV2kmR8q2ojs5lCZOn3QUarHObMKKEAi+VrO3oa7WiBg+Um8NCfwRjdugrj+KY0M77BKRv0kkNqXCEp3UgbVHRU4cRY8CQwrHvaLTcY2nPrAWE3VPXnWJ9Hb0f9oAgNno6cN3/J1AalqHcn4CNK75Ya7byrMaQFkTkyLayxCQuaqsHeSLMexMvpX+BGSRvQtTJdMfY0RpSOgVWKhdJHkbTZEwvC+2Q20ookhj91vk3aOaM1UAa5HDgNY X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 2d5534df-c8cb-4b83-9929-08d9786ab37e X-MS-Exchange-CrossTenant-AuthSource: DBBPR08MB4523.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 17:03:12.3850 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IIUcRSJxjWJaYMp+s2g5QCTlMPE/veRPvtowMRHdKhYdOeao0gtnpt8bweNgnRNOmWQpu6r3QeJI5msAFId1u07lVU/H3lantrYPRZHC0Vg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7005 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210915_100320_861996_160CD1C3 X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Make the stmmac core responsible for the management of the stmmaceth clock (directly) and the dwmac-rk specific clocks (via a the clks_config callback function). Signed-off-by: Michael Riesch --- .../net/ethernet/stmicro/stmmac/dwmac-rk.c | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 96ec7d73a74a..0a66c3b589b1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -42,7 +42,6 @@ struct rk_priv_data { bool clock_input; bool integrated_phy; - struct clk *clk_mac; struct clk *gmac_clkin; struct clk *mac_clk_rx; struct clk *mac_clk_tx; @@ -1217,11 +1216,6 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat) dev_err(dev, "cannot get clock %s\n", "pclk_mac"); - bsp_priv->clk_mac = devm_clk_get(dev, "stmmaceth"); - if (IS_ERR(bsp_priv->clk_mac)) - dev_err(dev, "cannot get clock %s\n", - "stmmaceth"); - if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII) { bsp_priv->clk_mac_ref = devm_clk_get(dev, "clk_mac_ref"); if (IS_ERR(bsp_priv->clk_mac_ref)) @@ -1245,7 +1239,7 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat) dev_info(dev, "clock input from PHY\n"); } else { if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII) - clk_set_rate(bsp_priv->clk_mac, 50000000); + clk_set_rate(plat->stmmac_clk, 50000000); } if (plat->phy_node && bsp_priv->integrated_phy) { @@ -1261,8 +1255,9 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat) return 0; } -static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable) +static int rk_gmac_clks_config(void *priv, bool enable) { + struct rk_priv_data *bsp_priv = priv; int phy_iface = bsp_priv->phy_iface; if (enable) { @@ -1296,10 +1291,6 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable) if (!IS_ERR(bsp_priv->clk_mac_speed)) clk_prepare_enable(bsp_priv->clk_mac_speed); - /** - * if (!IS_ERR(bsp_priv->clk_mac)) - * clk_prepare_enable(bsp_priv->clk_mac); - */ mdelay(5); bsp_priv->clk_enabled = true; } @@ -1322,10 +1313,7 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable) clk_disable_unprepare(bsp_priv->mac_clk_tx); clk_disable_unprepare(bsp_priv->clk_mac_speed); - /** - * if (!IS_ERR(bsp_priv->clk_mac)) - * clk_disable_unprepare(bsp_priv->clk_mac); - */ + bsp_priv->clk_enabled = false; } } @@ -1487,10 +1475,6 @@ static int rk_gmac_init(struct platform_device *pdev, void *priv) if (ret) return ret; - ret = gmac_clk_enable(bsp_priv, true); - if (ret) - return ret; - /*rmii or rgmii*/ switch (bsp_priv->phy_iface) { case PHY_INTERFACE_MODE_RGMII: @@ -1519,10 +1503,8 @@ static int rk_gmac_init(struct platform_device *pdev, void *priv) } ret = phy_power_on(bsp_priv, true); - if (ret) { - gmac_clk_enable(bsp_priv, false); + if (ret) return ret; - } if (bsp_priv->integrated_phy) rk_gmac_integrated_phy_powerup(bsp_priv); @@ -1538,7 +1520,6 @@ static void rk_gmac_exit(struct platform_device *pdev, void *priv) rk_gmac_integrated_phy_powerdown(bsp_priv); phy_power_on(bsp_priv, false); - gmac_clk_enable(bsp_priv, false); } static void rk_fix_speed(void *priv, unsigned int speed) @@ -1591,6 +1572,7 @@ static int rk_gmac_probe(struct platform_device *pdev) plat_dat->has_gmac = true; plat_dat->init = rk_gmac_init; plat_dat->exit = rk_gmac_exit; + plat_dat->clks_config = rk_gmac_clks_config; plat_dat->fix_mac_speed = rk_fix_speed; plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data); @@ -1603,10 +1585,14 @@ static int rk_gmac_probe(struct platform_device *pdev) if (ret) goto err_remove_config_dt; - ret = rk_gmac_init(pdev, plat_dat->bsp_priv); + ret = rk_gmac_clks_config(plat_dat->bsp_priv, true); if (ret) goto err_remove_config_dt; + ret = rk_gmac_init(pdev, plat_dat->bsp_priv); + if (ret) + goto err_gmac_clks_off; + ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) goto err_gmac_powerdown; @@ -1615,6 +1601,8 @@ static int rk_gmac_probe(struct platform_device *pdev) err_gmac_powerdown: rk_gmac_exit(pdev, plat_dat->bsp_priv); +err_gmac_clks_off: + rk_gmac_clks_config(plat_dat->bsp_priv, true); err_remove_config_dt: stmmac_remove_config_dt(pdev, plat_dat);