Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96924C433FE for ; Wed, 17 Nov 2021 13:47:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 783CB61248 for ; Wed, 17 Nov 2021 13:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237876AbhKQNuO convert rfc822-to-8bit (ORCPT ); Wed, 17 Nov 2021 08:50:14 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:39405 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233591AbhKQNuM (ORCPT ); Wed, 17 Nov 2021 08:50:12 -0500 Received: (Authenticated sender: clement.leger@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id D910C20000B; Wed, 17 Nov 2021 13:47:05 +0000 (UTC) Date: Wed, 17 Nov 2021 14:47:05 +0100 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Alexandre Belloni Cc: Colin Foster , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Vladimir Oltean , Claudiu Manoil , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Ioana Ciornei , Heiner Kallweit , Russell King , Lars Povlsen , Steen Hegelund , Linus Walleij , Philipp Zabel , Heikki Krogerus , Andy Shevchenko Subject: Re: [RFC PATCH v4 net-next 11/23] pinctrl: ocelot: update pinctrl to automatic base address Message-ID: <20211117144705.24f21ef1@fixe.home> In-Reply-To: References: <20211116062328.1949151-1-colin.foster@in-advantage.com> <20211116062328.1949151-12-colin.foster@in-advantage.com> Organization: Bootlin X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Tue, 16 Nov 2021 18:36:33 +0100, Alexandre Belloni a écrit : > Hello, > > On 15/11/2021 22:23:16-0800, Colin Foster wrote: > > struct gpio_chip recommends passing -1 as base to gpiolib. Doing so avoids > > conflicts when the chip is external and gpiochip0 already exists. > > > > Signed-off-by: Colin Foster > > --- > > drivers/pinctrl/pinctrl-ocelot.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c > > index cc7fb0556169..f015404c425c 100644 > > --- a/drivers/pinctrl/pinctrl-ocelot.c > > +++ b/drivers/pinctrl/pinctrl-ocelot.c > > @@ -1308,7 +1308,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev, > > gc = &info->gpio_chip; > > gc->ngpio = info->desc->npins; > > gc->parent = &pdev->dev; > > - gc->base = 0; > > + gc->base = -1; > > I can't remember why but I'm pretty sure I did that on purpose but this > indeed cause issues when the chip is external. I've asked Clément to > check, let's see what the result is ;) After testing, it works on ocelot pcb123 board. Tested-by: Clément Léger > > > gc->of_node = info->dev->of_node; > > gc->label = "ocelot-gpio"; > > > > -- > > 2.25.1 > > > -- Clément Léger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com