diff options
author | Neil Armstrong <narmstrong@baylibre.com> | 2020-12-14 21:39:07 +0300 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2020-12-14 21:58:54 +0300 |
commit | 5ccd5d2cc98224108ae9fb09593a862c9caa5e80 (patch) | |
tree | 1feea3ba45e895dc3685b40e7c47e7032de53a86 /drivers/pinctrl/meson | |
parent | 5c88b6ad400c42cabd347ad58098b149ede34281 (diff) | |
download | u-boot-5ccd5d2cc98224108ae9fb09593a862c9caa5e80.tar.xz |
pinctrl: meson: fix bit manipulation of pin bias configuration
This fixes the wrong usage of clrsetbits_le32(), badly setting the set argument.
Fixes: c4c726c26b ("pinctrl: meson: add pinconf support")
Reported-by: Anton Arapov <arapov@gmail.com>
Reported-by: Otto Meier <gf435@gmx.net>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'drivers/pinctrl/meson')
-rw-r--r-- | drivers/pinctrl/meson/pinctrl-meson.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index d4539b02d8..5065b62436 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -216,13 +216,13 @@ static int meson_pinconf_bias_set(struct udevice *dev, unsigned int pin, } /* othewise, enable the bias and select level */ - clrsetbits_le32(priv->reg_pullen + reg, BIT(bit), 1); + clrsetbits_le32(priv->reg_pullen + reg, BIT(bit), BIT(bit)); ret = meson_gpio_calc_reg_and_bit(dev, offset, REG_PULL, ®, &bit); if (ret) return ret; clrsetbits_le32(priv->reg_pull + reg, BIT(bit), - param == PIN_CONFIG_BIAS_PULL_UP); + (param == PIN_CONFIG_BIAS_PULL_UP ? BIT(bit) : 0)); return 0; } |