pinctrl: at91: Fix a bug in at91_pinctrl_set_state()
Pin number, as specified in OF pinumx entries, is relative to each bank start, whereas both at91_mux_pin() and at91_pinctrl_set_conf() asssume absolute pin numbering, so we need to take into account each bank's pin base and convert pin number appropriately. Failing to do so results in any pinmux configuration being applied to pins in bank A. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
7d9679a33a
commit
15426d5c46
|
@ -462,6 +462,8 @@ static int at91_pinctrl_set_state(struct pinctrl_device *pdev, struct device_nod
|
|||
mux = be32_to_cpu(*list++);
|
||||
conf = be32_to_cpu(*list++);
|
||||
|
||||
pin_num += bank_num * MAX_NB_GPIO_PER_BANK;
|
||||
|
||||
ret = at91_mux_pin(pin_num, mux, conf & PULL_UP);
|
||||
if (ret) {
|
||||
dev_err(pdev->dev, "failed to mux pin %d\n", pin_num);
|
||||
|
|
Loading…
Reference in New Issue