Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1487269rdg; Sat, 12 Aug 2023 03:27:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm0kSvX2XkpFy9ItTX+kz78ru5jpbn64DXDEhY+ATqgvMHpmWP9C7bFcwmnFVrlKnQzsC4 X-Received: by 2002:a05:6808:1a8e:b0:3a3:baf8:5b8a with SMTP id bm14-20020a0568081a8e00b003a3baf85b8amr5982673oib.13.1691836025745; Sat, 12 Aug 2023 03:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691836025; cv=none; d=google.com; s=arc-20160816; b=FfAkhO6iF9B76XmlRJeKhbv89e+xZh/2B9fSm8li9btgRtRQv4Jwi3xshP4IhAp4ih 6b7LB4t3+yZiJ3X9QATa+VeIX5Hlvh2ah4HTYYJ9ueI2o9VGCKxNUOk4LpXsv5Bnea7I uHoAs1eqM6WW9pJcHSuJcDqsH3odA/+W+3czAcS8Qg6+dy7YOYyRbobCLyAemfRXUSbA t4NwqZ/9zROmvKYDc9dqkox1q5a7Y3AILG36KG+6vz/ttpq7BkuJCFB9taF+bdplDgw4 9OVp35Lx9r0XsWxvxJCPDqGJcuvTmq/w7NSVjoFBVsFw9JFlVFfL31DlZh93Pqkdhmjo zwsA== 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=nM1ZFvnilyS/G7EEYijFjzJbjPNmckCw5XEVt7NtpBM=; fh=D9XNlYKOFC06k2QakbrL5FFcYvjZrbK98tKVpV9QfMI=; b=HGDXyKXgI/Uh5E+bFEsNY7Ou7ZWZkQtDiNx46G3+Rn4lxo8vWFoQdKZ6Itj1U3kZ5w QkOceySteDMCyq4KhJPoOW9aR9es3I2jjitnk8mo0tdmSH1HLutJOkdncOSCs4ZYFTog U/iUKP0CYZulgETEdVrKC0d/wM1H7y8Zo01o0MjDKnWwNynu6WASRwx94ffIFWMB4i/L pOEfgoxF1bxsQRMTdKjiCDKvOyudS/f1tjE1CMm9KlJH1pcQOQ/32w5YPwxUoZ16eMY5 AZG1irimZ42VKXJgRnt3ugC+YEEQzXW6ZYxMz+sZww7YpHNIzgUmjyEf8A703vcBF9tg xzOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=M4LDCttv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a056a00230b00b00687505e2bb8si4890674pfh.24.2023.08.12.03.26.29; Sat, 12 Aug 2023 03:27:05 -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=@arinc9.com header.s=gm1 header.b=M4LDCttv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236695AbjHLJSN (ORCPT + 99 others); Sat, 12 Aug 2023 05:18:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236687AbjHLJSM (ORCPT ); Sat, 12 Aug 2023 05:18:12 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCCFA2D79; Sat, 12 Aug 2023 02:17:50 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2644E1BF206; Sat, 12 Aug 2023 09:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1691831869; 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: in-reply-to:in-reply-to:references:references; bh=nM1ZFvnilyS/G7EEYijFjzJbjPNmckCw5XEVt7NtpBM=; b=M4LDCttven4/mL4MjnPQuo743z5iornYXnvRxiUnGVZocjSnNA+CppF4S0xPXmg2sPM7x+ ItaVc7rMbi2HOmaNuT+HKtnYvgr+5IBEYWDh3OVmx7E//mx5oTt7DiNeSjjO9ozovrI/wz 9/GTRfOmKH7QxJTv4e4WfgFhl2DJIpHHZymY5sVN7R7F+/1uMao4IOeidWj482wAn89qJx t3taZ4B7D8UKkJc0UpFLT61rIFgi+t0/VNzZxFcoFZk9f5X27nzpEi+k8Pg4mNo0TCVI0H HZPVb9RNO7Ob51Ra1mK8fcIwU6GOoi4LeQJvpyt8NQrG0WQuXVP0hXGUlKaLrQ== From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?UTF-8?q?Alvin=20=C5=A0ipraga?= , =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno Cc: David Bauer , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, 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 4/4] net: dsa: mt7530: register OF node for internal MDIO bus Date: Sat, 12 Aug 2023 12:17:08 +0300 Message-Id: <20230812091708.34665-5-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230812091708.34665-1-arinc.unal@arinc9.com> References: <20230812091708.34665-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 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 8fbda739c1b3..9bb805de397a 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.39.2