Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: add pinconf-generic define for a pin-default pull

There exist controllers that don't support to set the pull to up or down
separately but instead automatically set the pull direction based on
embedded knowledge inside the controller, for example depending on the
selected mux function of the pin.

Therefore this patch adds another config option to use this default
pull-state for a pin where it is not possible to know or decide if the
pin will be pulled up or down.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Heiko Stübner and committed by
Linus Walleij
7970cb77 78bafc66

+7
+2
drivers/pinctrl/pinconf-generic.c
··· 40 40 PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL), 41 41 PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL), 42 42 PCONFDUMP(PIN_CONFIG_BIAS_PULL_DOWN, "input bias pull down", NULL), 43 + PCONFDUMP(PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 44 + "input bias pull to pin specific state", NULL), 43 45 PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL), 44 46 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL), 45 47 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL),
+5
include/linux/pinctrl/pinconf-generic.h
··· 40 40 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high 41 41 * impedance to GROUND). If the argument is != 0 pull-down is enabled, 42 42 * if it is 0, pull-down is disabled. 43 + * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based 44 + * on embedded knowledge of the controller, like current mux function. 45 + * If the argument is != 0 pull up/down is enabled, if it is 0, 46 + * the pull is disabled. 43 47 * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and 44 48 * low, this is the most typical case and is typically achieved with two 45 49 * active transistors on the output. Setting this config will enable ··· 90 86 PIN_CONFIG_BIAS_BUS_HOLD, 91 87 PIN_CONFIG_BIAS_PULL_UP, 92 88 PIN_CONFIG_BIAS_PULL_DOWN, 89 + PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 93 90 PIN_CONFIG_DRIVE_PUSH_PULL, 94 91 PIN_CONFIG_DRIVE_OPEN_DRAIN, 95 92 PIN_CONFIG_DRIVE_OPEN_SOURCE,