Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3898284ioa; Tue, 26 Apr 2022 11:56:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBsKeYt7V++f3zZMr09X4xoFtURQYaXB/iBjrAMAFtiqPxivm91GR3mcW91HJjw/ZpL3yp X-Received: by 2002:a17:902:bf4c:b0:15c:3d1b:8a47 with SMTP id u12-20020a170902bf4c00b0015c3d1b8a47mr23331156pls.118.1650999401914; Tue, 26 Apr 2022 11:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650999401; cv=none; d=google.com; s=arc-20160816; b=hoyRnHy31hGlVeJo5Q2VzFcpPMd3r7rbrF5Y06B5gNW7Q9mGRKPOGdd8avsoUqkNJV p7MDXI6fy1rbi4xYSZfwpESYXSJGGc/SBQT2H1j81/vlEsqTQuXpFSl6pCTsSe5umu7F H0SZfMMJ3cO8GoDQGcSJ1nnpmdkN7yfSDOn99txdWD/fz08BWdxMpWeXgH1TgPXxB26W U+6mx60ILBxDoVsx7wP9kh7OC3ZlSBS9wYoTfdFqv4GtMxW5uXqdhzKewUWT/jkBdWJI 5TacAauvSaiSgf6RKEGG/8BkrDke+utZFVJasRiD5E9xoMSYrLOfroaVaamMFvm7irm1 3yfg== 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 :dkim-signature; bh=9T6dfbFLzZWVvyVq0SMrDb0x/bFX4493F6lZIKD4BEA=; b=1AhYib/+d+uWaFv8rxe3pzS/96vruW13d4OQY2udM0xD42Nywfva8sWpHB95nJ2qVD Hl9meMIYjYVlpxqqLABrijw/1Wr87D+/5OzFylbRmWSuVhhwYv4EIUDwq/IxccI5ovRx IseNjjviQAWFjTXWfT83k2B34lsnSrF/abz2KHm2/MhMhBk1E36jZhn7D5cXvy8woIgQ qPoa60GTW+cQLYgsNtTUPkyrhVF8sg4gwQr1hA1etRKWgJlDoEfqLESF4r53RY9cdlWO BaSKbhBNJBCjvsg3TBqB10L9fKRnRbAuxizyiD3nuIkGe3TqqQU9tJK6FtwT3I6owVrD PRkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b="OXU/sxWX"; 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 k34-20020a17090a14a500b001d97cb4fb82si3246491pja.43.2022.04.26.11.56.25; Tue, 26 Apr 2022 11:56:41 -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; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b="OXU/sxWX"; 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 S1351087AbiDZNwq (ORCPT + 99 others); Tue, 26 Apr 2022 09:52:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350678AbiDZNwo (ORCPT ); Tue, 26 Apr 2022 09:52:44 -0400 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5504F6E565; Tue, 26 Apr 2022 06:49:36 -0700 (PDT) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout3.routing.net (Postfix) with ESMTP id 9AB776046E; Tue, 26 Apr 2022 13:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1650980974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9T6dfbFLzZWVvyVq0SMrDb0x/bFX4493F6lZIKD4BEA=; b=OXU/sxWXuSmpwGApm8WL8UWVW0Ylkm4b6uGIlOgLznGJkjdEf7iZ6FSy73KLWP11Ped9KD A7QpM75eZfHPjBbszJU8auHURDDMg6eKmhH24qbOWDiJPXAUd3sum4P5y9WRk+MytqVlu0 pYEm+l7TIpM6Sr4VVbC6BybBtFBrkm0= Received: from localhost.localdomain (fttx-pool-80.245.77.37.bambit.de [80.245.77.37]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id A01D936065C; Tue, 26 Apr 2022 13:49:33 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org Cc: Frank Wunderlich , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Sean Wang , Landen Chao , DENG Qingfang , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Matthias Brugger , Peter Geis , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC v1 1/3] net: dsa: mt753x: make reset optional Date: Tue, 26 Apr 2022 15:49:22 +0200 Message-Id: <20220426134924.30372-2-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220426134924.30372-1-linux@fw-web.de> References: <20220426134924.30372-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mail-ID: 136ca4f9-f5c5-40e4-a2e3-6f99f2bf827a X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Frank Wunderlich Currently a reset line is required, but on BPI-R2-Pro board this reset is shared with the gmac and prevents the switch to be initialized because mdio is not ready fast enough after the reset. So make the reset optional to allow shared reset lines. Signed-off-by: Frank Wunderlich --- drivers/net/dsa/mt7530.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 19f0035d4410..ccf4cb944167 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2134,7 +2134,7 @@ mt7530_setup(struct dsa_switch *ds) reset_control_assert(priv->rstc); usleep_range(1000, 1100); reset_control_deassert(priv->rstc); - } else { + } else if (priv->reset) { gpiod_set_value_cansleep(priv->reset, 0); usleep_range(1000, 1100); gpiod_set_value_cansleep(priv->reset, 1); @@ -2276,7 +2276,7 @@ mt7531_setup(struct dsa_switch *ds) reset_control_assert(priv->rstc); usleep_range(1000, 1100); reset_control_deassert(priv->rstc); - } else { + } else if (priv->reset) { gpiod_set_value_cansleep(priv->reset, 0); usleep_range(1000, 1100); gpiod_set_value_cansleep(priv->reset, 1); @@ -3272,8 +3272,7 @@ mt7530_probe(struct mdio_device *mdiodev) priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(priv->reset)) { - dev_err(&mdiodev->dev, "Couldn't get our reset line\n"); - return PTR_ERR(priv->reset); + dev_warn(&mdiodev->dev, "Couldn't get our reset line\n"); } } -- 2.25.1