Message ID | 20190103164102.31437-1-thomas.petazzoni@bootlin.com |
---|---|
Headers | show |
Series | Proposal to support pull-up/pull-down GPIO configuration | expand |
On Thu, Jan 3, 2019 at 5:41 PM Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > This commit simply renames gpio_set_drive_single_ended() to > gpio_set_config(), as the function is not specific to setting the GPIO > drive type, and will be used for other purposes in followup commits. > > In addition, it moves the function above gpiod_direction_input(), as > it will be used from gpiod_direction_input(). > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> This is fine, but if you're factoring this config setting out then also change the lines in gpiod_set_debounce() and gpiod_set_transitory() to call the same helper. Yours, Linus Walleij
On Thu, Jan 3, 2019 at 5:41 PM Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > This commit adds a minimal implementation of the ->set_config() hook, > with support for the PIN_CONFIG_BIAS_PULL_UP and > PIN_CONFIG_BIAS_PULL_DOWN configurations. > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> This looks OK to me, but IIUC not all versions of the PCA953x supports this? So we need to make sure that you return -ENOTSUPP if the device does not support setting pull up/down. Also there are configs for debounce too, right? I suggested to add that first but I have no strong opinion on it. Yours, Linus Walleij
Hello Linus, On Fri, 11 Jan 2019 11:14:49 +0100 Linus Walleij <linus.walleij@linaro.org> wrote: > > This commit adds a minimal implementation of the ->set_config() hook, > > with support for the PIN_CONFIG_BIAS_PULL_UP and > > PIN_CONFIG_BIAS_PULL_DOWN configurations. > > > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> > > This looks OK to me, but IIUC not all versions of the PCA953x supports > this? > > So we need to make sure that you return -ENOTSUPP if the device > does not support setting pull up/down. Indeed, I've added a check for this. > Also there are configs for debounce too, right? I suggested to add > that first but I have no strong opinion on it. The particular PCA variant that I have does not have any debounce related capability it seems, so I won't be able to implement this aspect. Best regards, Thomas