Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1130838rwb; Sat, 5 Aug 2023 07:59:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHYHhwrUosVapuQTXqiui6/5OTLlKlHbSdK8g/2ueQtpIgyi0NpPrfDYu8lb+34a83EWnJ X-Received: by 2002:a05:6a21:718a:b0:133:be16:509 with SMTP id wq10-20020a056a21718a00b00133be160509mr2844062pzb.34.1691247541833; Sat, 05 Aug 2023 07:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691247541; cv=none; d=google.com; s=arc-20160816; b=HwIRIP9cmpZ5HokFoI/c9zD1Z4gGM/u6jgC9mru5fPnjCmrXw/lymLXlMqUL8DBSLc e15yXFqdhypHMmOcDZbbZFHqyoAIgE5zMuy0xDPIcmEcNo6qHMbl1x/kj9jOSABnYu3N 3lY28AavHFbVbDlfCs/aiyih6oyz7imqig/HK8A1kLY0ycSU8tKu8diXG4y+exI8fZIh 8KL+D80djBTcgGfytvmCpFuREEOCbZXp7vawp5IPNzre7FAijQz4+87ZiVtAm/P8FCLf vO5NNFlk61c5LPkvYJs1/GGUSrg0Eima8SHAAojvglc0XG83PYu7eZ8KrQ3CfM6gVuXx T5yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=bHamsYMKRaMPhubzkLkNWDwzup6VhOCBFWy/2PzAqo4=; fh=vl2FZ9uzCyg3wCpbehRM5aU64q64jQWw5QyDb8W+lEE=; b=xziSQOL3wcPxqcaNa44LKasSFvNgYreVdWBmsHNWrhQMLVCejxwyOJolNutFE5qopa ZHANotW3z3v6m24sMscKDJV10PXION/ht+ezfFPg8XmG3Q1/5ZQkTbu8xtBZiYtq3L6+ JzNuww4BRGOMVugg1/P7rpWqbZZv2dqJLXuz5EMLupWZLCdbuLBhGW/3fZkfZcS6tZWn 8xqBuDItVYThIYLtdmUFhC0iIOCRoplC6r8L+GWZ0Tsz7ZJI70CB3F/WtdlaGiYpFFdR wHicOf3W7/OQoTjW8JGAdx0kl4OfKQ+oGFTFdxNFPZa7hHydh5LRolpXa4tTl37fMxMS Qq+Q== 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 h13-20020a63530d000000b00563e9d316desi3296556pgb.465.2023.08.05.07.58.50; Sat, 05 Aug 2023 07:59:01 -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 S229721AbjHEOnm (ORCPT + 99 others); Sat, 5 Aug 2023 10:43:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjHEOnl (ORCPT ); Sat, 5 Aug 2023 10:43:41 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8A4B1FE6; Sat, 5 Aug 2023 07:43:38 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qSIUq-0000N9-0A; Sat, 05 Aug 2023 14:43:12 +0000 Date: Sat, 5 Aug 2023 15:42:58 +0100 From: Daniel Golle To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH RESEND net-next 1/2] net: dsa: mt7530: register OF node for internal MDIO bus Message-ID: <6eb1b7b8dbc3a4b14becad15f0707d4f624ee18b.1691246461.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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: David Bauer The MT753x switches provide a switch-internal MDIO bus for the embedded PHYs. Register a OF sub-node on the switch OF-node for this internal MDIO bus. This allows to configure the embedded PHYs using device-tree. Signed-off-by: David Bauer Signed-off-by: Daniel Golle --- drivers/net/dsa/mt7530.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 8fbda739c1b35..9bb805de397a9 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2152,10 +2152,13 @@ mt7530_setup_mdio(struct mt7530_priv *priv) { struct dsa_switch *ds = priv->ds; struct device *dev = priv->dev; + struct device_node *np, *mnp; struct mii_bus *bus; static int idx; int ret; + np = priv->dev->of_node; + bus = devm_mdiobus_alloc(dev); if (!bus) return -ENOMEM; @@ -2174,7 +2177,9 @@ mt7530_setup_mdio(struct mt7530_priv *priv) if (priv->irq) mt7530_setup_mdio_irq(priv); - ret = devm_mdiobus_register(dev, bus); + mnp = of_get_child_by_name(np, "mdio"); + ret = devm_of_mdiobus_register(dev, bus, mnp); + of_node_put(mnp); if (ret) { dev_err(dev, "failed to register MDIO bus: %d\n", ret); if (priv->irq) -- 2.41.0