Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp194373rdb; Wed, 20 Dec 2023 09:36:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4bBJnA7EZ/5hqSufmcKQmGF8+8Z/k7rQzZdai9ttFU7DAoEoqPf+abyVFxmYh4Kr9/hnl X-Received: by 2002:a17:902:b108:b0:1d3:e7d3:d459 with SMTP id q8-20020a170902b10800b001d3e7d3d459mr1869864plr.29.1703093774048; Wed, 20 Dec 2023 09:36:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703093774; cv=none; d=google.com; s=arc-20160816; b=J+6iMN2+7xpyjyD0bFOjAdxy3K8RWP7OqaLK0FRn/eESBWeGUP8OW5tz8DkjwXW/F4 OJ2Ofd9W1MOuCar0JFg0PlfZ6d6jOcBczV6BQNH8dUoBgsAC3yGcVHp3qrORNm8zbSCd KsLoDu4qVf/mvpIM9/U16AfFwoIRtBVUeyHhThgtjcDXBksjIn8LRZ3CImO0r3VdJrrs zmt/ZriZYGZwO/P3ZSe8JtiItN2kvQVbfBLQX3qE70GQ9Z+7wVEBwp7N3YmSM/3O+bqN 4fLYI5mjOSBcpZA880ssF5hRhtyb3lWXmDygL3QsmGUwMWw2+sLxLseNeHkk4pzfh7Bc QzOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=fV1sJxMriyTh60SAIXi7liP9zt+2ygBCARx0JGK9+4U=; fh=EUWW8+SxX1HuxD5fLWIEIDJ9dH3hpX1anifItGgv6tA=; b=kM4//SHHNoE4eMk2LNGIz7hCQZ3sspqFd1/y/OnvnSa1s7XQO7A28PkHlNlzCsRIM2 UzerzbfkhisUoWALznEDPSSJE6tFu11azKh49cIwLluhBbvNxgWqfjYFSY1csyWwmHXx 6zUkw340g0uij58vArWA5opHijaU8uJLYqlnwD9s/wMvcjA6pfeHKtylkzjJsRCPrGv4 /7Ukg5L2DrNUPs3dwJbLQrxKo1PYZ+f0JNel1lIBtxHCiXvfRKueKEFkkn9CL+2jMP/L dCcnTTyF1DM1ey0u6tDlpsUtco3UiqgDx0uRguuLMq2iaax0i1nKdHmNzLNRGr+e3zTD ZiNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=ps1VYKic; spf=pass (google.com: domain of linux-kernel+bounces-7355-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n2-20020a170902d2c200b001cfdfa28b70si22293484plc.469.2023.12.20.09.36.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 09:36:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7355-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=ps1VYKic; spf=pass (google.com: domain of linux-kernel+bounces-7355-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B30E4287518 for ; Wed, 20 Dec 2023 17:36:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A94B047A7D; Wed, 20 Dec 2023 17:36:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b="ps1VYKic" X-Original-To: linux-kernel@vger.kernel.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BDAC482C2; Wed, 20 Dec 2023 17:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arinc9.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 40F9AC0007; Wed, 20 Dec 2023 17:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1703093760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fV1sJxMriyTh60SAIXi7liP9zt+2ygBCARx0JGK9+4U=; b=ps1VYKiciDXKUfDbjiWkSBN34+Qb+mbhQCYjPSZwOO0HdhCHI0u82ZTsWuNqBZctmkSGA7 70DC5cbNk4MxJq9m7kjenJaSCEAZvr3xt55QZMiROIc2q0RRi9mZTjZXIsXsUOrRkUU9Lx 3sAbnZqT78jUdW0ocXKc9zhczeGneQGerojtBts+AyOuR0xwEy370/nNwcGFltGXlf7Eql dfntEUE1DzM6lizsRGe0Jkg+9oQEs4q7TCWA35k8Qk2pD3ph0WiJVFwfMoqPDkgNVPLbKx g4so2m+oUR9EwiipDsthT3jSnQ3DAPrjE4BbFBgLAsn8oX+yGtb9SlGQbDRY8Q== From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= To: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Cc: David Bauer , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next] net: dsa: mt7530: register OF node for internal MDIO bus Date: Wed, 20 Dec 2023 19:35:39 +0200 Message-Id: <20231220173539.59071-1-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com 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 Signed-off-by: Arınç ÜNAL --- 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 391c4dbdff42..f8ecc354630b 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2155,10 +2155,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; @@ -2177,7 +2180,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.40.1