linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] reform the ABx500 IRQ handling
@ 2013-02-05 19:48 Linus Walleij
  2013-02-05 19:48 ` [PATCH 01/14] mfd: ab8500: prepare to handle AB8500 GPIO's IRQs correctly Linus Walleij
                   ` (13 more replies)
  0 siblings, 14 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Stephen Warren, Anmar Oueja, Linus Walleij

From: Linus Walleij <linus.walleij@linaro.org>

The AB8500/ABx500 PMIC ASICs have a real interesting way
of handling GPIO interrupts. They can trigger both on rising
and falling edge but will fire two different physical hwirqs
for rising resp. falling edge.

The complexity was kept in the abx500 pinctrl driver by
heritage from the ab8500 GPIO driver. That one was however
severely broken and this was part of the brokenness.

This series tries to decrease the complexity by moving
the interrupt handling back into the AB8500 core and
letting the ABx500 pinctrl driver rely on the irqdomain
stored inside the mfd device.

The basic design problem with the old driver was that it
was modeling a *cascading* interrupt controller off the
AB8500 core, whereas what we want is actually a *merging*
interrupt controller, that will take two physical hwirqs
and associate them with *one* Linux IRQ.

The right place to handle this is in the AB8500 core.

Lee Jones (13):
  mfd: ab8500: prepare to handle AB8500 GPIO's IRQs correctly
  mfd: ab8500: provide a irq_set_type() function
  mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly
  mfd: ab8500: allow AB9540 based devices to use ABX500 pinctrl
  pinctrl/abx500: prevent error path from corrupting returning error
  pinctrl/abx500: align GPIO cluster boundaries
  pinctrl/abx500: move IRQ handling to ab8500-core
  pinctrl/abx500: replace IRQ offsets with table read-in values
  pinctrl/abx500: add Device Tree support
  ARM: ux500: remove irq_base property from platform_data
  ARM: ux500: use real AB8500 IRQ numbers instead of virtual ones
  ARM: ux500: enable AB8500 GPIO for HREF
  ARM: ux500: allow Snowball access to the AB8500 GPIO pins

Linus Walleij (1):
  pinctrl/abx500: use direct IRQ defines

 arch/arm/boot/dts/hrefprev60.dts                   |   8 +
 arch/arm/boot/dts/snowball.dts                     |   4 +
 arch/arm/mach-ux500/board-mop500.c                 |   1 -
 .../mach-ux500/include/mach/irqs-board-mop500.h    |  10 +-
 drivers/mfd/ab8500-core.c                          |  37 ++-
 drivers/pinctrl/pinctrl-ab8500.c                   |   6 +-
 drivers/pinctrl/pinctrl-ab8505.c                   |  10 +-
 drivers/pinctrl/pinctrl-ab8540.c                   |   5 +-
 drivers/pinctrl/pinctrl-ab9540.c                   |   8 +-
 drivers/pinctrl/pinctrl-abx500.c                   | 365 +++------------------
 drivers/pinctrl/pinctrl-abx500.h                   |  10 +-
 include/linux/mfd/abx500/ab8500-gpio.h             |   1 -
 12 files changed, 120 insertions(+), 345 deletions(-)

-- 
1.7.11.3


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

* [PATCH 01/14] mfd: ab8500: prepare to handle AB8500 GPIO's IRQs correctly
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function Linus Walleij
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Samuel Ortiz, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

In an upcoming patch, the gpio-ab8500 driver will relinquish all
IRQ handling capability and pass it back into the AB8500 core
driver. This will aid in reducing massive code duplication within
the kernel. Also, most of the functionality is already in the
AB8500 core driver, as the GPIO IRQs are actually sandwiched
between lots of other IRQs which the core driver already handles.

All we're doing here is providing the core driver with knowledge
that each GPIO has two IRQs assigned to it; one for rising and
a separate one for falling.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Sam, it'd be nice if you could ACK these first four patches,
the series basically simplifies things a lot by not cascading
the AB8500 IRQs and duplicate code in the pinctrl driver.
---
 drivers/mfd/ab8500-core.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index e1650ba..e1ba0be 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -367,16 +367,40 @@ static void ab8500_irq_mask(struct irq_data *data)
 	int mask = 1 << (offset % 8);
 
 	ab8500->mask[index] |= mask;
+
+	/* The AB8500 GPIOs have two interrupts each (rising & falling). */
+	if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R)
+		ab8500->mask[index + 2] |= mask;
+	if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
+		ab8500->mask[index + 1] |= mask;
+	if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
+		ab8500->mask[index] |= (mask >> 1);
 }
 
 static void ab8500_irq_unmask(struct irq_data *data)
 {
 	struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data);
+	unsigned int type = irqd_get_trigger_type(data);
 	int offset = data->hwirq;
 	int index = offset / 8;
 	int mask = 1 << (offset % 8);
 
-	ab8500->mask[index] &= ~mask;
+	if (type & IRQ_TYPE_EDGE_RISING)
+		ab8500->mask[index] &= ~mask;
+
+	/* The AB8500 GPIOs have two interrupts each (rising & falling). */
+	if (type & IRQ_TYPE_EDGE_FALLING) {
+		if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R)
+			ab8500->mask[index + 2] &= ~mask;
+		else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
+			ab8500->mask[index + 1] &= ~mask;
+		else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
+			ab8500->mask[index] &= ~(mask >> 1);
+		else
+			ab8500->mask[index] &= ~mask;
+	} else
+		/* Satisfies the case where type is not set. */
+		ab8500->mask[index] &= ~mask;
 }
 
 static struct irq_chip ab8500_irq_chip = {
-- 
1.7.11.3


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

* [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
  2013-02-05 19:48 ` [PATCH 01/14] mfd: ab8500: prepare to handle AB8500 GPIO's IRQs correctly Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-07  0:07   ` Stephen Warren
  2013-02-05 19:48 ` [PATCH 03/14] mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly Linus Walleij
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Samuel Ortiz, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

In the AB8500 IRQ mask and unmask functions, we rely on testing for
IRQ_TYPE_EDGE_RISING and IRQ_TYPE_EDGE_FALLING interrupts to
physically mask and unmask the correct interrupt lines. In order
for us to do that, the trigger needs to be set in the associated
flags. However, unless a irq_set_type() function pointer is passed
when registering the IRQ chip, the IRQ subsystem will refuse to do
it. For that reason, we're providing one.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Sam, it'd be nice if you could ACK these first four patches,
the series basically simplifies things a lot by not cascading
the AB8500 IRQs and duplicate code in the pinctrl driver.
---
 drivers/mfd/ab8500-core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index e1ba0be..aa5937e 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -403,6 +403,11 @@ static void ab8500_irq_unmask(struct irq_data *data)
 		ab8500->mask[index] &= ~mask;
 }
 
+static int ab8500_irq_set_type(struct irq_data *data, unsigned int type)
+{
+	return 0;
+}
+
 static struct irq_chip ab8500_irq_chip = {
 	.name			= "ab8500",
 	.irq_bus_lock		= ab8500_irq_lock,
@@ -410,6 +415,7 @@ static struct irq_chip ab8500_irq_chip = {
 	.irq_mask		= ab8500_irq_mask,
 	.irq_disable		= ab8500_irq_mask,
 	.irq_unmask		= ab8500_irq_unmask,
+	.irq_set_type		= ab8500_irq_set_type,
 };
 
 static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500,
-- 
1.7.11.3


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

* [PATCH 03/14] mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
  2013-02-05 19:48 ` [PATCH 01/14] mfd: ab8500: prepare to handle AB8500 GPIO's IRQs correctly Linus Walleij
  2013-02-05 19:48 ` [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-07  0:08   ` Stephen Warren
  2013-02-05 19:48 ` [PATCH 04/14] mfd: ab8500: allow AB9540 based devices to use ABX500 pinctrl Linus Walleij
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Samuel Ortiz, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

The old, BROKEN AB8500 GPIO driver has been revamped as a shiny
new pinctrl driver and has been renamed as such. So, if we would
like to make use of it, we need to register it via its new name.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Sam, it'd be nice if you could ACK these first four patches,
the series basically simplifies things a lot by not cascading
the AB8500 IRQs and duplicate code in the pinctrl driver.
---
 drivers/mfd/ab8500-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index aa5937e..bad3fe2 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1080,7 +1080,7 @@ static struct mfd_cell ab8500_bm_devs[] = {
 
 static struct mfd_cell ab8500_devs[] = {
 	{
-		.name = "ab8500-gpio",
+		.name = "pinctrl-ab8500",
 		.of_compatible = "stericsson,ab8500-gpio",
 	},
 	{
-- 
1.7.11.3


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

* [PATCH 04/14] mfd: ab8500: allow AB9540 based devices to use ABX500 pinctrl
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (2 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 03/14] mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 05/14] pinctrl/abx500: prevent error path from corrupting returning error Linus Walleij
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Samuel Ortiz, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

The old AB8500 GPIO driver has been un-BROKEN and converted into a
multi-platform pinctrl driver. If any AB9540 based devices wish to
request any GPIO pins that it offers, they can after this patch.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Sam, it'd be nice if you could ACK these first four patches,
the series basically simplifies things a lot by not cascading
the AB8500 IRQs and duplicate code in the pinctrl driver.
---
 drivers/mfd/ab8500-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index bad3fe2..a0a3f72 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1097,7 +1097,8 @@ static struct mfd_cell ab8500_devs[] = {
 
 static struct mfd_cell ab9540_devs[] = {
 	{
-		.name = "ab8500-gpio",
+		.name = "pinctrl-ab9540",
+		.of_compatible = "stericsson,ab9540-gpio",
 	},
 	{
 		.name = "ab9540-usb",
-- 
1.7.11.3


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

* [PATCH 05/14] pinctrl/abx500: prevent error path from corrupting returning error
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (3 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 04/14] mfd: ab8500: allow AB9540 based devices to use ABX500 pinctrl Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 06/14] pinctrl/abx500: align GPIO cluster boundaries Linus Walleij
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

Prior to this patch abx500_gpio_probe() would return the return-value
of gpiochip_remove() during its error patch regardless of what the
actual failure was. So as long as gpiochip_remove() succeeded, probe()
would look like it succeeded too.

This patch ensures the correct error value is returned and that
mutex_destroy() is invoked if gpiochip_add_pin_range() were to fail.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-abx500.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index 81ef515..9bdfcb9 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -1111,7 +1111,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 	struct abx500_gpio_platform_data *pdata;
 	struct abx500_pinctrl *pct;
 	const struct platform_device_id *platid = platform_get_device_id(pdev);
-	int ret;
+	int ret, err;
 	int i;
 
 	pdata = abx500_pdata->gpio;
@@ -1189,6 +1189,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 	if (!pct->pctldev) {
 		dev_err(&pdev->dev,
 			"could not register abx500 pinctrl driver\n");
+		ret = -EINVAL;
 		goto out_rem_chip;
 	}
 	dev_info(&pdev->dev, "registered pin controller\n");
@@ -1201,7 +1202,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 					dev_name(&pdev->dev),
 					p->offset - 1, p->offset, p->npins);
 		if (ret < 0)
-			return ret;
+			goto out_rem_chip;
 	}
 
 	platform_set_drvdata(pdev, pct);
@@ -1210,8 +1211,8 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 	return 0;
 
 out_rem_chip:
-	ret = gpiochip_remove(&pct->chip);
-	if (ret)
+	err = gpiochip_remove(&pct->chip);
+	if (err)
 		dev_info(&pdev->dev, "failed to remove gpiochip\n");
 out_rem_irq:
 	abx500_gpio_irq_remove(pct);
-- 
1.7.11.3


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

* [PATCH 06/14] pinctrl/abx500: align GPIO cluster boundaries
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (4 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 05/14] pinctrl/abx500: prevent error path from corrupting returning error Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 07/14] pinctrl/abx500: move IRQ handling to ab8500-core Linus Walleij
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

Not quite sure how this ever worked. In ab8500_gpio_to_irq() the
GPIO for conversion is passed through as the second argument. If
GPIO13, which is a valid GPIO for IRQ functionality, was received;
it would be rejected by the following guard:

    GPIO_IRQ_CLUSTER(5, 12, 0); /* GPIO numbers start from 1 */

    if (offset >= cluster->start && offset <= cluster->end)
        /* Valid GPIO for IRQ use */

Signed-off-by: Lee Jones <lee.jones@linaro.org>
[Augmented to account for off-by-one problem]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-ab8500.c |  6 +++---
 drivers/pinctrl/pinctrl-ab8505.c | 10 +++++-----
 drivers/pinctrl/pinctrl-ab8540.c |  4 ++--
 drivers/pinctrl/pinctrl-ab9540.c |  8 ++++----
 drivers/pinctrl/pinctrl-abx500.c |  6 ++++--
 5 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-ab8500.c b/drivers/pinctrl/pinctrl-ab8500.c
index 2cd424e..67dc942 100644
--- a/drivers/pinctrl/pinctrl-ab8500.c
+++ b/drivers/pinctrl/pinctrl-ab8500.c
@@ -456,9 +456,9 @@ struct alternate_functions ab8500_alternate_functions[AB8500_GPIO_MAX_NUMBER + 1
  *	GPIO36 to GPIO41
  */
 struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(5, 12, 0), /* GPIO numbers start from 1 */
-	GPIO_IRQ_CLUSTER(23, 24, 0),
-	GPIO_IRQ_CLUSTER(35, 40, 0),
+	GPIO_IRQ_CLUSTER(6, 13, 0),
+	GPIO_IRQ_CLUSTER(24, 25, 0),
+	GPIO_IRQ_CLUSTER(36, 41, 0),
 };
 
 static struct abx500_pinctrl_soc_data ab8500_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab8505.c b/drivers/pinctrl/pinctrl-ab8505.c
index 40dc3e1..825710a 100644
--- a/drivers/pinctrl/pinctrl-ab8505.c
+++ b/drivers/pinctrl/pinctrl-ab8505.c
@@ -349,11 +349,11 @@ struct alternate_functions ab8505_alternate_functions[AB8505_GPIO_MAX_NUMBER + 1
  *	GPIO52 to GPIO53
  */
 struct abx500_gpio_irq_cluster ab8505_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(9, 10, 0), /* GPIO numbers start from 1 */
-	GPIO_IRQ_CLUSTER(12, 12, 0),
-	GPIO_IRQ_CLUSTER(39, 40, 0),
-	GPIO_IRQ_CLUSTER(49, 49, 0),
-	GPIO_IRQ_CLUSTER(51, 52, 0),
+	GPIO_IRQ_CLUSTER(10, 11, 0),
+	GPIO_IRQ_CLUSTER(13, 13, 0),
+	GPIO_IRQ_CLUSTER(40, 41, 0),
+	GPIO_IRQ_CLUSTER(50, 50, 0),
+	GPIO_IRQ_CLUSTER(52, 53, 0),
 };
 
 static struct abx500_pinctrl_soc_data ab8505_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab8540.c b/drivers/pinctrl/pinctrl-ab8540.c
index e75310d..0fcd943 100644
--- a/drivers/pinctrl/pinctrl-ab8540.c
+++ b/drivers/pinctrl/pinctrl-ab8540.c
@@ -377,8 +377,8 @@ static struct pullud ab8540_pullud = {
  *	GPIO51 to GPIO54
  */
 struct abx500_gpio_irq_cluster ab8540_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(42, 43, 2), /* GPIO numbers start from 1 */
-	GPIO_IRQ_CLUSTER(50, 53, 0),
+	GPIO_IRQ_CLUSTER(43, 44, 2),
+	GPIO_IRQ_CLUSTER(51, 54, 0),
 };
 
 static struct abx500_pinctrl_soc_data ab8540_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab9540.c b/drivers/pinctrl/pinctrl-ab9540.c
index 31fec3e..28dfb2e 100644
--- a/drivers/pinctrl/pinctrl-ab9540.c
+++ b/drivers/pinctrl/pinctrl-ab9540.c
@@ -455,10 +455,10 @@ struct alternate_functions ab9540alternate_functions[AB9540_GPIO_MAX_NUMBER + 1]
 };
 
 struct abx500_gpio_irq_cluster ab9540_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(9, 12, 0), /* GPIO numbers start from 1 */
-	GPIO_IRQ_CLUSTER(23, 24, 0),
-	GPIO_IRQ_CLUSTER(39, 40, 0),
-	GPIO_IRQ_CLUSTER(49, 53, 0),
+	GPIO_IRQ_CLUSTER(10, 13, 0),
+	GPIO_IRQ_CLUSTER(24, 25, 0),
+	GPIO_IRQ_CLUSTER(40, 41, 0),
+	GPIO_IRQ_CLUSTER(50, 54, 0),
 };
 
 static struct abx500_pinctrl_soc_data ab9540_soc = {
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index 9bdfcb9..a9e720f 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -272,6 +272,8 @@ static int abx500_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
 	struct abx500_pinctrl *pct = to_abx500_pinctrl(chip);
+	/* The AB8500 GPIO numbers are off by one */
+	int gpio = offset + 1;
 	int base = pct->irq_base;
 	int i;
 
@@ -279,8 +281,8 @@ static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 		struct abx500_gpio_irq_cluster *cluster =
 			&pct->irq_cluster[i];
 
-		if (offset >= cluster->start && offset <= cluster->end)
-			return base + offset - cluster->start;
+		if (gpio >= cluster->start && gpio <= cluster->end)
+			return base + gpio - cluster->start;
 
 		/* Advance by the number of gpios in this cluster */
 		base += cluster->end + cluster->offset - cluster->start + 1;
-- 
1.7.11.3


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

* [PATCH 07/14] pinctrl/abx500: move IRQ handling to ab8500-core
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (5 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 06/14] pinctrl/abx500: align GPIO cluster boundaries Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 08/14] pinctrl/abx500: replace IRQ offsets with table read-in values Linus Walleij
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

In its current state the gpio-ab8500 driver looks after some GPIO
lines found on the AB8500 MFD chip. It also controls all of its
own IRQ handling for these GPIOs by inventing some virtual IRQs
and handing those out to sub-devices. There has been quite a bit
of controversy over this and it was a contributing factor to the
driver being marked as BROKEN in Mainline.

The reason for adopting this method was due to added complexity
in the hardware. Unusually, each GPIO has two separate IRQs
associated with it, one for a rising and a different one for a
falling interrupt. Using this method complicates matters further
because the GPIO IRQs are actually sandwiched between a bunch
of IRQs which are handled solely by the AB8500 core driver.

The best way for us to take this forward is to get rid of the
virtual IRQs and only hand out the rising IRQ lines. If a
sub-driver wishes to request a falling interrupt, they can do
so by requesting a rising line in the normal way. They just
have to add IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_BOTH, if
they require both in the flags. Then if a falling IRQ is
triggered, the AB8500 core driver will know how to handle the
added complexity accordingly. This should greatly simply things.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
[Augment to keep irq_base for a while (removed later)]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-abx500.c | 299 +--------------------------------------
 1 file changed, 3 insertions(+), 296 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index a9e720f..716c835 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
 #include <linux/mfd/abx500.h>
@@ -85,20 +86,11 @@
 #define AB8540_GPIO_VINSEL_REG	0x47
 #define AB8540_GPIO_PULL_UPDOWN_REG	0x48
 #define AB8500_GPIO_ALTFUN_REG	0x50
-#define AB8500_NUM_VIR_GPIO_IRQ	16
 #define AB8540_GPIO_PULL_UPDOWN_MASK	0x03
 #define AB8540_GPIO_VINSEL_MASK	0x03
 #define AB8540_GPIOX_VBAT_START	51
 #define AB8540_GPIOX_VBAT_END	54
 
-enum abx500_gpio_action {
-	NONE,
-	STARTUP,
-	SHUTDOWN,
-	MASK,
-	UNMASK
-};
-
 struct abx500_pinctrl {
 	struct device *dev;
 	struct pinctrl_dev *pctldev;
@@ -107,14 +99,8 @@ struct abx500_pinctrl {
 	struct ab8500 *parent;
 	struct mutex lock;
 	u32 irq_base;
-	enum abx500_gpio_action irq_action;
-	u16 rising;
-	u16 falling;
 	struct abx500_gpio_irq_cluster *irq_cluster;
 	int irq_cluster_size;
-	int irq_gpio_rising_offset;
-	int irq_gpio_falling_offset;
-	int irq_gpio_factor;
 };
 
 /**
@@ -469,7 +455,6 @@ static void abx500_gpio_dbg_show_one(struct seq_file *s,
 				     struct gpio_chip *chip,
 				     unsigned offset, unsigned gpio)
 {
-	struct abx500_pinctrl *pct = to_abx500_pinctrl(chip);
 	const char *label = gpiochip_is_requested(chip, offset - 1);
 	u8 gpio_offset = offset - 1;
 	int mode = -1;
@@ -498,25 +483,6 @@ static void abx500_gpio_dbg_show_one(struct seq_file *s,
 		   : "?  ")
 		   : (pull ? "pull up" : "pull down"),
 		   (mode < 0) ? "unknown" : modes[mode]);
-
-	if (label && !is_out) {
-		int irq = gpio_to_irq(gpio);
-		struct irq_desc	*desc = irq_to_desc(irq);
-
-		if (irq >= 0 && desc->action) {
-			char *trigger;
-			int irq_offset = irq - pct->irq_base;
-
-			if (pct->rising & BIT(irq_offset))
-				trigger = "edge-rising";
-			else if (pct->falling & BIT(irq_offset))
-				trigger = "edge-falling";
-			else
-				trigger = "edge-undefined";
-
-			seq_printf(s, " irq-%d %s", irq, trigger);
-		}
-	}
 }
 
 static void abx500_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
@@ -570,219 +536,6 @@ static struct gpio_chip abx500gpio_chip = {
 	.dbg_show		= abx500_gpio_dbg_show,
 };
 
-static unsigned int irq_to_rising(unsigned int irq)
-{
-	struct abx500_pinctrl *pct = irq_get_chip_data(irq);
-	int offset = irq - pct->irq_base;
-	int new_irq;
-
-	new_irq = offset * pct->irq_gpio_factor
-		+ pct->irq_gpio_rising_offset
-		+ pct->parent->irq_base;
-
-	return new_irq;
-}
-
-static unsigned int irq_to_falling(unsigned int irq)
-{
-	struct abx500_pinctrl *pct = irq_get_chip_data(irq);
-	int offset = irq - pct->irq_base;
-	int new_irq;
-
-	new_irq = offset * pct->irq_gpio_factor
-		+ pct->irq_gpio_falling_offset
-		+ pct->parent->irq_base;
-	return new_irq;
-
-}
-
-static unsigned int rising_to_irq(unsigned int irq, void *dev)
-{
-	struct abx500_pinctrl *pct = dev;
-	int offset, new_irq;
-
-	offset = irq - pct->irq_gpio_rising_offset
-		- pct->parent->irq_base;
-	new_irq = (offset / pct->irq_gpio_factor)
-		+ pct->irq_base;
-
-	return new_irq;
-}
-
-static unsigned int falling_to_irq(unsigned int irq, void *dev)
-{
-	struct abx500_pinctrl *pct = dev;
-	int offset, new_irq;
-
-	offset = irq - pct->irq_gpio_falling_offset
-		- pct->parent->irq_base;
-	new_irq = (offset / pct->irq_gpio_factor)
-		+ pct->irq_base;
-
-	return new_irq;
-}
-
-/*
- * IRQ handler
- */
-
-static irqreturn_t handle_rising(int irq, void *dev)
-{
-
-	handle_nested_irq(rising_to_irq(irq , dev));
-	return IRQ_HANDLED;
-}
-
-static irqreturn_t handle_falling(int irq, void *dev)
-{
-
-	handle_nested_irq(falling_to_irq(irq, dev));
-	return IRQ_HANDLED;
-}
-
-static void abx500_gpio_irq_lock(struct irq_data *data)
-{
-	struct abx500_pinctrl *pct = irq_data_get_irq_chip_data(data);
-	mutex_lock(&pct->lock);
-}
-
-static void abx500_gpio_irq_sync_unlock(struct irq_data *data)
-{
-	struct abx500_pinctrl *pct = irq_data_get_irq_chip_data(data);
-	unsigned int irq = data->irq;
-	int offset = irq - pct->irq_base;
-	bool rising = pct->rising & BIT(offset);
-	bool falling = pct->falling & BIT(offset);
-	int ret;
-
-	switch (pct->irq_action)	{
-	case STARTUP:
-		if (rising)
-			ret = request_threaded_irq(irq_to_rising(irq),
-					NULL, handle_rising,
-					IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND,
-					"abx500-gpio-r", pct);
-		if (falling)
-			ret = request_threaded_irq(irq_to_falling(irq),
-				       NULL, handle_falling,
-				       IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND,
-				       "abx500-gpio-f", pct);
-		break;
-	case SHUTDOWN:
-		if (rising)
-			free_irq(irq_to_rising(irq), pct);
-		if (falling)
-			free_irq(irq_to_falling(irq), pct);
-		break;
-	case MASK:
-		if (rising)
-			disable_irq(irq_to_rising(irq));
-		if (falling)
-			disable_irq(irq_to_falling(irq));
-		break;
-	case UNMASK:
-		if (rising)
-			enable_irq(irq_to_rising(irq));
-		if (falling)
-			enable_irq(irq_to_falling(irq));
-		break;
-	case NONE:
-		break;
-	}
-	pct->irq_action = NONE;
-	pct->rising &= ~(BIT(offset));
-	pct->falling &= ~(BIT(offset));
-	mutex_unlock(&pct->lock);
-}
-
-
-static void abx500_gpio_irq_mask(struct irq_data *data)
-{
-	struct abx500_pinctrl *pct = irq_data_get_irq_chip_data(data);
-	pct->irq_action = MASK;
-}
-
-static void abx500_gpio_irq_unmask(struct irq_data *data)
-{
-	struct abx500_pinctrl *pct =  irq_data_get_irq_chip_data(data);
-	pct->irq_action = UNMASK;
-}
-
-static int abx500_gpio_irq_set_type(struct irq_data *data, unsigned int type)
-{
-	struct abx500_pinctrl *pct = irq_data_get_irq_chip_data(data);
-	unsigned int irq = data->irq;
-	int offset = irq - pct->irq_base;
-
-	if (type == IRQ_TYPE_EDGE_BOTH) {
-		pct->rising =  BIT(offset);
-		pct->falling = BIT(offset);
-	} else if (type == IRQ_TYPE_EDGE_RISING) {
-		pct->rising =  BIT(offset);
-	} else  {
-		pct->falling = BIT(offset);
-	}
-	return 0;
-}
-
-static unsigned int abx500_gpio_irq_startup(struct irq_data *data)
-{
-	struct abx500_pinctrl *pct = irq_data_get_irq_chip_data(data);
-	pct->irq_action = STARTUP;
-	return 0;
-}
-
-static void abx500_gpio_irq_shutdown(struct irq_data *data)
-{
-	struct abx500_pinctrl *pct = irq_data_get_irq_chip_data(data);
-	pct->irq_action = SHUTDOWN;
-}
-
-static struct irq_chip abx500_gpio_irq_chip = {
-	.name			= "abx500-gpio",
-	.irq_startup		= abx500_gpio_irq_startup,
-	.irq_shutdown		= abx500_gpio_irq_shutdown,
-	.irq_bus_lock		= abx500_gpio_irq_lock,
-	.irq_bus_sync_unlock	= abx500_gpio_irq_sync_unlock,
-	.irq_mask		= abx500_gpio_irq_mask,
-	.irq_unmask		= abx500_gpio_irq_unmask,
-	.irq_set_type		= abx500_gpio_irq_set_type,
-};
-
-static int abx500_gpio_irq_init(struct abx500_pinctrl *pct)
-{
-	u32 base = pct->irq_base;
-	int irq;
-
-	for (irq = base; irq < base + AB8500_NUM_VIR_GPIO_IRQ ; irq++) {
-		irq_set_chip_data(irq, pct);
-		irq_set_chip_and_handler(irq, &abx500_gpio_irq_chip,
-				handle_simple_irq);
-		irq_set_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
-		set_irq_flags(irq, IRQF_VALID);
-#else
-		irq_set_noprobe(irq);
-#endif
-	}
-
-	return 0;
-}
-
-static void abx500_gpio_irq_remove(struct abx500_pinctrl *pct)
-{
-	int base = pct->irq_base;
-	int irq;
-
-	for (irq = base; irq < base + AB8500_NUM_VIR_GPIO_IRQ; irq++) {
-#ifdef CONFIG_ARM
-		set_irq_flags(irq, 0);
-#endif
-		irq_set_chip_and_handler(irq, NULL, NULL);
-		irq_set_chip_data(irq, NULL);
-	}
-}
-
 static int abx500_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev)
 {
 	struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev);
@@ -811,43 +564,6 @@ static int abx500_pmx_get_func_groups(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
-static void abx500_disable_lazy_irq(struct gpio_chip *chip, unsigned gpio)
-{
-	struct abx500_pinctrl *pct = to_abx500_pinctrl(chip);
-	int irq;
-	int offset;
-	bool rising;
-	bool falling;
-
-	/*
-	 * check if gpio has interrupt capability and convert
-	 * gpio number to irq
-	 * On ABx5xx, there is no GPIO0, GPIO1 is the
-	 * first one, so adjust gpio number
-	 */
-	gpio--;
-	irq =  gpio_to_irq(gpio + chip->base);
-	if (irq < 0)
-		return;
-
-	offset = irq - pct->irq_base;
-	rising = pct->rising & BIT(offset);
-	falling = pct->falling & BIT(offset);
-
-	/* nothing to do ?*/
-	if (!rising && !falling)
-		return;
-
-	if (rising) {
-		disable_irq(irq_to_rising(irq));
-		free_irq(irq_to_rising(irq), pct);
-	}
-	if (falling) {
-		disable_irq(irq_to_falling(irq));
-		free_irq(irq_to_falling(irq), pct);
-	}
-}
-
 static int abx500_pmx_enable(struct pinctrl_dev *pctldev, unsigned function,
 			     unsigned group)
 {
@@ -867,7 +583,6 @@ static int abx500_pmx_enable(struct pinctrl_dev *pctldev, unsigned function,
 		dev_dbg(pct->dev, "setting pin %d to altsetting %d\n",
 			g->pins[i], g->altsetting);
 
-		abx500_disable_lazy_irq(chip, g->pins[i]);
 		ret = abx500_set_mode(pctldev, chip, g->pins[i], g->altsetting);
 	}
 
@@ -1170,18 +885,12 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 	pct->chip.ngpio = abx500_get_gpio_num(pct->soc);
 	pct->irq_cluster = pct->soc->gpio_irq_cluster;
 	pct->irq_cluster_size = pct->soc->ngpio_irq_cluster;
-	pct->irq_gpio_rising_offset = pct->soc->irq_gpio_rising_offset;
-	pct->irq_gpio_falling_offset = pct->soc->irq_gpio_falling_offset;
-	pct->irq_gpio_factor = pct->soc->irq_gpio_factor;
 
-	ret = abx500_gpio_irq_init(pct);
-	if (ret)
-		goto out_free;
 	ret = gpiochip_add(&pct->chip);
 	if (ret) {
 		dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret);
 		mutex_destroy(&pct->lock);
-		goto out_rem_irq;
+		return ret;
 	}
 	dev_info(&pdev->dev, "added gpiochip\n");
 
@@ -1216,9 +925,7 @@ out_rem_chip:
 	err = gpiochip_remove(&pct->chip);
 	if (err)
 		dev_info(&pdev->dev, "failed to remove gpiochip\n");
-out_rem_irq:
-	abx500_gpio_irq_remove(pct);
-out_free:
+
 	mutex_destroy(&pct->lock);
 	return ret;
 }
-- 
1.7.11.3


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

* [PATCH 08/14] pinctrl/abx500: replace IRQ offsets with table read-in values
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (6 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 07/14] pinctrl/abx500: move IRQ handling to ab8500-core Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 09/14] pinctrl/abx500: use direct IRQ defines Linus Walleij
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

The ABx500 GPIO controller used to provide a set of virtual contiguous
IRQs for use by sub-devices, but they have been removed after a request
from Mainline Maintainers. Now the AB8500 core driver deals with almost
all IRQ related issues instead.

The ABx500 GPIO driver is now only used to convert between GPIO and IRQ
numbers which is actually quite difficult, as the ABx500 GPIO's
associated IRQs are clustered together throughout the interrupt number
space at irregular intervals. To solve this quandary, we have placed the
read-in values into the existing cluster information table to use during
conversion.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
[Moved irq_base removal into this patch]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-ab8500.c |  6 +++---
 drivers/pinctrl/pinctrl-ab8505.c | 10 +++++-----
 drivers/pinctrl/pinctrl-ab8540.c |  5 +++--
 drivers/pinctrl/pinctrl-ab9540.c |  8 ++++----
 drivers/pinctrl/pinctrl-abx500.c | 18 +++++++++++-------
 drivers/pinctrl/pinctrl-abx500.h | 10 ++++++----
 6 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-ab8500.c b/drivers/pinctrl/pinctrl-ab8500.c
index 67dc942..42675ee 100644
--- a/drivers/pinctrl/pinctrl-ab8500.c
+++ b/drivers/pinctrl/pinctrl-ab8500.c
@@ -456,9 +456,9 @@ struct alternate_functions ab8500_alternate_functions[AB8500_GPIO_MAX_NUMBER + 1
  *	GPIO36 to GPIO41
  */
 struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(6, 13, 0),
-	GPIO_IRQ_CLUSTER(24, 25, 0),
-	GPIO_IRQ_CLUSTER(36, 41, 0),
+	GPIO_IRQ_CLUSTER(6,  13, 34),
+	GPIO_IRQ_CLUSTER(24, 25, 24),
+	GPIO_IRQ_CLUSTER(36, 41, 14),
 };
 
 static struct abx500_pinctrl_soc_data ab8500_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab8505.c b/drivers/pinctrl/pinctrl-ab8505.c
index 825710a..f8075c6 100644
--- a/drivers/pinctrl/pinctrl-ab8505.c
+++ b/drivers/pinctrl/pinctrl-ab8505.c
@@ -349,11 +349,11 @@ struct alternate_functions ab8505_alternate_functions[AB8505_GPIO_MAX_NUMBER + 1
  *	GPIO52 to GPIO53
  */
 struct abx500_gpio_irq_cluster ab8505_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(10, 11, 0),
-	GPIO_IRQ_CLUSTER(13, 13, 0),
-	GPIO_IRQ_CLUSTER(40, 41, 0),
-	GPIO_IRQ_CLUSTER(50, 50, 0),
-	GPIO_IRQ_CLUSTER(52, 53, 0),
+	GPIO_IRQ_CLUSTER(10, 11, 34),
+	GPIO_IRQ_CLUSTER(13, 13, 34),
+	GPIO_IRQ_CLUSTER(40, 41, 14),
+	GPIO_IRQ_CLUSTER(50, 50, 63),
+	GPIO_IRQ_CLUSTER(52, 53, 63),
 };
 
 static struct abx500_pinctrl_soc_data ab8505_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab8540.c b/drivers/pinctrl/pinctrl-ab8540.c
index 0fcd943..ac2e135 100644
--- a/drivers/pinctrl/pinctrl-ab8540.c
+++ b/drivers/pinctrl/pinctrl-ab8540.c
@@ -377,8 +377,9 @@ static struct pullud ab8540_pullud = {
  *	GPIO51 to GPIO54
  */
 struct abx500_gpio_irq_cluster ab8540_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(43, 44, 2),
-	GPIO_IRQ_CLUSTER(51, 54, 0),
+	GPIO_IRQ_CLUSTER(43, 43, 126),
+	GPIO_IRQ_CLUSTER(44, 44, 127),
+	GPIO_IRQ_CLUSTER(51, 54, 63),
 };
 
 static struct abx500_pinctrl_soc_data ab8540_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab9540.c b/drivers/pinctrl/pinctrl-ab9540.c
index 28dfb2e..a169e5b 100644
--- a/drivers/pinctrl/pinctrl-ab9540.c
+++ b/drivers/pinctrl/pinctrl-ab9540.c
@@ -455,10 +455,10 @@ struct alternate_functions ab9540alternate_functions[AB9540_GPIO_MAX_NUMBER + 1]
 };
 
 struct abx500_gpio_irq_cluster ab9540_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(10, 13, 0),
-	GPIO_IRQ_CLUSTER(24, 25, 0),
-	GPIO_IRQ_CLUSTER(40, 41, 0),
-	GPIO_IRQ_CLUSTER(50, 54, 0),
+	GPIO_IRQ_CLUSTER(10, 13, 34),
+	GPIO_IRQ_CLUSTER(24, 25, 24),
+	GPIO_IRQ_CLUSTER(40, 41, 14),
+	GPIO_IRQ_CLUSTER(50, 54, 63),
 };
 
 static struct abx500_pinctrl_soc_data ab9540_soc = {
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index 716c835..ded8f21 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -98,7 +98,6 @@ struct abx500_pinctrl {
 	struct gpio_chip chip;
 	struct ab8500 *parent;
 	struct mutex lock;
-	u32 irq_base;
 	struct abx500_gpio_irq_cluster *irq_cluster;
 	int irq_cluster_size;
 };
@@ -260,18 +259,24 @@ static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 	struct abx500_pinctrl *pct = to_abx500_pinctrl(chip);
 	/* The AB8500 GPIO numbers are off by one */
 	int gpio = offset + 1;
-	int base = pct->irq_base;
+	int hwirq;
 	int i;
 
 	for (i = 0; i < pct->irq_cluster_size; i++) {
 		struct abx500_gpio_irq_cluster *cluster =
 			&pct->irq_cluster[i];
 
-		if (gpio >= cluster->start && gpio <= cluster->end)
-			return base + gpio - cluster->start;
+		if (gpio >= cluster->start && gpio <= cluster->end) {
+			/*
+			 * The ABx500 GPIO's associated IRQs are clustered together
+			 * throughout the interrupt numbers at irregular intervals.
+			 * To solve this quandry, we have placed the read-in values
+			 * into the cluster information table.
+			 */
+			hwirq = gpio + cluster->to_irq;
 
-		/* Advance by the number of gpios in this cluster */
-		base += cluster->end + cluster->offset - cluster->start + 1;
+			return irq_create_mapping(pct->parent->domain, hwirq);
+		}
 	}
 
 	return -EINVAL;
@@ -850,7 +855,6 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 	pct->chip = abx500gpio_chip;
 	pct->chip.dev = &pdev->dev;
 	pct->chip.base = pdata->gpio_base;
-	pct->irq_base = pdata->irq_base;
 
 	/* initialize the lock */
 	mutex_init(&pct->lock);
diff --git a/drivers/pinctrl/pinctrl-abx500.h b/drivers/pinctrl/pinctrl-abx500.h
index df8e0ff..eeca8f9 100644
--- a/drivers/pinctrl/pinctrl-abx500.h
+++ b/drivers/pinctrl/pinctrl-abx500.h
@@ -98,7 +98,7 @@ struct pullud {
 {					\
 	.start = a,			\
 	.end = b,			\
-	.offset = c,			\
+	.to_irq = c,			\
 }
 
 /**
@@ -106,14 +106,16 @@ struct pullud {
  *			capable
  * @start:		The pin number of the first pin interrupt capable
  * @end:		The pin number of the last pin interrupt capable
- * @offset:		offset used to compute specific setting strategy of
- *			the interrupt line
+ * @to_irq:		The ABx500 GPIO's associated IRQs are clustered
+ *                      together throughout the interrupt numbers at irregular
+ *                      intervals. To solve this quandary, we will place the
+ *                      read-in values into the cluster information table
  */
 
 struct abx500_gpio_irq_cluster {
 	int start;
 	int end;
-	int offset;
+	int to_irq;
 };
 
 /**
-- 
1.7.11.3


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

* [PATCH 09/14] pinctrl/abx500: use direct IRQ defines
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (7 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 08/14] pinctrl/abx500: replace IRQ offsets with table read-in values Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-07  0:13   ` Stephen Warren
  2013-02-05 19:48 ` [PATCH 10/14] pinctrl/abx500: add Device Tree support Linus Walleij
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: Stephen Warren, Anmar Oueja, Linus Walleij

From: Linus Walleij <linus.walleij@linaro.org>

Make it harder to do mistakes by introducing the actual
defined ABx500 IRQ number into the IRQ cluster definitions.
Deduct cluster offset from the GPIO offset to make each
cluster coherent.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-ab8500.c |  6 +++---
 drivers/pinctrl/pinctrl-ab8505.c | 10 +++++-----
 drivers/pinctrl/pinctrl-ab8540.c |  6 +++---
 drivers/pinctrl/pinctrl-ab9540.c |  8 ++++----
 drivers/pinctrl/pinctrl-abx500.c |  3 +--
 5 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-ab8500.c b/drivers/pinctrl/pinctrl-ab8500.c
index 42675ee..3b471d8 100644
--- a/drivers/pinctrl/pinctrl-ab8500.c
+++ b/drivers/pinctrl/pinctrl-ab8500.c
@@ -456,9 +456,9 @@ struct alternate_functions ab8500_alternate_functions[AB8500_GPIO_MAX_NUMBER + 1
  *	GPIO36 to GPIO41
  */
 struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(6,  13, 34),
-	GPIO_IRQ_CLUSTER(24, 25, 24),
-	GPIO_IRQ_CLUSTER(36, 41, 14),
+	GPIO_IRQ_CLUSTER(6,  13, AB8500_INT_GPIO6R),
+	GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
+	GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
 };
 
 static struct abx500_pinctrl_soc_data ab8500_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab8505.c b/drivers/pinctrl/pinctrl-ab8505.c
index f8075c6..3a4238e 100644
--- a/drivers/pinctrl/pinctrl-ab8505.c
+++ b/drivers/pinctrl/pinctrl-ab8505.c
@@ -349,11 +349,11 @@ struct alternate_functions ab8505_alternate_functions[AB8505_GPIO_MAX_NUMBER + 1
  *	GPIO52 to GPIO53
  */
 struct abx500_gpio_irq_cluster ab8505_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(10, 11, 34),
-	GPIO_IRQ_CLUSTER(13, 13, 34),
-	GPIO_IRQ_CLUSTER(40, 41, 14),
-	GPIO_IRQ_CLUSTER(50, 50, 63),
-	GPIO_IRQ_CLUSTER(52, 53, 63),
+	GPIO_IRQ_CLUSTER(10, 11, AB8500_INT_GPIO10R),
+	GPIO_IRQ_CLUSTER(13, 13, AB8500_INT_GPIO13R),
+	GPIO_IRQ_CLUSTER(40, 41, AB8500_INT_GPIO40R),
+	GPIO_IRQ_CLUSTER(50, 50, AB9540_INT_GPIO50R),
+	GPIO_IRQ_CLUSTER(52, 53, AB9540_INT_GPIO52R),
 };
 
 static struct abx500_pinctrl_soc_data ab8505_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab8540.c b/drivers/pinctrl/pinctrl-ab8540.c
index ac2e135..8ee1e8d 100644
--- a/drivers/pinctrl/pinctrl-ab8540.c
+++ b/drivers/pinctrl/pinctrl-ab8540.c
@@ -377,9 +377,9 @@ static struct pullud ab8540_pullud = {
  *	GPIO51 to GPIO54
  */
 struct abx500_gpio_irq_cluster ab8540_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(43, 43, 126),
-	GPIO_IRQ_CLUSTER(44, 44, 127),
-	GPIO_IRQ_CLUSTER(51, 54, 63),
+	GPIO_IRQ_CLUSTER(43, 43, AB8540_INT_GPIO43F),
+	GPIO_IRQ_CLUSTER(44, 44, AB8540_INT_GPIO44F),
+	GPIO_IRQ_CLUSTER(51, 54, AB9540_INT_GPIO51R),
 };
 
 static struct abx500_pinctrl_soc_data ab8540_soc = {
diff --git a/drivers/pinctrl/pinctrl-ab9540.c b/drivers/pinctrl/pinctrl-ab9540.c
index a169e5b..7610bd0 100644
--- a/drivers/pinctrl/pinctrl-ab9540.c
+++ b/drivers/pinctrl/pinctrl-ab9540.c
@@ -455,10 +455,10 @@ struct alternate_functions ab9540alternate_functions[AB9540_GPIO_MAX_NUMBER + 1]
 };
 
 struct abx500_gpio_irq_cluster ab9540_gpio_irq_cluster[] = {
-	GPIO_IRQ_CLUSTER(10, 13, 34),
-	GPIO_IRQ_CLUSTER(24, 25, 24),
-	GPIO_IRQ_CLUSTER(40, 41, 14),
-	GPIO_IRQ_CLUSTER(50, 54, 63),
+	GPIO_IRQ_CLUSTER(10, 13, AB8500_INT_GPIO10R),
+	GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
+	GPIO_IRQ_CLUSTER(40, 41, AB8500_INT_GPIO40R),
+	GPIO_IRQ_CLUSTER(50, 54, AB9540_INT_GPIO50R),
 };
 
 static struct abx500_pinctrl_soc_data ab9540_soc = {
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index ded8f21..a0d324b 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -273,8 +273,7 @@ static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 			 * To solve this quandry, we have placed the read-in values
 			 * into the cluster information table.
 			 */
-			hwirq = gpio + cluster->to_irq;
-
+			hwirq = gpio - cluster->start + cluster->to_irq;
 			return irq_create_mapping(pct->parent->domain, hwirq);
 		}
 	}
-- 
1.7.11.3


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

* [PATCH 10/14] pinctrl/abx500: add Device Tree support
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (8 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 09/14] pinctrl/abx500: use direct IRQ defines Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data Linus Walleij
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

This patch will allow the ABX500 Pinctrl driver to be probed when
Device Tree is enabled with an appropriate node contained.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/pinctrl-abx500.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c
index a0d324b..20f94cf 100644
--- a/drivers/pinctrl/pinctrl-abx500.c
+++ b/drivers/pinctrl/pinctrl-abx500.c
@@ -14,6 +14,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
 #include <linux/irq.h>
@@ -825,22 +827,44 @@ static int abx500_get_gpio_num(struct abx500_pinctrl_soc_data *soc)
 	return npins;
 }
 
+static const struct of_device_id abx500_gpio_match[] = {
+	{ .compatible = "stericsson,ab8500-gpio", .data = (void *)PINCTRL_AB8500, },
+	{ .compatible = "stericsson,ab8505-gpio", .data = (void *)PINCTRL_AB8505, },
+	{ .compatible = "stericsson,ab8540-gpio", .data = (void *)PINCTRL_AB8540, },
+	{ .compatible = "stericsson,ab9540-gpio", .data = (void *)PINCTRL_AB9540, },
+};
+
 static int abx500_gpio_probe(struct platform_device *pdev)
 {
 	struct ab8500_platform_data *abx500_pdata =
 				dev_get_platdata(pdev->dev.parent);
-	struct abx500_gpio_platform_data *pdata;
+	struct abx500_gpio_platform_data *pdata = NULL;
+	struct device_node *np = pdev->dev.of_node;
 	struct abx500_pinctrl *pct;
 	const struct platform_device_id *platid = platform_get_device_id(pdev);
+	unsigned int id = -1;
 	int ret, err;
 	int i;
 
-	pdata = abx500_pdata->gpio;
+	if (abx500_pdata)
+		pdata = abx500_pdata->gpio;
 	if (!pdata) {
-		dev_err(&pdev->dev, "gpio platform data missing\n");
-		return -ENODEV;
+		if (np) {
+			const struct of_device_id *match;
+
+			match = of_match_device(abx500_gpio_match, &pdev->dev);
+			if (!match)
+				return -ENODEV;
+			id = (unsigned long)match->data;
+		} else {
+			dev_err(&pdev->dev, "gpio dt and platform data missing\n");
+			return -ENODEV;
+		}
 	}
 
+	if (platid)
+		id = platid->driver_data;
+
 	pct = devm_kzalloc(&pdev->dev, sizeof(struct abx500_pinctrl),
 				   GFP_KERNEL);
 	if (pct == NULL) {
@@ -854,12 +878,13 @@ static int abx500_gpio_probe(struct platform_device *pdev)
 	pct->chip = abx500gpio_chip;
 	pct->chip.dev = &pdev->dev;
 	pct->chip.base = pdata->gpio_base;
+	pct->chip.base = (np) ? -1 : pdata->gpio_base;
 
 	/* initialize the lock */
 	mutex_init(&pct->lock);
 
 	/* Poke in other ASIC variants here */
-	switch (platid->driver_data) {
+	switch (id) {
 	case PINCTRL_AB8500:
 		abx500_pinctrl_ab8500_init(&pct->soc);
 		break;
@@ -966,6 +991,7 @@ static struct platform_driver abx500_gpio_driver = {
 	.driver = {
 		.name = "abx500-gpio",
 		.owner = THIS_MODULE,
+		.of_match_table = abx500_gpio_match,
 	},
 	.probe = abx500_gpio_probe,
 	.remove = abx500_gpio_remove,
-- 
1.7.11.3


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

* [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (9 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 10/14] pinctrl/abx500: add Device Tree support Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-10  2:42   ` Olof Johansson
  2013-02-05 19:48 ` [PATCH 12/14] ARM: ux500: use real AB8500 IRQ numbers instead of virtual ones Linus Walleij
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, arm, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

AB8500 GPIO no longer handles its GPIO IRQs. Instead, the AB8500
core driver has taken back the responsibility. Prior to this
happening, the AB8500 GPIO driver provided a set of virtual IRQs
which were used as a pass-through. These virtual IRQs had a base
of MOP500_AB8500_VIR_GPIO_IRQ_BASE, which was passed though pdata.
We don't need to do this anymore, so we're pulling out the
property from the structure.

Cc: arm@kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Requesting an ACK from the ARM SoC maintainers on this patch.
---
 arch/arm/mach-ux500/board-mop500.c     | 1 -
 include/linux/mfd/abx500/ab8500-gpio.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index b6f14ee..b8781ca 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -92,7 +92,6 @@ static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
 
 static struct abx500_gpio_platform_data ab8500_gpio_pdata = {
 	.gpio_base		= MOP500_AB8500_PIN_GPIO(1),
-	.irq_base		= MOP500_AB8500_VIR_GPIO_IRQ_BASE,
 };
 
 /* ab8500-codec */
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index e8c8281..172b2f2 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -16,7 +16,6 @@
 
 struct abx500_gpio_platform_data {
 	int gpio_base;
-	u32 irq_base;
 };
 
 enum abx500_gpio_pull_updown {
-- 
1.7.11.3


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

* [PATCH 12/14] ARM: ux500: use real AB8500 IRQ numbers instead of virtual ones
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (10 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-05 19:48 ` [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF Linus Walleij
  2013-02-05 19:48 ` [PATCH 14/14] ARM: ux500: allow Snowball access to the AB8500 GPIO pins Linus Walleij
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, arm, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

Any devices wishing to use the AB8500's GPIO IRQs were forced to
request virtual IRQs from the gpio-ab8500 driver. Now that
responsibility has been passed back to the AB8500 core driver,
devices can request real IRQ numbers instead. This patch removes
any traces of the old virtual IRQ conversion handlers, which will
force any drivers requesting IRQs to use real IRQS.

Cc: arm@kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Requesting an ACK from the ARM SoC maintainers on this patch.
---
 arch/arm/mach-ux500/include/mach/irqs-board-mop500.h | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
index 7d34c52..d526dd8 100644
--- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
+++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
@@ -38,15 +38,7 @@
 #define MOP500_STMPE1601_IRQ_END	\
 	MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS)
 
-/* AB8500 virtual gpio IRQ */
-#define AB8500_VIR_GPIO_NR_IRQS			16
-
-#define MOP500_AB8500_VIR_GPIO_IRQ_BASE		\
-	MOP500_STMPE1601_IRQ_END
-#define MOP500_AB8500_VIR_GPIO_IRQ_END		\
-	(MOP500_AB8500_VIR_GPIO_IRQ_BASE + AB8500_VIR_GPIO_NR_IRQS)
-
-#define MOP500_NR_IRQS		MOP500_AB8500_VIR_GPIO_IRQ_END
+#define MOP500_NR_IRQS		MOP500_STMPE1601_IRQ_END
 
 #define MOP500_IRQ_END		MOP500_NR_IRQS
 
-- 
1.7.11.3


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

* [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (11 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 12/14] ARM: ux500: use real AB8500 IRQ numbers instead of virtual ones Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  2013-02-07  0:17   ` Stephen Warren
  2013-02-05 19:48 ` [PATCH 14/14] ARM: ux500: allow Snowball access to the AB8500 GPIO pins Linus Walleij
  13 siblings, 1 reply; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, arm, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

The AB8500 GPIO driver has been un-BROKEN and rewritten as a pinctrl
driver. Now that it's back in use, let's ensure that it's available
when booting HREF with Device Tree enabled.

Cc: arm@kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Requesting an ACK from the ARM SoC maintainers on this patch.
---
 arch/arm/boot/dts/hrefprev60.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
index eec29c4..0c2b975 100644
--- a/arch/arm/boot/dts/hrefprev60.dts
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -25,6 +25,14 @@
 	};
 
 	soc-u9500 {
+		prcmu@80157000 {
+			ab8500@5 {
+				ab8500-gpio {
+					compatible = "stericsson,ab8500-gpio";
+				};
+			};
+		};
+
 		i2c@80004000 {
 			tps61052@33 {
 				compatible = "tps61052";
-- 
1.7.11.3


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

* [PATCH 14/14] ARM: ux500: allow Snowball access to the AB8500 GPIO pins
  2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
                   ` (12 preceding siblings ...)
  2013-02-05 19:48 ` [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF Linus Walleij
@ 2013-02-05 19:48 ` Linus Walleij
  13 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-05 19:48 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel
  Cc: Stephen Warren, Anmar Oueja, Lee Jones, arm, Linus Walleij

From: Lee Jones <lee.jones@linaro.org>

The AB8500 GPIO driver has been un-BROKEN and rewritten as a pinctrl
driver. Now that it's back in use, let's ensure that it's available
when booting Snowball with Device Tree enabled.

Cc: arm@kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Requesting an ACK from the ARM SoC maintainers on this patch.
---
 arch/arm/boot/dts/snowball.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 27f31a5..b095e85 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -299,6 +299,10 @@
 			};
 
 			ab8500@5 {
+				ab8500-gpio {
+					compatible = "stericsson,ab8500-gpio";
+				};
+
 				ab8500-regulators {
 					ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
 						regulator-name = "V-DISPLAY";
-- 
1.7.11.3


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

* Re: [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function
  2013-02-05 19:48 ` [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function Linus Walleij
@ 2013-02-07  0:07   ` Stephen Warren
       [not found]     ` <CAF2Aj3iO+6j+T5C0X2Hh6TsvT4yaJ2cai6cC9DaiRAwL9n-dVw@mail.gmail.com>
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-02-07  0:07 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
	Lee Jones, Samuel Ortiz, Linus Walleij

On 02/05/2013 12:48 PM, Linus Walleij wrote:
> From: Lee Jones <lee.jones@linaro.org>
> 
> In the AB8500 IRQ mask and unmask functions, we rely on testing for
> IRQ_TYPE_EDGE_RISING and IRQ_TYPE_EDGE_FALLING interrupts to
> physically mask and unmask the correct interrupt lines. In order
> for us to do that, the trigger needs to be set in the associated
> flags. However, unless a irq_set_type() function pointer is passed
> when registering the IRQ chip, the IRQ subsystem will refuse to do
> it. For that reason, we're providing one.

> diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c

> +static int ab8500_irq_set_type(struct irq_data *data, unsigned int type)
> +{
> +	return 0;
> +}

I think patch 0 implied that only rising/falling edges can be detected,
not levels? If so, should that function validate that the requested type
can be supported?

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

* Re: [PATCH 03/14] mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly
  2013-02-05 19:48 ` [PATCH 03/14] mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly Linus Walleij
@ 2013-02-07  0:08   ` Stephen Warren
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Warren @ 2013-02-07  0:08 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
	Lee Jones, Samuel Ortiz, Linus Walleij

On 02/05/2013 12:48 PM, Linus Walleij wrote:
> From: Lee Jones <lee.jones@linaro.org>
> 
> The old, BROKEN AB8500 GPIO driver has been revamped as a shiny
> new pinctrl driver and has been renamed as such. So, if we would
> like to make use of it, we need to register it via its new name.

> diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c

>  static struct mfd_cell ab8500_devs[] = {
>  	{
> -		.name = "ab8500-gpio",
> +		.name = "pinctrl-ab8500",
>  		.of_compatible = "stericsson,ab8500-gpio",
>  	},

I assume that the GPIO/pinctrl driver has already been renamed in some
unrelated patch, so this patch is just fixing it so it works again?

If I'm not understanding correctly, doesn't this patch break "git
bisect", since it's only renaming it in the MFD core and not in the
driver that this expects to instantiate?


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

* Re: [PATCH 09/14] pinctrl/abx500: use direct IRQ defines
  2013-02-05 19:48 ` [PATCH 09/14] pinctrl/abx500: use direct IRQ defines Linus Walleij
@ 2013-02-07  0:13   ` Stephen Warren
       [not found]     ` <CAF2Aj3jHe+mP0dU_BHThBV-va_iJLcFQedmWQOTaYafAZM1Yxg@mail.gmail.com>
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-02-07  0:13 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
	Linus Walleij

On 02/05/2013 12:48 PM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> Make it harder to do mistakes by introducing the actual
> defined ABx500 IRQ number into the IRQ cluster definitions.
> Deduct cluster offset from the GPIO offset to make each
> cluster coherent.

Shouldn't this patch be squashed into the previous patch to avoid churn?

>  static struct abx500_pinctrl_soc_data ab9540_soc = {

> @@ -273,8 +273,7 @@ static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)

> -			hwirq = gpio + cluster->to_irq;
> -
> +			hwirq = gpio - cluster->start + cluster->to_irq;
>  			return irq_create_mapping(pct->parent->domain, hwirq);

In particular, this change implies that the previous patch was simply
incorrect, although I haven't really thought about it in detail.

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

* Re: [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF
  2013-02-05 19:48 ` [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF Linus Walleij
@ 2013-02-07  0:17   ` Stephen Warren
  2013-02-07  8:30     ` Arnd Bergmann
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-02-07  0:17 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
	Lee Jones, arm, Linus Walleij

On 02/05/2013 12:48 PM, Linus Walleij wrote:
> From: Lee Jones <lee.jones@linaro.org>
> 
> The AB8500 GPIO driver has been un-BROKEN and rewritten as a pinctrl
> driver. Now that it's back in use, let's ensure that it's available
> when booting HREF with Device Tree enabled.

> diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts

>  	soc-u9500 {
> +		prcmu@80157000 {
> +			ab8500@5 {
> +				ab8500-gpio {
> +					compatible = "stericsson,ab8500-gpio";

The MFDs I've looked at (which admittedly might not be that many) all
have the top-level chip described in device tree, but not all the
component sub-devices, since they're all a static part of the top-level
chip. Instead, the top-level MFD instantiates all the sub-devices
itself. I'm curious why this MFD device works differently - do many work
like this?

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

* Re: [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF
  2013-02-07  0:17   ` Stephen Warren
@ 2013-02-07  8:30     ` Arnd Bergmann
  0 siblings, 0 replies; 27+ messages in thread
From: Arnd Bergmann @ 2013-02-07  8:30 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Linus Walleij, linux-kernel, linux-arm-kernel, Stephen Warren,
	Anmar Oueja, Lee Jones, arm, Linus Walleij

On Thursday 07 February 2013, Stephen Warren wrote:
> On 02/05/2013 12:48 PM, Linus Walleij wrote:
> > From: Lee Jones <lee.jones@linaro.org>
> > 
> > The AB8500 GPIO driver has been un-BROKEN and rewritten as a pinctrl
> > driver. Now that it's back in use, let's ensure that it's available
> > when booting HREF with Device Tree enabled.
> 
> > diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
> 
> >       soc-u9500 {
> > +             prcmu@80157000 {
> > +                     ab8500@5 {
> > +                             ab8500-gpio {
> > +                                     compatible = "stericsson,ab8500-gpio";
> 
> The MFDs I've looked at (which admittedly might not be that many) all
> have the top-level chip described in device tree, but not all the
> component sub-devices, since they're all a static part of the top-level
> chip. Instead, the top-level MFD instantiates all the sub-devices
> itself. I'm curious why this MFD device works differently - do many work
> like this?

I think in general, describing only the top level in DT is preferred.
However, that does not work if you have devices outside of the MFD
refer to devices inside of it, such as GPIO, clocks or interrupts:

In order to connect a button or an LED to this GPIO controller
in DT, you need to have a node you can refer to that follows the
GPIO binding. Putting all of that into the top-level device
would get messy here.

	Arnd

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

* Re: [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function
       [not found]     ` <CAF2Aj3iO+6j+T5C0X2Hh6TsvT4yaJ2cai6cC9DaiRAwL9n-dVw@mail.gmail.com>
@ 2013-02-07 10:01       ` Linus Walleij
  0 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-07 10:01 UTC (permalink / raw)
  To: Lee Jones
  Cc: Stephen Warren, Anmar Oueja, linux-arm-kernel, Samuel Ortiz,
	Stephen Warren, Linus Walleij, linux-kernel

On Thu, Feb 7, 2013 at 10:08 AM, Lee Jones <lee.jones@linaro.org> wrote:

> Great spot/idea. But then this won't work at all until I can write a fixup.
>
> Will you allow me to write a follow-up patch please?

For me a sequel is OK, especially given that this thing doesn't make
things any worse than they are already, but actually checking supported
types will not be trivial, because...

>> > +static int ab8500_irq_set_type(struct irq_data *data, unsigned int
>> > type)
>> > +{
>> > +     return 0;
>> > +}

This applies to *ALL* AB8500 IRQs, and some of them actually support
rising/falling, apart from the GPIO ones, so it's not enough to just handle
the GPIO IRQs here.

Yours,
Linus Walleij

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

* Re: [PATCH 09/14] pinctrl/abx500: use direct IRQ defines
       [not found]     ` <CAF2Aj3jHe+mP0dU_BHThBV-va_iJLcFQedmWQOTaYafAZM1Yxg@mail.gmail.com>
@ 2013-02-07 17:59       ` Stephen Warren
  2013-02-08  8:25         ` Lee Jones
  2013-02-07 19:10       ` Linus Walleij
  1 sibling, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-02-07 17:59 UTC (permalink / raw)
  To: Lee Jones
  Cc: Anmar Oueja, linux-arm-kernel, Linus Walleij, Stephen Warren,
	Linus Walleij, linux-kernel

On 02/07/2013 02:01 AM, Lee Jones wrote:
> I don't see myself on cc. Was that intentional?

The original patch was that way; I assume git send-email only CC'd you
on patches written by you.

> I quite like the idea of this.
> 
> Stephen,
> 
> It doesn't mean the other patch was wrong, it just transfers the math.

Ah, I see. The issue is that the code below clearly calculates the hwirq
differently, and it wasn't immediately obvious that this part of the
patch for example:

>  struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
> -	GPIO_IRQ_CLUSTER(6,  13, 34),
> -	GPIO_IRQ_CLUSTER(24, 25, 24),
> -	GPIO_IRQ_CLUSTER(36, 41, 14),
> +	GPIO_IRQ_CLUSTER(6,  13, AB8500_INT_GPIO6R),
> +	GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
> +	GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
>  };

... actually changes the values in the table (AB8500_INT_GPIO6R is 40,
so when using that value, you need to subtract of the value 6 for the
base to get the original 34).

> I wouldn't squash it into mine. I like the transition and the
> possibility to revert it if there's been some mistake.
> 
> (not to say there is one, but just in case.)
> 
> Sent from my mobile Linux device.
> 
> On Feb 7, 2013 12:14 AM, "Stephen Warren" <swarren@wwwdotorg.org
> <mailto:swarren@wwwdotorg.org>> wrote:
> 
>     On 02/05/2013 12:48 PM, Linus Walleij wrote:
>     > From: Linus Walleij <linus.walleij@linaro.org
>     <mailto:linus.walleij@linaro.org>>
>     >
>     > Make it harder to do mistakes by introducing the actual
>     > defined ABx500 IRQ number into the IRQ cluster definitions.
>     > Deduct cluster offset from the GPIO offset to make each
>     > cluster coherent.
> 
>     Shouldn't this patch be squashed into the previous patch to avoid churn?
> 
>     >  static struct abx500_pinctrl_soc_data ab9540_soc = {
> 
>     > @@ -273,8 +273,7 @@ static int abx500_gpio_to_irq(struct gpio_chip
>     *chip, unsigned offset)
> 
>     > -                     hwirq = gpio + cluster->to_irq;
>     > -
>     > +                     hwirq = gpio - cluster->start + cluster->to_irq;
>     >                       return
>     irq_create_mapping(pct->parent->domain, hwirq);
> 
>     In particular, this change implies that the previous patch was simply
>     incorrect, although I haven't really thought about it in detail.
>     --
>     To unsubscribe from this list: send the line "unsubscribe
>     linux-kernel" in
>     the body of a message to majordomo@vger.kernel.org
>     <mailto:majordomo@vger.kernel.org>
>     More majordomo info at  http://vger.kernel.org/majordomo-info.html
>     Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: [PATCH 09/14] pinctrl/abx500: use direct IRQ defines
       [not found]     ` <CAF2Aj3jHe+mP0dU_BHThBV-va_iJLcFQedmWQOTaYafAZM1Yxg@mail.gmail.com>
  2013-02-07 17:59       ` Stephen Warren
@ 2013-02-07 19:10       ` Linus Walleij
  1 sibling, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-07 19:10 UTC (permalink / raw)
  To: Lee Jones
  Cc: Stephen Warren, Anmar Oueja, linux-arm-kernel, Stephen Warren,
	Linus Walleij, linux-kernel

On Thu, Feb 7, 2013 at 10:01 AM, Lee Jones <lee.jones@linaro.org> wrote:

> I don't see myself on cc. Was that intentional?

No, it was my mistake...

> I quite like the idea of this.

Can I take it as an ACK? :-)

> Stephen,
>
> It doesn't mean the other patch was wrong, it just transfers the math.
>
> I wouldn't squash it into mine. I like the transition and the possibility to
> revert it if there's been some mistake.
>
> (not to say there is one, but just in case.)

I don't think it's wrong, just different. I changed
it after trying to subtract the offset in my head back
and forth a few times and screwed up the maths.

Yours,
Linus Walleij

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

* Re: [PATCH 09/14] pinctrl/abx500: use direct IRQ defines
  2013-02-07 17:59       ` Stephen Warren
@ 2013-02-08  8:25         ` Lee Jones
  2013-02-08 17:06           ` Stephen Warren
  0 siblings, 1 reply; 27+ messages in thread
From: Lee Jones @ 2013-02-08  8:25 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Anmar Oueja, linux-arm-kernel, Linus Walleij, Stephen Warren,
	Linus Walleij, linux-kernel

On Thu, 07 Feb 2013, Stephen Warren wrote:

> On 02/07/2013 02:01 AM, Lee Jones wrote:
> > I don't see myself on cc. Was that intentional?
> 
> The original patch was that way; I assume git send-email only CC'd you
> on patches written by you.

No, I didn't send this patch at all.

I was asking Linus if he ment to CC me, as I thought I should have been.

> > I quite like the idea of this.
> > 
> > Stephen,
> > 
> > It doesn't mean the other patch was wrong, it just transfers the math.
> 
> Ah, I see. The issue is that the code below clearly calculates the hwirq
> differently, and it wasn't immediately obvious that this part of the
> patch for example:
> 
> >  struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
> > -	GPIO_IRQ_CLUSTER(6,  13, 34),
> > -	GPIO_IRQ_CLUSTER(24, 25, 24),
> > -	GPIO_IRQ_CLUSTER(36, 41, 14),
> > +	GPIO_IRQ_CLUSTER(6,  13, AB8500_INT_GPIO6R),
> > +	GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
> > +	GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
> >  };
> 
> ... actually changes the values in the table (AB8500_INT_GPIO6R is 40,
> so when using that value, you need to subtract of the value 6 for the
> base to get the original 34).

Yes, I see how that may of looked if you didn't see the other change.

So you're happy?

> > I wouldn't squash it into mine. I like the transition and the
> > possibility to revert it if there's been some mistake.
> > 
> > (not to say there is one, but just in case.)
> > 
> > Sent from my mobile Linux device.
> > 
> > On Feb 7, 2013 12:14 AM, "Stephen Warren" <swarren@wwwdotorg.org
> > <mailto:swarren@wwwdotorg.org>> wrote:
> > 
> >     On 02/05/2013 12:48 PM, Linus Walleij wrote:
> >     > From: Linus Walleij <linus.walleij@linaro.org
> >     <mailto:linus.walleij@linaro.org>>
> >     >
> >     > Make it harder to do mistakes by introducing the actual
> >     > defined ABx500 IRQ number into the IRQ cluster definitions.
> >     > Deduct cluster offset from the GPIO offset to make each
> >     > cluster coherent.
> > 
> >     Shouldn't this patch be squashed into the previous patch to avoid churn?
> > 
> >     >  static struct abx500_pinctrl_soc_data ab9540_soc = {
> > 
> >     > @@ -273,8 +273,7 @@ static int abx500_gpio_to_irq(struct gpio_chip
> >     *chip, unsigned offset)
> > 
> >     > -                     hwirq = gpio + cluster->to_irq;
> >     > -
> >     > +                     hwirq = gpio - cluster->start + cluster->to_irq;
> >     >                       return
> >     irq_create_mapping(pct->parent->domain, hwirq);
> > 
> >     In particular, this change implies that the previous patch was simply
> >     incorrect, although I haven't really thought about it in detail.
> > 
> 

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 09/14] pinctrl/abx500: use direct IRQ defines
  2013-02-08  8:25         ` Lee Jones
@ 2013-02-08 17:06           ` Stephen Warren
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Warren @ 2013-02-08 17:06 UTC (permalink / raw)
  To: Lee Jones
  Cc: Anmar Oueja, linux-arm-kernel, Linus Walleij, Stephen Warren,
	Linus Walleij, linux-kernel

On 02/08/2013 01:25 AM, Lee Jones wrote:
> On Thu, 07 Feb 2013, Stephen Warren wrote:
> 
>> On 02/07/2013 02:01 AM, Lee Jones wrote:
>>> I don't see myself on cc. Was that intentional?
>>
>> The original patch was that way; I assume git send-email only CC'd you
>> on patches written by you.
> 
> No, I didn't send this patch at all.
> 
> I was asking Linus if he ment to CC me, as I thought I should have been.
> 
>>> I quite like the idea of this.
>>>
>>> Stephen,
>>>
>>> It doesn't mean the other patch was wrong, it just transfers the math.
>>
>> Ah, I see. The issue is that the code below clearly calculates the hwirq
>> differently, and it wasn't immediately obvious that this part of the
>> patch for example:
>>
>>>  struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
>>> -	GPIO_IRQ_CLUSTER(6,  13, 34),
>>> -	GPIO_IRQ_CLUSTER(24, 25, 24),
>>> -	GPIO_IRQ_CLUSTER(36, 41, 14),
>>> +	GPIO_IRQ_CLUSTER(6,  13, AB8500_INT_GPIO6R),
>>> +	GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
>>> +	GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
>>>  };
>>
>> ... actually changes the values in the table (AB8500_INT_GPIO6R is 40,
>> so when using that value, you need to subtract of the value 6 for the
>> base to get the original 34).
> 
> Yes, I see how that may of looked if you didn't see the other change.
> 
> So you're happy?

Yes.


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

* Re: [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data
  2013-02-05 19:48 ` [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data Linus Walleij
@ 2013-02-10  2:42   ` Olof Johansson
  2013-02-10 15:01     ` Linus Walleij
  0 siblings, 1 reply; 27+ messages in thread
From: Olof Johansson @ 2013-02-10  2:42 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-kernel, linux-arm-kernel, Stephen Warren, Anmar Oueja,
	Lee Jones, arm, Linus Walleij

On Tue, Feb 05, 2013 at 08:48:32PM +0100, Linus Walleij wrote:
> From: Lee Jones <lee.jones@linaro.org>
> 
> AB8500 GPIO no longer handles its GPIO IRQs. Instead, the AB8500
> core driver has taken back the responsibility. Prior to this
> happening, the AB8500 GPIO driver provided a set of virtual IRQs
> which were used as a pass-through. These virtual IRQs had a base
> of MOP500_AB8500_VIR_GPIO_IRQ_BASE, which was passed though pdata.
> We don't need to do this anymore, so we're pulling out the
> property from the structure.
> 
> Cc: arm@kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Requesting an ACK from the ARM SoC maintainers on this patch.

This patch on its own doesn't apply cleanly at all to arm-soc, I'm guessing
because I need the rest of the series. With the presumption that you're not
going to cause grief from sfr due to excessive conflicts. I.e. please try
merging with arm-soc for-next to see how bad it is:

patch 11-14:

Acked-by: Olof Johansson <olof@lixom.net>

If it's conflict-heavy, we'll stage a topic branch that we can both
pull in.  I'm guessing/hoping that won't be the case though.


-Olof

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

* Re: [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data
  2013-02-10  2:42   ` Olof Johansson
@ 2013-02-10 15:01     ` Linus Walleij
  0 siblings, 0 replies; 27+ messages in thread
From: Linus Walleij @ 2013-02-10 15:01 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Linus Walleij, linux-kernel, linux-arm-kernel, Stephen Warren,
	Anmar Oueja, Lee Jones, arm

On Sun, Feb 10, 2013 at 3:42 AM, Olof Johansson <olof@lixom.net> wrote:

> This patch on its own doesn't apply cleanly at all to arm-soc, I'm guessing
> because I need the rest of the series. With the presumption that you're not
> going to cause grief from sfr due to excessive conflicts. I.e. please try
> merging with arm-soc for-next to see how bad it is:

OK, there were bad conflicts with two device tree patches.

So I'm going to take that stuff out and funnel through ARM SoC
instead.

I have a number of DT patches from Lee on a queues pull request
anyway, so I'll just stack these on top of that and then hopefully things
will fix themselves up.

> patch 11-14:
> Acked-by: Olof Johansson <olof@lixom.net>

Thanks, I took only 11, 12 into the pinctrl tree. It's better off
like this.

Yours,
Linus Walleij

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

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

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-05 19:48 [PATCH 00/14] reform the ABx500 IRQ handling Linus Walleij
2013-02-05 19:48 ` [PATCH 01/14] mfd: ab8500: prepare to handle AB8500 GPIO's IRQs correctly Linus Walleij
2013-02-05 19:48 ` [PATCH 02/14] mfd: ab8500: provide a irq_set_type() function Linus Walleij
2013-02-07  0:07   ` Stephen Warren
     [not found]     ` <CAF2Aj3iO+6j+T5C0X2Hh6TsvT4yaJ2cai6cC9DaiRAwL9n-dVw@mail.gmail.com>
2013-02-07 10:01       ` Linus Walleij
2013-02-05 19:48 ` [PATCH 03/14] mfd: ab8500: ensure new AB8500 pinctrl driver is probed correctly Linus Walleij
2013-02-07  0:08   ` Stephen Warren
2013-02-05 19:48 ` [PATCH 04/14] mfd: ab8500: allow AB9540 based devices to use ABX500 pinctrl Linus Walleij
2013-02-05 19:48 ` [PATCH 05/14] pinctrl/abx500: prevent error path from corrupting returning error Linus Walleij
2013-02-05 19:48 ` [PATCH 06/14] pinctrl/abx500: align GPIO cluster boundaries Linus Walleij
2013-02-05 19:48 ` [PATCH 07/14] pinctrl/abx500: move IRQ handling to ab8500-core Linus Walleij
2013-02-05 19:48 ` [PATCH 08/14] pinctrl/abx500: replace IRQ offsets with table read-in values Linus Walleij
2013-02-05 19:48 ` [PATCH 09/14] pinctrl/abx500: use direct IRQ defines Linus Walleij
2013-02-07  0:13   ` Stephen Warren
     [not found]     ` <CAF2Aj3jHe+mP0dU_BHThBV-va_iJLcFQedmWQOTaYafAZM1Yxg@mail.gmail.com>
2013-02-07 17:59       ` Stephen Warren
2013-02-08  8:25         ` Lee Jones
2013-02-08 17:06           ` Stephen Warren
2013-02-07 19:10       ` Linus Walleij
2013-02-05 19:48 ` [PATCH 10/14] pinctrl/abx500: add Device Tree support Linus Walleij
2013-02-05 19:48 ` [PATCH 11/14] ARM: ux500: remove irq_base property from platform_data Linus Walleij
2013-02-10  2:42   ` Olof Johansson
2013-02-10 15:01     ` Linus Walleij
2013-02-05 19:48 ` [PATCH 12/14] ARM: ux500: use real AB8500 IRQ numbers instead of virtual ones Linus Walleij
2013-02-05 19:48 ` [PATCH 13/14] ARM: ux500: enable AB8500 GPIO for HREF Linus Walleij
2013-02-07  0:17   ` Stephen Warren
2013-02-07  8:30     ` Arnd Bergmann
2013-02-05 19:48 ` [PATCH 14/14] ARM: ux500: allow Snowball access to the AB8500 GPIO pins Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).