Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753424AbdCMXLd (ORCPT ); Mon, 13 Mar 2017 19:11:33 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:46723 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751266AbdCMXL1 (ORCPT ); Mon, 13 Mar 2017 19:11:27 -0400 Date: Tue, 14 Mar 2017 00:11:17 +0100 From: Andrew Lunn To: sean.wang@mediatek.com Cc: f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com, matthias.bgg@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, davem@davemloft.net, Landen.Chao@mediatek.com, keyhaede@gmail.com, objelf@gmail.com Subject: Re: [PATCH net-next 4/4] net-next: dsa: add dsa support for Mediatek MT7530 switch Message-ID: <20170313231117.GF14183@lunn.ch> References: <1489421488-300-1-git-send-email-sean.wang@mediatek.com> <1489421488-300-5-git-send-email-sean.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1489421488-300-5-git-send-email-sean.wang@mediatek.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 945 Lines: 33 > +static int > +mt7530_setup(struct dsa_switch *ds) > +{ > + struct mt7530_priv *priv = ds->priv; > + int ret, i, phy_mode; > + u8 cpup_mask = 0; > + u32 id, val; > + struct regmap *regmap; > + > + /* Make sure that cpu port specfied on the dt is appropriate */ > + if (!dsa_is_cpu_port(ds, MT7530_CPU_PORT)) { > + dev_err(priv->dev, "port not matched with the CPU port\n"); > + return -EINVAL; > + } > + > + regmap = devm_regmap_init(ds->dev, NULL, priv, > + &mt7530_regmap_config); > + if (IS_ERR(regmap)) > + dev_warn(priv->dev, "phy regmap initialization failed"); > + > + phy_mode = of_get_phy_mode(ds->ports[ds->dst->cpu_port].dn); > + if (phy_mode < 0) { > + dev_err(priv->dev, "Can't find phy-mode for master device\n"); > + return phy_mode; > + } > + dev_info(priv->dev, "phy-mode for master device = %x\n", phy_mode); Hi Sean It is not documented in the binding that a phy-mode is mandatory for the cpu port. Andrew