From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Subject: Re: [PATCH v2] gpiolib: Show correct direction from the beginning Date: Tue, 2 Oct 2018 07:26:47 -0500 Message-ID: References: <20180921103604.13361-1-ricardo.ribalda@gmail.com> <20180921103604.13361-2-ricardo.ribalda@gmail.com> <153803107307.119890.10052910965015646333@swboyd.mtv.corp.google.com> <3e07cab8-0f3e-7474-8f6d-e6bb16e8f998@codeaurora.org> <5aea282d-6fc9-cd70-cec4-10f28aa819b9@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Linus Walleij , Ricardo Ribalda Delgado Cc: jhugo@codeaurora.org, Stephen Boyd , "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" List-Id: linux-gpio@vger.kernel.org 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.