Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1067043rwl; Wed, 29 Mar 2023 12:09:19 -0700 (PDT) X-Google-Smtp-Source: AKy350Y7KjIWRvJE1znRFl2af4R7ZilUAOY3JNX01npzM59uUnmUicwRn9Xn9WCev71CiOCmkb/E X-Received: by 2002:a17:907:c710:b0:8b1:806b:7dbb with SMTP id ty16-20020a170907c71000b008b1806b7dbbmr23117325ejc.51.1680116959056; Wed, 29 Mar 2023 12:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680116959; cv=none; d=google.com; s=arc-20160816; b=nFt+Dz1FvfLVGVH8JF59j6Wp5f+4q8O/3DZ84tzb7mXtVDO7diSzuK5Ah8Jl98hdyf QgwctYA4JMI66iHAqbNzdZ86GEKOT3Jz74/XaBsj6f6/Cg8QcPFRmPXzc54mep8GDcAE HKSjdijO5BObUSlG5CrTZuv7tlI4pXxkiBWMVUuZTZMv/IvJ6/GAOQiZ82kfOdxE6lkP A4g0r1fpUla/NvL2JuukE98Cbj706L0nSsUCnImuQFSpDwitczJdvjcG0jAh5TtizxT6 R7cw4W2YrYuw5FmM/DbzD/Zy7HmPSiwGOLtB2GspehIRIgXCswl0Atvxzy+KTMeL8a3M IvxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=W4ihrCozdY4CpOt1bqW3JpcyR0pVtnhYIbVfF7mP0Qk=; b=eldwWKV5j/DUqt+H8og6S0KZ1Fr7YDfmI8uNMGZsU17I+ZHPbzDcPTHEpLHeWOzunY ZJYztoPo9o6Aho4jOz6DNOpYtHEJbQPoG5noVxEXvUwQKg+31J+SZf2G83wjkEcidagQ QqT5wPqf8YdWSCfMTMGRgIkxpv01/PPWFklvmqo2XpT0E/ZBZhAZzvLK34ofbNs3Xi+B ZaEdKbNbAVfJm+dyp/JVY/knqqky9aUBq4SaxG7t7ybF08QkiLMgWYVhTLtqiST8Pwck 9JtYRLrobP97LBx2d33rNvcIA+BDJkbdAhdyOW/rHIAB6GQMt5zPFSRwXj/UKHxmn5l+ qeEA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz31-20020a1709077d9f00b0093defbd6280si17340300ejc.1031.2023.03.29.12.08.52; Wed, 29 Mar 2023 12:09:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbjC2TFP (ORCPT + 99 others); Wed, 29 Mar 2023 15:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbjC2TFO (ORCPT ); Wed, 29 Mar 2023 15:05:14 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B04F1198C; Wed, 29 Mar 2023 12:05:13 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1phb6a-0005fL-2y; Wed, 29 Mar 2023 21:05:09 +0200 Date: Wed, 29 Mar 2023 20:05:06 +0100 From: Daniel Golle To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: Re: [RFC PATCH net-next v3 14/15] net: dsa: mt7530: introduce driver for MT7988 built-in switch Message-ID: References: <371f0586e257d098993847e71d0c916a03c04191.1680105013.git.daniel@makrotopia.org> <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Wed, Mar 29, 2023 at 06:57:54PM +0200, Andrew Lunn wrote: > > @@ -18,6 +18,7 @@ enum mt753x_id { > > ID_MT7530 = 0, > > ID_MT7621 = 1, > > ID_MT7531 = 2, > > + ID_MT7988 = 3, > > }; > > > > #define NUM_TRGMII_CTRL 5 > > @@ -54,11 +55,11 @@ enum mt753x_id { > > #define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16) > > #define MT7531_CPU_PMAP_MASK GENMASK(7, 0) > > > > -#define MT753X_MIRROR_REG(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_REG(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_CFC : MT7530_MFC) > > -#define MT753X_MIRROR_EN(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_EN(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_MIRROR_EN : MIRROR_EN) > > -#define MT753X_MIRROR_MASK(id) (((id) == ID_MT7531) ? \ > > +#define MT753X_MIRROR_MASK(id) ((((id) == ID_MT7531) || ((id) == ID_MT7988)) ? \ > > MT7531_MIRROR_MASK : MIRROR_MASK) > > Are there more devices coming soon? I'm just wondering if these should > change into static inline functions with a switch statement? The > current code is not going to scale too much more. Afaik no devices with different built-in switches are in the pipe at this time, so this should be fine for a while.