提交 1d50ecd0 编写于 作者: L Linus Walleij 提交者: Xie XiuQi

pinctrl: gemini: Mask and set properly

[ Upstream commit d17f477c5bc6b4a5dd9f51ae263870da132a8e89 ]

The code was written under the assumption that the
regmap_update_bits() would mask the bits in the mask and
set the bits in the value.

It missed the points that it will not set bits in the value
unless these are also masked in the mask. Set value bits
that are not in the mask will simply be ignored.

Fixes: 06351d13 ("pinctrl: add a Gemini SoC pin controller")
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8a807173
...@@ -2184,7 +2184,8 @@ static int gemini_pmx_set_mux(struct pinctrl_dev *pctldev, ...@@ -2184,7 +2184,8 @@ static int gemini_pmx_set_mux(struct pinctrl_dev *pctldev,
func->name, grp->name); func->name, grp->name);
regmap_read(pmx->map, GLOBAL_MISC_CTRL, &before); regmap_read(pmx->map, GLOBAL_MISC_CTRL, &before);
regmap_update_bits(pmx->map, GLOBAL_MISC_CTRL, grp->mask, regmap_update_bits(pmx->map, GLOBAL_MISC_CTRL,
grp->mask | grp->value,
grp->value); grp->value);
regmap_read(pmx->map, GLOBAL_MISC_CTRL, &after); regmap_read(pmx->map, GLOBAL_MISC_CTRL, &after);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册