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 diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
16 index 5f0eb04..69dec9b 100644
17 --- a/drivers/pinctrl/pinctrl-xway.c
18 +++ b/drivers/pinctrl/pinctrl-xway.c
19 @@ -441,17 +441,17 @@ static int xway_pinconf_get(struct pinctrl_dev *pctldev,
23 - reg = GPIO_OD(port);
25 *config = LTQ_PINCONF_PACK(param,
26 - !!gpio_getbit(info->membase[0], reg, PORT_PIN(port)));
27 + !!gpio_getbit(info->membase[0], reg, PORT_PIN(pin)));
30 case LTQ_PINCONF_PARAM_PULL:
34 - reg = GPIO_PUDEN(port);
35 - if (!gpio_getbit(info->membase[0], reg, PORT_PIN(port))) {
36 + reg = GPIO_PUDEN(pin);
37 + if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) {
38 *config = LTQ_PINCONF_PACK(param, 0);
41 @@ -459,8 +459,8 @@ static int xway_pinconf_get(struct pinctrl_dev *pctldev,
45 - reg = GPIO_PUDSEL(port);
46 - if (!gpio_getbit(info->membase[0], reg, PORT_PIN(port)))
47 + reg = GPIO_PUDSEL(pin);
48 + if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin)))
49 *config = LTQ_PINCONF_PACK(param, 2);
51 *config = LTQ_PINCONF_PACK(param, 1);
52 @@ -488,29 +488,29 @@ static int xway_pinconf_set(struct pinctrl_dev *pctldev,
56 - reg = GPIO_OD(port);
57 - gpio_setbit(info->membase[0], reg, PORT_PIN(port));
59 + gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
62 case LTQ_PINCONF_PARAM_PULL:
66 - reg = GPIO_PUDEN(port);
67 + reg = GPIO_PUDEN(pin);
69 - gpio_clearbit(info->membase[0], reg, PORT_PIN(port));
70 + gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
73 - gpio_setbit(info->membase[0], reg, PORT_PIN(port));
74 + gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
79 - reg = GPIO_PUDSEL(port);
80 + reg = GPIO_PUDSEL(pin);
82 - gpio_clearbit(info->membase[0], reg, PORT_PIN(port));
83 + gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
85 - gpio_setbit(info->membase[0], reg, PORT_PIN(port));
86 + gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
88 dev_err(pctldev->dev, "Invalid pull value %d\n", arg);