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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 12DA0C433ED for ; Sat, 24 Apr 2021 15:51:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9DCA61364 for ; Sat, 24 Apr 2021 15:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234710AbhDXPwe (ORCPT ); Sat, 24 Apr 2021 11:52:34 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:39354 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232434AbhDXPwd (ORCPT ); Sat, 24 Apr 2021 11:52:33 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1laKZR-000pmO-DV; Sat, 24 Apr 2021 17:51:49 +0200 Date: Sat, 24 Apr 2021 17:51:49 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Florian Fainelli , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Michael Grzeschik , kernel@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Russell King Subject: Re: [PATCH net-next v6 04/10] net: dsa: microchip: ksz8795: add support for ksz88xx chips Message-ID: References: <20210423080218.26526-1-o.rempel@pengutronix.de> <20210423080218.26526-5-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423080218.26526-5-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23, 2021 at 10:02:12AM +0200, Oleksij Rempel wrote: > We add support for the ksz8863 and ksz8873 chips which are > using the same register patterns but other offsets as the > ksz8795. > > Signed-off-by: Michael Grzeschik > Signed-off-by: Oleksij Rempel > > --- > v1 -> v4: - extracted this change from bigger previous patch > v4 -> v5: - added clear of reset bit for ksz8863 reset code > - using extra device flag IS_KSZ88x3 instead of is_ksz8795 function > - using DSA_TAG_PROTO_KSZ9893 protocol for ksz88x3 instead > v5 -> v6: - changed variable order to revers christmas tree > - added back missed dropped handling in init_cnt for ksz8863 > - disable VLAN support for ksz8863. Currently it need more > work. > --- > drivers/net/dsa/microchip/ksz8795.c | 321 ++++++++++++++++++++---- > drivers/net/dsa/microchip/ksz8795_reg.h | 40 ++- > drivers/net/dsa/microchip/ksz_common.h | 1 + > 3 files changed, 286 insertions(+), 76 deletions(-) > > diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c > index 8835217e2804..78181d29db12 100644 > --- a/drivers/net/dsa/microchip/ksz8795.c > +++ b/drivers/net/dsa/microchip/ksz8795.c > @@ -22,6 +22,9 @@ > #include "ksz8795_reg.h" > #include "ksz8.h" > > +/* Used with variable features to indicate capabilities. */ > +#define IS_88X3 BIT(0) How well is this going to scale? With only two devices, this is O.K. But when you add a third, you are probably going to want to use a switch statement, and that is not so easy with bits. I think an enum makes this more future proof. Andrew