Skip to content

Commit 07fe64b

Browse files
mripardlinusw
authored andcommitted
pinctrl: sunxi: Handle bias disable
So far, putting NO_PULL in allwinner,pull was ignored, behaving like if that property was not there at all. Obviously, this is not the right thing to do, and in that case, we really need to just disable the bias. Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 42676fa commit 07fe64b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/pinctrl/sunxi/pinctrl-sunxi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ static int sunxi_pctrl_parse_bias_prop(struct device_node *node)
165165
return -EINVAL;
166166

167167
switch (val) {
168+
case SUN4I_PINCTRL_NO_PULL:
169+
return PIN_CONFIG_BIAS_DISABLE;
168170
case SUN4I_PINCTRL_PULL_UP:
169171
return PIN_CONFIG_BIAS_PULL_UP;
170172
case SUN4I_PINCTRL_PULL_DOWN:
@@ -401,6 +403,12 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
401403
| dlevel << sunxi_dlevel_offset(pin),
402404
pctl->membase + sunxi_dlevel_reg(pin));
403405
break;
406+
case PIN_CONFIG_BIAS_DISABLE:
407+
val = readl(pctl->membase + sunxi_pull_reg(pin));
408+
mask = PULL_PINS_MASK << sunxi_pull_offset(pin);
409+
writel((val & ~mask),
410+
pctl->membase + sunxi_pull_reg(pin));
411+
break;
404412
case PIN_CONFIG_BIAS_PULL_UP:
405413
val = readl(pctl->membase + sunxi_pull_reg(pin));
406414
mask = PULL_PINS_MASK << sunxi_pull_offset(pin);

0 commit comments

Comments
 (0)