Re: [PATCH v2] gpiolib: Show correct direction from the beginning

From: Timur Tabi
Date: Tue Oct 02 2018 - 08:26:52 EST


On 10/2/18 2:38 AM, Linus Walleij wrote:
But as today the only driver that seems to be using valid_mask is msm,
so perhaps a hack is something better and then when we have a second
driver that requires it we figure out the real requirements. But it is
definately your decision;)

Please note that MSM is supposed to be the *first* driver, not the only, driver that needs valid_mask. So let's not make any code changes that limit this feature to the MSM driver.

I would just add some exported function to gpiolib to do what you
need so you can set up the valid_mask before calling
gpiochip_add*.

I think that should be okay. Drivers should know pretty early whether they need valid_mask or not.