提交 b84e673f 编写于 作者: R Rajendra Nayak 提交者: Linus Walleij

pinctrl: iterate over u300_pmx_mask's in u300_pmx_endisable

Fix u300_pmx_endisable() to iterate over the list of 'bits' and
'mask' populated as part of u300_pmx_functions.mask[]
Signed-off-by: NRajendra Nayak <rnayak@ti.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 07f29ba6
...@@ -940,20 +940,23 @@ static void u300_pmx_endisable(struct u300_pmx *upmx, unsigned selector, ...@@ -940,20 +940,23 @@ static void u300_pmx_endisable(struct u300_pmx *upmx, unsigned selector,
{ {
u16 regval, val, mask; u16 regval, val, mask;
int i; int i;
const struct u300_pmx_mask *upmx_mask;
upmx_mask = u300_pmx_functions[selector].mask;
for (i = 0; i < ARRAY_SIZE(u300_pmx_registers); i++) { for (i = 0; i < ARRAY_SIZE(u300_pmx_registers); i++) {
if (enable) if (enable)
val = u300_pmx_functions[selector].mask->bits; val = upmx_mask->bits;
else else
val = 0; val = 0;
mask = u300_pmx_functions[selector].mask->mask; mask = upmx_mask->mask;
if (mask != 0) { if (mask != 0) {
regval = readw(upmx->virtbase + u300_pmx_registers[i]); regval = readw(upmx->virtbase + u300_pmx_registers[i]);
regval &= ~mask; regval &= ~mask;
regval |= val; regval |= val;
writew(regval, upmx->virtbase + u300_pmx_registers[i]); writew(regval, upmx->virtbase + u300_pmx_registers[i]);
} }
upmx_mask++;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册