From patchwork Wed Mar 29 16:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 76702 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp537393vqo; Wed, 29 Mar 2023 09:27:36 -0700 (PDT) X-Google-Smtp-Source: AKy350aeetKp/cOsNR9vSVdrg/FNh2ZHk6guZecWuBEctEBpQHnuhJYCozEvqNyCaL+Xngznwj1p X-Received: by 2002:aa7:d713:0:b0:501:d52d:7f88 with SMTP id t19-20020aa7d713000000b00501d52d7f88mr19318126edq.10.1680107255924; Wed, 29 Mar 2023 09:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680107255; cv=none; d=google.com; s=arc-20160816; b=v9VSlOBgNT+GsZClptnEvH6HiD/XaLkd3d4fNPd17pbI1T6YA8q+X2QH33UoCqsFdo syFyNhV4ofY3UpzHYvP3vG13rKgqEc5tVB+5x2i1wVZlubkDRRwalPrJse8TAiRKgn+e l2oXxddEKMd6LvuNZ6m2+tcf1wNU0sp8wNcAb33anOZtESv0V3IOxAk+vDZeQmeJ8fFm z9+1wVcAFUNoosO5xbpJ1wO05DVvVFwi9y+PJeHXH/EU+jZqZBKExp903s3IcX0fNQ04 E4Bvl9sbmnNkOUeQlbO2SPns1fe1PMbKc1dCps+gMCxZfNNbl7QLyAD73Jch6ZjQNH0K Xlig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=aqizc6/ZjAWz90A3jk7+7u+bSaPAPILOhNROkch9Cc4=; b=sT2+vZYK6NMNilcEhwGjH/ej4PlMNdrWMNsoag0J02/m4sJOSGAgFx1FlLGfPatKdD lZSXWni5K3IQ5ydKVhLlnrZ+3e5LlXGHI6hmR19ll8HLvEZ8lYUAAe8jNd+QeN/MhJIY TaVTjbPCAY3QVSezNMQFGekDIQK/CXnU+JGpSnq3Pi0EcUkB6iG9X8Hvw/efJu4l7zM7 ss47+DtTePejJHMpMXoBxJOt4FsEHR7PFVt8PFDn4T3p3cTZXZigevSh1vicMZV7XJth TVKK7Z0tKbMLygw6Hz3awJ/ktcnB46uFarYhy2RLiWrYq9B6rMn/nGBzzOZHIH10Tv8w evWg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020aa7d98e000000b005021f0d576dsi14510859eds.692.2023.03.29.09.27.11; Wed, 29 Mar 2023 09:27:35 -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 S229643AbjC2QCQ (ORCPT + 99 others); Wed, 29 Mar 2023 12:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbjC2QBj (ORCPT ); Wed, 29 Mar 2023 12:01:39 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FDF6A72; Wed, 29 Mar 2023 09:00:25 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1phYDc-0003S1-1W; Wed, 29 Mar 2023 18:00:13 +0200 Date: Wed, 29 Mar 2023 17:00:06 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel Cc: Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: [RFC PATCH net-next v3 12/15] net: dsa: mt7530: add support for single-chip reset line Message-ID: <0f696278bd8d13121a500f80cfe2f806debe4da5.1680105013.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761720146245243706?= X-GMAIL-MSGID: =?utf-8?q?1761720146245243706?= Similar to multi-chip-module MT7530 also MT7988 uses an internal reset line instead of using an optional reset GPIO like it is the case for external MT7530 and MT7531 ICs. Add support for internal but non-MCM reset line in preparation for adding support for MT7988. Signed-off-by: Daniel Golle --- drivers/net/dsa/mt7530.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index c6fad2d156160..fd55ddc2d1eb3 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -3066,6 +3066,12 @@ mt7530_probe_common(struct mt7530_priv *priv) dev_err(dev, "Couldn't get our reset line\n"); return PTR_ERR(priv->rstc); } + } else if (!priv->bus) { + priv->rstc = devm_reset_control_get(dev, NULL); + if (IS_ERR(priv->rstc)) { + dev_err(dev, "Couldn't get our reset line\n"); + return PTR_ERR(priv->rstc); + } } else { priv->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);