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 8C5E3C43387 for ; Wed, 16 Jan 2019 13:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43AF1206C2 for ; Wed, 16 Jan 2019 13:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547644479; bh=lsAEm1dSM625V87S4gawcuHoJggd6vNTFeydr6RF5Eo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=ca/SAokAfEs0eq7fapN8FmT4jogPeRN/IVy2SX5z+A9ZYzTp4ti6B5RnzuuA7vPNw 5k8gOwq/nEj32jaWaG+XKdZS8rrChWbGP8HumA7e/XJYC7YTkCMTSc5tsE77KefXst AgmiRzqrnvffm24XWO3JJaobSOscnYD4gkwWcdTU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390344AbfAPNOi (ORCPT ); Wed, 16 Jan 2019 08:14:38 -0500 Received: from icp-osb-irony-out9.external.iinet.net.au ([203.59.1.226]:44997 "EHLO icp-osb-irony-out9.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732810AbfAPNOh (ORCPT ); Wed, 16 Jan 2019 08:14:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AiAAAdLT9c/zXSMGcNVhkBAQEBAQE?= =?us-ascii?q?BAQEBAQEHAQEBAQEBgWUCiBKURQEBAQEBB4EIhAeFVoRdigWBZ4R5AoJ1OQU?= =?us-ascii?q?MAQMBAQEBAQEChmACAQMjFUEQCw0NAiYCAlcGDQgBAYMegXWqcXGBLxqFKYR?= =?us-ascii?q?vgQuBc4lYeIEHgTiCa4FBgyQFgyCCVwKQS5FFCZINBhiKNAOHVIhKlCKBdjM?= =?us-ascii?q?aCCgIgyiCJgwLE44djBIBAQ?= X-IPAS-Result: =?us-ascii?q?A2AiAAAdLT9c/zXSMGcNVhkBAQEBAQEBAQEBAQEHAQEBA?= =?us-ascii?q?QEBgWUCiBKURQEBAQEBB4EIhAeFVoRdigWBZ4R5AoJ1OQUMAQMBAQEBAQECh?= =?us-ascii?q?mACAQMjFUEQCw0NAiYCAlcGDQgBAYMegXWqcXGBLxqFKYRvgQuBc4lYeIEHg?= =?us-ascii?q?TiCa4FBgyQFgyCCVwKQS5FFCZINBhiKNAOHVIhKlCKBdjMaCCgIgyiCJgwLE?= =?us-ascii?q?44djBIBAQ?= X-IronPort-AV: E=Sophos;i="5.56,486,1539619200"; d="scan'208";a="138213150" Received: from unknown (HELO [10.44.0.192]) ([103.48.210.53]) by icp-osb-irony-out9.iinet.net.au with ESMTP; 16 Jan 2019 21:14:31 +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> From: Greg Ungerer Message-ID: <232bd78d-27a5-78d3-ae25-5dd782be5c4b@kernel.org> Date: Wed, 16 Jan 2019 23:14: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: <20190115131837.GB19687@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 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 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). Regards Greg