diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-09-05 05:01:57 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-09-10 03:14:03 -0400 |
commit | 00ba7a502d9a8ba49c54a88f5903bf7bfc33e449 (patch) | |
tree | 23ee938fbb068e4f5e95558bec142e4c3a616b9b /drivers/pinctrl | |
parent | 4921e7452c2c61e0caa1a5039456cbeed3f10324 (diff) |
pinctrl: pinctrl-single: Make sure we do not change bits outside of mask
Use the pcs->fmask to make sure that the value is not changing (setting)
bits in areas where it should not.
To avoid situations like this:
pmx_dummy: pinmux@4a100040 {
compatible = "pinctrl-single";
reg = <0x4a100040 0x0196>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-single,register-width = <16>;
pinctrl-single,function-mask = <0x00ff>;
};
&pmx_dummy {
pinctrl-names = "default";
pinctrl-0 = <&board_pins>;
board_pins: pinmux_board_pins {
pinctrl-single,pins = <
0x6c 0xf0f
0x6e 0x10f
0x70 0x23f
0x72 0xa5f
>;
};
};
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-single.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 76a4260f20f3..35086310b81d 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c | |||
@@ -337,7 +337,7 @@ static int pcs_enable(struct pinctrl_dev *pctldev, unsigned fselector, | |||
337 | vals = &func->vals[i]; | 337 | vals = &func->vals[i]; |
338 | val = pcs->read(vals->reg); | 338 | val = pcs->read(vals->reg); |
339 | val &= ~pcs->fmask; | 339 | val &= ~pcs->fmask; |
340 | val |= vals->val; | 340 | val |= (vals->val & pcs->fmask); |
341 | pcs->write(val, vals->reg); | 341 | pcs->write(val, vals->reg); |
342 | } | 342 | } |
343 | 343 | ||