From patchwork Mon Mar 21 07:01:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Hung X-Patchwork-Id: 12786880 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 F0A39C433F5 for ; Mon, 21 Mar 2022 07:03:43 +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=qD4Yp0fuIfkh+qChtqGdiafjTX8niYg5Mx6U01mpYK8=; b=zQ1WSfTy4Z3GiM 5q+a938/y9WofCQjWMV+iZdAE3bkbwf9WOgI2d+wIZqqjLiJYnHIrAndk08uecgWwxhsNb/S8Qd0A dYp7gI+JwMUToVPz8NypwN2NJUbco5mYI/wHkL4zdWb+Fo+h+MuKNNDWvaS4+kYvPIlhC7WT1VM7L c1M1d6Ndy2qiiv653p5baSZEJPgIfJ0aXLkP0A09Vk7xRC+8JS4tJlmJtWeMR81IaMoxOhD6zHFeq hQAs9z+yo59RuuCK/t3ITbxvTYAhb09AJVe4bls2AyJz3VmiL/1uL+6cQVpjcKfiP7MTW3+2a49sK k4RPaPkNXbU+yuvUCLUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWC3b-006jN4-0w; Mon, 21 Mar 2022 07:02:23 +0000 Received: from twspam01.aspeedtech.com ([211.20.114.71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWC3O-006jLI-QF for linux-arm-kernel@lists.infradead.org; Mon, 21 Mar 2022 07:02:13 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 22L6ofA0062512; Mon, 21 Mar 2022 14:50:41 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) Received: from DylanHung-PC.aspeed.com (192.168.2.216) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 21 Mar 2022 15:01:06 +0800 From: Dylan Hung To: , , , , , , , , , , , , , , CC: , Subject: [PATCH 1/2] net: mdio: add reset deassertion for Aspeed MDIO Date: Mon, 21 Mar 2022 15:01:30 +0800 Message-ID: <20220321070131.23363-2-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321070131.23363-1-dylan_hung@aspeedtech.com> References: <20220321070131.23363-1-dylan_hung@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.2.216] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 22L6ofA0062512 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_000211_254398_E1F14064 X-CRM114-Status: GOOD ( 11.28 ) 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 Add reset deassertion for Aspeed MDIO. There are 4 MDIO controllers embedded in Aspeed AST2600 SOC and share one reset control register SCU50[3]. So devm_reset_control_get_shared is used in this change. Signed-off-by: Dylan Hung Cc: stable@vger.kernel.org --- drivers/net/mdio/mdio-aspeed.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mdio/mdio-aspeed.c b/drivers/net/mdio/mdio-aspeed.c index e2273588c75b..8ac262a12d13 100644 --- a/drivers/net/mdio/mdio-aspeed.c +++ b/drivers/net/mdio/mdio-aspeed.c @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,7 @@ struct aspeed_mdio { void __iomem *base; + struct reset_control *reset; }; static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum) @@ -120,6 +122,12 @@ static int aspeed_mdio_probe(struct platform_device *pdev) if (IS_ERR(ctx->base)) return PTR_ERR(ctx->base); + ctx->reset = devm_reset_control_get_shared(&pdev->dev, NULL); + if (IS_ERR(ctx->reset)) + return PTR_ERR(ctx->reset); + + reset_control_deassert(ctx->reset); + bus->name = DRV_NAME; snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); bus->parent = &pdev->dev;