[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PH7PR12MB7282BBF9E42265E18CB72E09D7D62@PH7PR12MB7282.namprd12.prod.outlook.com>
Date: Wed, 26 Jun 2024 14:59:55 +0000
From: Asmaa Mnebhi <asmaa@...dia.com>
To: Shiji Yang <yangshiji66@...look.com>, "linux-gpio@...r.kernel.org"
<linux-gpio@...r.kernel.org>
CC: Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski
<brgl@...ev.pl>, Andy Shevchenko <andy.shevchenko@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Mark Mentovai
<mark@...tovai.com>, Jonas Gorski <jonas.gorski@...il.com>,
Lóránd Horváth <lorand.horvath82@...il.com>
Subject: RE: [PATCH] gpio: mmio: do not calculate bgpio_bits via "ngpios"
I am not sure this change is needed?
When I initially submitted " gpio: mmio: handle "ngpios" properly in bgpio_init() ", It was specifically because I have a 32bit reg access but only 16 gpios. Initially, I did not add the else and so Andy suggested to add it with the roundup_pow_of_two to stay backward compatible. If your system is a 32 bit arch and you only use 16 Gpio bits, why don't you configure that in your DTS?
Thanks.
Asmaa
> drivers/gpio/gpio-mmio.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c index
> 71e1af7c2184..d89e78f0ead3 100644
> --- a/drivers/gpio/gpio-mmio.c
> +++ b/drivers/gpio/gpio-mmio.c
> @@ -619,8 +619,6 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev,
> ret = gpiochip_get_ngpios(gc, dev);
> if (ret)
> gc->ngpio = gc->bgpio_bits;
> - else
> - gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio,
> 8));
>
> ret = bgpio_setup_io(gc, dat, set, clr, flags);
> if (ret)
> --
> 2.45.1
Powered by blists - more mailing lists