Skip to content

Commit 7970cb7

Browse files
mmindLinus Walleij
authored andcommitted
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>
1 parent 78bafc6 commit 7970cb7

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎drivers/pinctrl/pinconf-generic.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ static struct pin_config_item conf_items[] = {
4040
PCONFDUMP(PIN_CONFIG_BIAS_BUS_HOLD, "input bias bus hold", NULL),
4141
PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL),
4242
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),
4345
PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL),
4446
PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL),
4547
PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL),

‎include/linux/pinctrl/pinconf-generic.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
* @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
4141
* impedance to GROUND). If the argument is != 0 pull-down is enabled,
4242
* 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.
4347
* @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
4448
* low, this is the most typical case and is typically achieved with two
4549
* active transistors on the output. Setting this config will enable
@@ -86,6 +90,7 @@ enum pin_config_param {
8690
PIN_CONFIG_BIAS_BUS_HOLD,
8791
PIN_CONFIG_BIAS_PULL_UP,
8892
PIN_CONFIG_BIAS_PULL_DOWN,
93+
PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
8994
PIN_CONFIG_DRIVE_PUSH_PULL,
9095
PIN_CONFIG_DRIVE_OPEN_DRAIN,
9196
PIN_CONFIG_DRIVE_OPEN_SOURCE,

0 commit comments

Comments
 (0)