public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] PINCTRL: lantiq: pinconf uses port instead of pin
@ 2013-02-01 12:04 John Crispin
  2013-02-01 12:04 ` [PATCH 02/11] PINCTRL: lantiq: faulty bit inversion John Crispin
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: John Crispin @ 2013-02-01 12:04 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-kernel, John Crispin

The XWAY pinctrl driver invalidly uses the port and not the pin number to work
out the registeres and bits to be set for the opendrain and pullup/down
resistors.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/pinctrl/pinctrl-xway.c |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index 5f0eb04..69dec9b 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -441,17 +441,17 @@ static int xway_pinconf_get(struct pinctrl_dev *pctldev,
 		if (port == PORT3)
 			reg = GPIO3_OD;
 		else
-			reg = GPIO_OD(port);
+			reg = GPIO_OD(pin);
 		*config = LTQ_PINCONF_PACK(param,
-			!!gpio_getbit(info->membase[0], reg, PORT_PIN(port)));
+			!!gpio_getbit(info->membase[0], reg, PORT_PIN(pin)));
 		break;
 
 	case LTQ_PINCONF_PARAM_PULL:
 		if (port == PORT3)
 			reg = GPIO3_PUDEN;
 		else
-			reg = GPIO_PUDEN(port);
-		if (!gpio_getbit(info->membase[0], reg, PORT_PIN(port))) {
+			reg = GPIO_PUDEN(pin);
+		if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin))) {
 			*config = LTQ_PINCONF_PACK(param, 0);
 			break;
 		}
@@ -459,8 +459,8 @@ static int xway_pinconf_get(struct pinctrl_dev *pctldev,
 		if (port == PORT3)
 			reg = GPIO3_PUDSEL;
 		else
-			reg = GPIO_PUDSEL(port);
-		if (!gpio_getbit(info->membase[0], reg, PORT_PIN(port)))
+			reg = GPIO_PUDSEL(pin);
+		if (!gpio_getbit(info->membase[0], reg, PORT_PIN(pin)))
 			*config = LTQ_PINCONF_PACK(param, 2);
 		else
 			*config = LTQ_PINCONF_PACK(param, 1);
@@ -488,29 +488,29 @@ static int xway_pinconf_set(struct pinctrl_dev *pctldev,
 		if (port == PORT3)
 			reg = GPIO3_OD;
 		else
-			reg = GPIO_OD(port);
-		gpio_setbit(info->membase[0], reg, PORT_PIN(port));
+			reg = GPIO_OD(pin);
+		gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
 		break;
 
 	case LTQ_PINCONF_PARAM_PULL:
 		if (port == PORT3)
 			reg = GPIO3_PUDEN;
 		else
-			reg = GPIO_PUDEN(port);
+			reg = GPIO_PUDEN(pin);
 		if (arg == 0) {
-			gpio_clearbit(info->membase[0], reg, PORT_PIN(port));
+			gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
 			break;
 		}
-		gpio_setbit(info->membase[0], reg, PORT_PIN(port));
+		gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
 
 		if (port == PORT3)
 			reg = GPIO3_PUDSEL;
 		else
-			reg = GPIO_PUDSEL(port);
+			reg = GPIO_PUDSEL(pin);
 		if (arg == 1)
-			gpio_clearbit(info->membase[0], reg, PORT_PIN(port));
+			gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
 		else if (arg == 2)
-			gpio_setbit(info->membase[0], reg, PORT_PIN(port));
+			gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
 		else
 			dev_err(pctldev->dev, "Invalid pull value %d\n", arg);
 		break;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2013-02-05 15:14 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01 12:04 [PATCH 01/11] PINCTRL: lantiq: pinconf uses port instead of pin John Crispin
2013-02-01 12:04 ` [PATCH 02/11] PINCTRL: lantiq: faulty bit inversion John Crispin
2013-02-05 14:39   ` Linus Walleij
2013-02-01 12:04 ` [PATCH 03/11] PINCTRL: lantiq: add pin_config_group_set support John Crispin
2013-02-05 14:42   ` Linus Walleij
2013-02-01 12:04 ` [PATCH 04/11] PINCTRL: lantiq: add output pinconf parameter John Crispin
2013-02-05 14:46   ` Linus Walleij
2013-02-05 14:46     ` John Crispin
2013-02-01 12:04 ` [PATCH 05/11] PINCTRL: lantiq: the pinconf OD parameter argument was ignored John Crispin
2013-02-05 14:50   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 06/11] PINCTRL: lantiq: only probe available pad controllers John Crispin
2013-02-05 14:58   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 07/11] PINCTRL: lantiq: one of the boot leds was defined incorrectly John Crispin
2013-02-05 14:53   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 08/11] PINCTRL: lantiq: fix pinconfig parameters John Crispin
2013-02-05 14:57   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 09/11] PINCTRL: lantiq: add functionality to falcon_pinconf_dbg_show John Crispin
2013-02-05 14:55   ` Linus Walleij
2013-02-01 12:05 ` [PATCH 10/11] PINCTRL: lantiq: fix pin availability check John Crispin
2013-02-01 12:05 ` [PATCH 11/11] PINCTRL: lantiq: fix pin number in ltq_pmx_gpio_request_enable John Crispin
2013-02-05 15:13   ` Linus Walleij
2013-02-05 14:39 ` [PATCH 01/11] PINCTRL: lantiq: pinconf uses port instead of pin Linus Walleij
2013-02-05 14:59   ` Linus Walleij
2013-02-05 15:00     ` John Crispin
2013-02-05 15:14       ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox