1 From 5e19578b807e7ef6e7baf05fb1f69433d5e74667 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 30 Nov 2012 21:11:22 +0100
4 Subject: [PATCH 05/40] PINCTRL: lantiq: pinconf uses port instead of pin
6 The XWAY pinctrl driver invalidly uses the port and not the pin number to work
7 out the registeres and bits to be set for the opendrain and pullup/down
10 Signed-off-by: John Crispin <blogic@openwrt.org>
12 drivers/pinctrl/pinctrl-xway.c | 28 ++++++++++++++--------------
13 1 file changed, 14 insertions(+), 14 deletions(-)
15 --- a/drivers/pinctrl/pinctrl-xway.c
16 +++ b/drivers/pinctrl/pinctrl-xway.c
17 @@ -441,17 +441,17 @@ static int xway_pinconf_get(struct pinct
21 - reg = GPIO_OD(port);
23 *config = LTQ_PINCONF_PACK(param,
24 - !!gpio_getbit(info->membase[0], reg, PORT_PIN(port)));
25 + !!gpio_getbit(info->membase[0], reg, PORT_PIN(pin)));
28 case LTQ_PINCONF_PARAM_PULL:
32 - reg = GPIO_PUDEN(port);
33 - if (!gpio_getbit(info->membase[0], reg, PORT_PIN(port))) {
34 + reg = GPIO_PUDEN(pin);
35 + if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) {
36 *config = LTQ_PINCONF_PACK(param, 0);
39 @@ -459,8 +459,8 @@ static int xway_pinconf_get(struct pinct
43 - reg = GPIO_PUDSEL(port);
44 - if (!gpio_getbit(info->membase[0], reg, PORT_PIN(port)))
45 + reg = GPIO_PUDSEL(pin);
46 + if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin)))
47 *config = LTQ_PINCONF_PACK(param, 2);
49 *config = LTQ_PINCONF_PACK(param, 1);
50 @@ -488,29 +488,29 @@ static int xway_pinconf_set(struct pinct
54 - reg = GPIO_OD(port);
55 - gpio_setbit(info->membase[0], reg, PORT_PIN(port));
57 + gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
60 case LTQ_PINCONF_PARAM_PULL:
64 - reg = GPIO_PUDEN(port);
65 + reg = GPIO_PUDEN(pin);
67 - gpio_clearbit(info->membase[0], reg, PORT_PIN(port));
68 + gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
71 - gpio_setbit(info->membase[0], reg, PORT_PIN(port));
72 + gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
77 - reg = GPIO_PUDSEL(port);
78 + reg = GPIO_PUDSEL(pin);
80 - gpio_clearbit(info->membase[0], reg, PORT_PIN(port));
81 + gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
83 - gpio_setbit(info->membase[0], reg, PORT_PIN(port));
84 + gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
86 dev_err(pctldev->dev, "Invalid pull value %d\n", arg);