Commit 07fe64ba authored by Maxime Ripard's avatar Maxime Ripard Committed by Linus Walleij

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: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 42676fa4
...@@ -165,6 +165,8 @@ static int sunxi_pctrl_parse_bias_prop(struct device_node *node) ...@@ -165,6 +165,8 @@ static int sunxi_pctrl_parse_bias_prop(struct device_node *node)
return -EINVAL; return -EINVAL;
switch (val) { switch (val) {
case SUN4I_PINCTRL_NO_PULL:
return PIN_CONFIG_BIAS_DISABLE;
case SUN4I_PINCTRL_PULL_UP: case SUN4I_PINCTRL_PULL_UP:
return PIN_CONFIG_BIAS_PULL_UP; return PIN_CONFIG_BIAS_PULL_UP;
case SUN4I_PINCTRL_PULL_DOWN: case SUN4I_PINCTRL_PULL_DOWN:
...@@ -401,6 +403,12 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev, ...@@ -401,6 +403,12 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
| dlevel << sunxi_dlevel_offset(pin), | dlevel << sunxi_dlevel_offset(pin),
pctl->membase + sunxi_dlevel_reg(pin)); pctl->membase + sunxi_dlevel_reg(pin));
break; break;
case PIN_CONFIG_BIAS_DISABLE:
val = readl(pctl->membase + sunxi_pull_reg(pin));
mask = PULL_PINS_MASK << sunxi_pull_offset(pin);
writel((val & ~mask),
pctl->membase + sunxi_pull_reg(pin));
break;
case PIN_CONFIG_BIAS_PULL_UP: case PIN_CONFIG_BIAS_PULL_UP:
val = readl(pctl->membase + sunxi_pull_reg(pin)); val = readl(pctl->membase + sunxi_pull_reg(pin));
mask = PULL_PINS_MASK << sunxi_pull_offset(pin); mask = PULL_PINS_MASK << sunxi_pull_offset(pin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment