Re: [PATCH] gpio: Document the 'valid_mask' being internal

From: Matti Vaittinen
Date: Fri Feb 28 2025 - 06:02:24 EST


Hi dee Ho peeps (Biju, Geert, Linus and all)

On 28/02/2025 12:28, Biju Das wrote:
Hi Geert,

-----Original Message-----
From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
On Fri, 28 Feb 2025 at 09:07, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
On Wed, Feb 26, 2025 at 12:42 PM Matti Vaittinen
<mazziesaccount@xxxxxxxxx> wrote:
On 26/02/2025 12:18, Linus Walleij wrote:


I agree, when the code is mainlined at that time set_multiple() has some draw backs and hence
the check is added to take care of GPIO holes.

If I don't read it wrong, rcar GPIO supports some input enabling "en masse" during the probe. It seems to me the gpio_rcar_enable_inputs() does also need the valid GPIOs information - I suppose some of the GPIOs may have been masked in the device-tree, and those shouldn't be enabled.

It feels counter productive to hide the valid_mask - and do some device-tree parsing in the driver(s) which may need it.

I suppose we can still hide the valid_mask in struct gpio_device as suggested - but then we should probably create a getter for it in the gpiolib.

Or does someone see a way around needing the valid_mask in the gpio_rcar_enable_inputs() ?

Have a nice weekend!

Yours,
-- Matti