Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2103840pxp; Mon, 21 Mar 2022 11:21:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztpiCUBgTjydg5kXra+SksxykZrc6T2qy5h7v46blxc+CaIc0YUCGQiUxf1l7/OBe5g0YD X-Received: by 2002:a17:907:3e98:b0:6d7:7c21:529f with SMTP id hs24-20020a1709073e9800b006d77c21529fmr22392210ejc.104.1647886890141; Mon, 21 Mar 2022 11:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647886890; cv=none; d=google.com; s=arc-20160816; b=sqwJdYooFd0+w0V1UVytnvdUaZmWS6upVqmWPSODoiUpTil15DJBKG/myTJYkMdmhx rlar04/9sTOlu/LLCE0CIRvUG02HhUNeJHPC/D4KkOhgy5u/iTmouSmW7t/F9kUyICA5 pC43iPvr8Rb0mVwvZwXXhQEKXBjc4k5jOpG2Cl0CTsvtAsskPZWl/lpLQ0oIMw/VbQGc v+KH92phmEZWkYWoOCzSt6Dbk3NtiSXKmfGVwfgjPOvSpUSV8+W82eRcERGUbkrxCyUu cdnE9POLJB/XUIcY67iJt91j9u0s34E8vGW/ze9HL7f7FQP5bVOQK9ePMtmZkq0w/o4F 8G7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=j1fkKnNJNVdlo9gmNIkbdt+RdIW6v7s4LBl6Bt60wbw=; b=bFrxwoNpMPzVq7XNF7ZDNUCEBx728fSMhwUn7VPZ6DzMcXvQXt51ryCZNkEx5i5JxT CkAWmk/xws4IPoGZbqklo5v8PKRpDx0PA6qVGsov7YztP45X4OP6ykT5kg1EiruTuCjT 7LZQwB+XX8aWGVNXn+9pKcfiwdRlJJOyuvMQetnsov6MKvq7YZ/Yo7maQNG17pNd89/b nYfvvS32MrXQx3jFbRYv5BdKWbZEbv7ZodZGoCbna0Nqsnl7A0CC5RwwLHZDewUFO2cr bgmAM1zNYp3Eg5cvvuHyS1DOTDLt37FKYWc20a342LQyh+9RiBJJzENGXRnzW8d8ERDb 8IUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020a170906475800b006df8927010fsi7215769ejs.777.2022.03.21.11.21.01; Mon, 21 Mar 2022 11:21:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344740AbiCUHKF (ORCPT + 99 others); Mon, 21 Mar 2022 03:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344734AbiCUHKC (ORCPT ); Mon, 21 Mar 2022 03:10:02 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA8EA3FD8C for ; Mon, 21 Mar 2022 00:08:37 -0700 (PDT) Received: from twspam01.aspeedtech.com (localhost [127.0.0.2] (may be forged)) by twspam01.aspeedtech.com with ESMTP id 22L6ovSs062554 for ; Mon, 21 Mar 2022 14:50:57 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.25.1