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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS 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 7FCECC43387 for ; Thu, 17 Jan 2019 05:17:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4EB0020657 for ; Thu, 17 Jan 2019 05:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547702258; bh=ZjgMHKBIXoCnJiBdcAvERT4Rqn7i+Fs0+go9mlHmsH8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=H7BahS2ZwIijgOmF6PFCjYQBkZ7jfZmaxGSBB9G6JakQy6Rg735+LBmOlsidcNN1a jTWLzoFxaQ3tnFwnPlbwbPmRYchDtNbKn8GniCgPk+Hd6+usgGQlZTEHZ98eZYWCc0 VGwcVU5iN4ZH/UBjMltzvYRuWd0FvlMz8f4GeMcU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729400AbfAQFRh (ORCPT ); Thu, 17 Jan 2019 00:17:37 -0500 Received: from icp-osb-irony-out8.external.iinet.net.au ([203.59.1.225]:23811 "EHLO icp-osb-irony-out8.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfAQFRh (ORCPT ); Thu, 17 Jan 2019 00:17:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AUAAAKD0Bc/zXSMGcNVhkBAQEBAQE?= =?us-ascii?q?BAQEBAQEHAQEBAQEBgWWIFJRNAQEBAQEHgTWDWoVWhF2KBYFnhHkCgnU4EgE?= =?us-ascii?q?DAQEBAQEBAoZgAQEBAyMVQRALDQsCAiYCAlcGDQgBAYMegXWqOHGBLxqFKYR?= =?us-ascii?q?ygQuBc4lYeIEHgTiCa4FBgyQFgyCCVwKQS5FFCZINBhiKNAOHVIhKlCGBdzM?= =?us-ascii?q?aCCgIgyiCJgwLE44djBMBAQ?= X-IPAS-Result: =?us-ascii?q?A2AUAAAKD0Bc/zXSMGcNVhkBAQEBAQEBAQEBAQEHAQEBA?= =?us-ascii?q?QEBgWWIFJRNAQEBAQEHgTWDWoVWhF2KBYFnhHkCgnU4EgEDAQEBAQEBAoZgA?= =?us-ascii?q?QEBAyMVQRALDQsCAiYCAlcGDQgBAYMegXWqOHGBLxqFKYRygQuBc4lYeIEHg?= =?us-ascii?q?TiCa4FBgyQFgyCCVwKQS5FFCZINBhiKNAOHVIhKlCGBdzMaCCgIgyiCJgwLE?= =?us-ascii?q?44djBMBAQ?= X-IronPort-AV: E=Sophos;i="5.56,488,1539619200"; d="scan'208";a="191113794" Received: from unknown (HELO [10.44.0.22]) ([103.48.210.53]) by icp-osb-irony-out8.iinet.net.au with ESMTP; 17 Jan 2019 13:17:30 +0800 Subject: Re: [PATCHv2 4/4] dt-bindings: net: dsa: add new MT7530 binding to support MT7621 To: Andrew Lunn 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 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> <20190116161256.GF29244@lunn.ch> From: Greg Ungerer Message-ID: Date: Thu, 17 Jan 2019 15:17:30 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190116161256.GF29244@lunn.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Andrew, On 17/1/19 2:12 am, Andrew Lunn wrote: > 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 :-( Yep.. Thanks for the feedback though. I'll roll a v3. Regards Greg