[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CH2PR12MB38953114436B7B0768A1C321D715A@CH2PR12MB3895.namprd12.prod.outlook.com>
Date: Wed, 16 Aug 2023 21:28:26 +0000
From: Asmaa Mnebhi <asmaa@...dia.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
"brgl@...ev.pl" <brgl@...ev.pl>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2 2/2] gpio: mlxbf3: Support add_pin_ranges()
> > v1->v2:
> > - No changes.
>
> Is this correct?
Ah my apologies, I added the wrong comment here. I put it in "v2 1/2".
> > +static int mlxbf3_gpio_add_pin_ranges(struct gpio_chip *chip) {
> > + unsigned int id = 0;
> > + int ret;
> > +
> > + if (chip->ngpio % MLXBF3_GPIO_MAX_PINS_PER_BLOCK)
> > + id = 1;
>
> This id calculation seems wrong to me as I said in v1 review.
> Why do you think the above is what you want and not just working by luck?
I would like to get the gpio block id which can only be 0 or 1 on BlueField-3 (only 2 gpio blocks, one with 32 gpio pins and one with 24 gpio pins).
The above logic was an "easy" way for me to get the gpio block id. Then the pin_base for each gpio block is:
pin_base = id * MLXBF3_GPIO_MAX_PINS_PER_BLOCK
Powered by blists - more mailing lists