Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp923529rwl; Wed, 29 Mar 2023 10:07:05 -0700 (PDT) X-Google-Smtp-Source: AKy350ZtkiFHKEibY1VNfLYGxJKAONuiyXRVdzd5qe7Y5564zhOB3DhmibpIm3B1thIu7NdlmPzx X-Received: by 2002:a05:6402:1291:b0:501:c0ef:6698 with SMTP id w17-20020a056402129100b00501c0ef6698mr18800379edv.39.1680109624821; Wed, 29 Mar 2023 10:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680109624; cv=none; d=google.com; s=arc-20160816; b=tAsmbDoZWm/Gd0HeoXSOZPNOl/0sfmeyNxZfa/raw58bRUqDTBAn7ZGFQzLaGMNiAk 1L6n0WbN631OCDxYQSrXvvveBpbv4/V6XGjPrHlRqMNeyRWv27oCWpeOnpiFKgcOmM6p 2lYaImOMMQGubs2lL2naOrYihfbXDq2JzQP1MRX3Pn/JWd+vmOO0OT3r21dOplGZe7n/ UtYGLQt//kc5qiyszQjuQl6G/2n7l6Oc8H+AOVHrt+yPM0bY7ec+xrrFAsUp6WLLPtZN 84ne54RODuw0kP4EUT+di2cLRED8EFoNfdszVHLpyCF/pRxRv+NE3oOVrbFYGWqHjN5F TBMQ== 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:dkim-signature; bh=R8xyMlTF2/FzYyTh03m+l1LnTI8sQSiRhFH5N5HuEpA=; b=L6WLGZ8HensGtemozYSgv75C7MWmPF27TYbE/0HCfpAT8hRaCLhDzV9lzCi9nWCUgK i6+p83uXQa1OzT4YMXLEKzr8/MjNQtKMZJOYdXljpCB0CC75He5Wr5uzSbqWDghOks1/ 5gZjruyvmyLJTLUZd6OBAo9EaizOetBxv1VBDfDaY0s/RxfiYRHDDjS7VFgxtbnlOez/ FWMm3tLsUbfOeByRZpxXHRF3P3oZGn7a6UC3kYqXAreeH8U1Mmz0Z65a0+gWcl+A91l6 YSpZSgJxPZF5mZBl/saX3mmSLu/xPexzXI609KYsJbSFgOpMO0u9KYZJHiM7quJ5jm61 TnoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ijkBTfVv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020aa7df91000000b004ac8358be51si30819745edy.464.2023.03.29.10.06.39; Wed, 29 Mar 2023 10:07:04 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ijkBTfVv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbjC2Q6D (ORCPT + 99 others); Wed, 29 Mar 2023 12:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjC2Q6C (ORCPT ); Wed, 29 Mar 2023 12:58:02 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9F3012E; Wed, 29 Mar 2023 09:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=R8xyMlTF2/FzYyTh03m+l1LnTI8sQSiRhFH5N5HuEpA=; b=ijkBTfVvZXrv6nBzfJPXW8aNUp qaivtLM5iW3QischbZkM2AG74yZB/cOKYygm6wv43rNgRkbbUjZQiXr5VoDVkX3cG/OjNq2XqEwaf a/8u2HlEoMobRswu8VKdSnVQFTMbn20ZojCrcQMh9aQZmfbd2fZJYuEDuDpDJ31Tua+c=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1phZ7S-008mlq-78; Wed, 29 Mar 2023 18:57:54 +0200 Date: Wed, 29 Mar 2023 18:57:54 +0200 From: Andrew Lunn To: Daniel Golle 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: <8fe9c1b6-a533-4ad9-8a23-4f16547476ed@lunn.ch> References: <371f0586e257d098993847e71d0c916a03c04191.1680105013.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <371f0586e257d098993847e71d0c916a03c04191.1680105013.git.daniel@makrotopia.org> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 > @@ -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. Andrew