pinctrl: k210: Fix bias-pull-up
authorNiklas Cassel <niklas.cassel@wdc.com>
Tue, 1 Mar 2022 10:35:45 +0000 (10:35 +0000)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Tue, 15 Mar 2022 09:43:11 +0000 (17:43 +0800)
Using bias-pull-up would actually cause the pin to have its pull-down
enabled. Fix this.

Original Linux patch by Sean Anderson:
https://lore.kernel.org/linux-gpio/20220209182822.640905-1-seanga2@gmail.com/

Fixes: 7224d5ccf8e1 ("pinctrl: Add support for Kendryte K210 FPIOA")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
drivers/pinctrl/pinctrl-k210.c

index f809149102fb600e49e8c552d241f04b95a2bc05..13f0a34268602418cd361384bead24d4456d72ac 100644 (file)
@@ -536,7 +536,7 @@ static int k210_pc_pinconf_set(struct udevice *dev, unsigned pin_selector,
                break;
        case PIN_CONFIG_BIAS_PULL_UP:
                if (argument)
-                       val |= K210_PC_PD;
+                       val |= K210_PC_PU;
                else
                        return -EINVAL;
                break;