From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34EC4C43387 for ; Wed, 16 Jan 2019 16:13:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 026D220675 for ; Wed, 16 Jan 2019 16:13:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="mwDspTmn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405180AbfAPQNK (ORCPT ); Wed, 16 Jan 2019 11:13:10 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45438 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbfAPQNK (ORCPT ); Wed, 16 Jan 2019 11:13:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=QIQ6fSUAYksJGymBotxwDHYqNeFX+myu+7//8Z6rnZQ=; b=mwDspTmnlUFWSVlfSL9aLsRwCgXr/ed9fUgJydP5Jy/nr3qCyju1iRH5lsrh+OR6LWiSkZlueBPt26PZcCmvIP3G9qelQtPcrPMLOP9gZf3fy77cG0mVmpEpapdztUX0+R6Ih1s3Bxlbv7mUAaJSJ8alhgG39NRZTQvDyFiAZjc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gjnoG-0008L4-FG; Wed, 16 Jan 2019 17:12:56 +0100 Date: Wed, 16 Jan 2019 17:12:56 +0100 From: Andrew Lunn To: Greg Ungerer Cc: sean.wang@mediatek.com, bjorn@mork.no, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, rene@vdorst.com, john@phrozen.org, neil@brown.name Subject: Re: [PATCHv2 4/4] dt-bindings: net: dsa: add new MT7530 binding to support MT7621 Message-ID: <20190116161256.GF29244@lunn.ch> References: <20190114070334.20478-1-gerg@kernel.org> <20190114070334.20478-5-gerg@kernel.org> <20190114140702.GG4635@lunn.ch> <91475ef4-2ca1-7341-7b0a-08a8c7e6ee9c@kernel.org> <20190115131837.GB19687@lunn.ch> <232bd78d-27a5-78d3-ae25-5dd782be5c4b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <232bd78d-27a5-78d3-ae25-5dd782be5c4b@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jan 16, 2019 at 11:14:30PM +1000, Greg Ungerer wrote: > Hi Andrew, > > On 15/1/19 11:18 pm, Andrew Lunn wrote: > [snip] > >As i said, it is a bit messy. I would probably have a section: > > > >Required properties > > > >which lists all common required properties. And then a section > > > >Required properties mediatek,mt7530 > > > >With those which are required by that device. > > > Ok, I see what you mean. > The simplest approach is something like this: > > diff --git a/Documentation/devicetree/bindings/net/dsa/mt7530.txt b/Documentation/devicetree/bindings/net/dsa/mt7530.txt > index aa3527f71fdc..47aa205ee0bd 100644 > --- a/Documentation/devicetree/bindings/net/dsa/mt7530.txt > +++ b/Documentation/devicetree/bindings/net/dsa/mt7530.txt > @@ -3,12 +3,16 @@ Mediatek MT7530 Ethernet switch > Required properties: > -- compatible: Must be compatible = "mediatek,mt7530"; > +- compatible: may be compatible = "mediatek,mt7530" > + or compatible = "mediatek,mt7621" > - #address-cells: Must be 1. > - #size-cells: Must be 0. > - mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part > on multi-chip module belong to MT7623A has or the remotely standalone > chip as the function MT7623N reference board provided for. > + > +If compatible mediatek,mt7530 is set then the following properties are required > + > - core-supply: Phandle to the regulator node necessary for the core power. > - io-supply: Phandle to the regulator node necessary for the I/O power. > See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt Yes, that looks good. > > > That leaves the existing if/else with other bindings in place after this. > > Maybe I am mis-reading the mt7530.c code but I am not entirely sure that > "reset-gpios" is actually required for the mediatek,mcm not defined case - > it is optional. (And I actually don't define it for my mt7621 case where > mediatek,mcm is not defined). The gpio seems to be optional in general, any only used for device other than mediatek,mcm. The reset controller is required for mediatek,mcm, but not others. So it looks like the binding document needs a few fixes :-( Andrew