linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Lennert Buytenhek <buytenh@wantstofly.org>
To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 12/28] powerpc: platforms/powermac irq_data conversion.
Date: Tue, 8 Mar 2011 00:59:40 +0100	[thread overview]
Message-ID: <20110307235940.GQ16649@mail.wantstofly.org> (raw)
In-Reply-To: <cover.1299541392.git.buytenh@wantstofly.org>

Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
---
 arch/powerpc/platforms/powermac/pic.c |   48 +++++++++++++++++---------------
 1 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 890d5f7..c55812b 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -82,9 +82,9 @@ static void __pmac_retrigger(unsigned int irq_nr)
 	}
 }
 
-static void pmac_mask_and_ack_irq(unsigned int virq)
+static void pmac_mask_and_ack_irq(struct irq_data *d)
 {
-	unsigned int src = irq_map[virq].hwirq;
+	unsigned int src = irq_map[d->irq].hwirq;
         unsigned long bit = 1UL << (src & 0x1f);
         int i = src >> 5;
         unsigned long flags;
@@ -104,9 +104,9 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
 	raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static void pmac_ack_irq(unsigned int virq)
+static void pmac_ack_irq(struct irq_data *d)
 {
-	unsigned int src = irq_map[virq].hwirq;
+	unsigned int src = irq_map[d->irq].hwirq;
         unsigned long bit = 1UL << (src & 0x1f);
         int i = src >> 5;
         unsigned long flags;
@@ -149,15 +149,15 @@ static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
 /* When an irq gets requested for the first client, if it's an
  * edge interrupt, we clear any previous one on the controller
  */
-static unsigned int pmac_startup_irq(unsigned int virq)
+static unsigned int pmac_startup_irq(struct irq_data *d)
 {
 	unsigned long flags;
-	unsigned int src = irq_map[virq].hwirq;
+	unsigned int src = irq_map[d->irq].hwirq;
         unsigned long bit = 1UL << (src & 0x1f);
         int i = src >> 5;
 
 	raw_spin_lock_irqsave(&pmac_pic_lock, flags);
-	if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0)
+	if ((irq_to_desc(d->irq)->status & IRQ_LEVEL) == 0)
 		out_le32(&pmac_irq_hw[i]->ack, bit);
         __set_bit(src, ppc_cached_irq_mask);
         __pmac_set_irq_mask(src, 0);
@@ -166,10 +166,10 @@ static unsigned int pmac_startup_irq(unsigned int virq)
 	return 0;
 }
 
-static void pmac_mask_irq(unsigned int virq)
+static void pmac_mask_irq(struct irq_data *d)
 {
 	unsigned long flags;
-	unsigned int src = irq_map[virq].hwirq;
+	unsigned int src = irq_map[d->irq].hwirq;
 
 	raw_spin_lock_irqsave(&pmac_pic_lock, flags);
         __clear_bit(src, ppc_cached_irq_mask);
@@ -177,10 +177,10 @@ static void pmac_mask_irq(unsigned int virq)
 	raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static void pmac_unmask_irq(unsigned int virq)
+static void pmac_unmask_irq(struct irq_data *d)
 {
 	unsigned long flags;
-	unsigned int src = irq_map[virq].hwirq;
+	unsigned int src = irq_map[d->irq].hwirq;
 
 	raw_spin_lock_irqsave(&pmac_pic_lock, flags);
 	__set_bit(src, ppc_cached_irq_mask);
@@ -188,24 +188,24 @@ static void pmac_unmask_irq(unsigned int virq)
 	raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static int pmac_retrigger(unsigned int virq)
+static int pmac_retrigger(struct irq_data *d)
 {
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&pmac_pic_lock, flags);
-	__pmac_retrigger(irq_map[virq].hwirq);
+	__pmac_retrigger(irq_map[d->irq].hwirq);
 	raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
 	return 1;
 }
 
 static struct irq_chip pmac_pic = {
 	.name		= "PMAC-PIC",
-	.startup	= pmac_startup_irq,
-	.mask		= pmac_mask_irq,
-	.ack		= pmac_ack_irq,
-	.mask_ack	= pmac_mask_and_ack_irq,
-	.unmask		= pmac_unmask_irq,
-	.retrigger	= pmac_retrigger,
+	.irq_startup	= pmac_startup_irq,
+	.irq_mask	= pmac_mask_irq,
+	.irq_ack	= pmac_ack_irq,
+	.irq_mask_ack	= pmac_mask_and_ack_irq,
+	.irq_unmask	= pmac_unmask_irq,
+	.irq_retrigger	= pmac_retrigger,
 };
 
 static irqreturn_t gatwick_action(int cpl, void *dev_id)
@@ -472,12 +472,14 @@ int of_irq_map_oldworld(struct device_node *device, int index,
 
 static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc)
 {
-	struct mpic *mpic = desc->handler_data;
-
+	struct irq_chip *chip = get_irq_desc_chip(desc);
+	struct mpic *mpic = get_irq_desc_data(desc);
 	unsigned int cascade_irq = mpic_get_one_irq(mpic);
+
 	if (cascade_irq != NO_IRQ)
 		generic_handle_irq(cascade_irq);
-	desc->chip->eoi(irq);
+
+	chip->irq_eoi(&desc->irq_data);
 }
 
 static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
@@ -707,7 +709,7 @@ static int pmacpic_resume(struct sys_device *sysdev)
 	mb();
 	for (i = 0; i < max_real_irqs; ++i)
 		if (test_bit(i, sleep_save_mask))
-			pmac_unmask_irq(i);
+			pmac_unmask_irq(irq_get_irq_data(i));
 
 	return 0;
 }
-- 
1.7.4

  parent reply	other threads:[~2011-03-07 23:59 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1299541392.git.buytenh@wantstofly.org>
2011-03-07 23:59 ` [PATCH 01/28] powerpc: mpic irq_data conversion Lennert Buytenhek
2011-03-08  4:13   ` Grant Likely
2011-03-08  4:51     ` Benjamin Herrenschmidt
2011-03-09  3:22   ` Benjamin Herrenschmidt
2011-03-09  7:33     ` Lennert Buytenhek
2011-03-09  7:51       ` Benjamin Herrenschmidt
2011-03-09  8:26         ` Lennert Buytenhek
2011-03-09  8:26   ` [PATCH v2 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 02/28] powerpc: platforms/512x " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 03/28] powerpc: platforms/52xx " Lennert Buytenhek
2011-03-09  8:26   ` [PATCH v2 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 04/28] powerpc: platforms/82xx " Lennert Buytenhek
2011-03-09  8:26   ` [PATCH v2 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 05/28] powerpc: platforms/85xx " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 06/28] powerpc: platforms/86xx " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 07/28] powerpc: platforms/8xx " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 08/28] powerpc: platforms/cell " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 09/28] powerpc: platforms/chrp " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 10/28] powerpc: platforms/embedded6xx " Lennert Buytenhek
2011-03-09  8:26   ` [PATCH v2 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 11/28] powerpc: platforms/iseries " Lennert Buytenhek
2011-03-07 23:59 ` Lennert Buytenhek [this message]
2011-03-07 23:59 ` [PATCH 13/28] powerpc: platforms/ps3 " Lennert Buytenhek
2011-03-09  8:26   ` [PATCH v2 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 14/28] powerpc: platforms/pseries " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 15/28] powerpc: sysdev/cpm1 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 16/28] powerpc: sysdev/cpm2_pic " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 17/28] powerpc: sysdev/fsl_msi " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 18/28] powerpc: sysdev/i8259 " Lennert Buytenhek
2011-03-07 23:59 ` [PATCH 19/28] powerpc: sysdev/ipic " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 20/28] powerpc: sysdev/mpc8xx_pic " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 21/28] powerpc: sysdev/mpc8xxx_gpio " Lennert Buytenhek
2011-03-09  8:26   ` [PATCH v2 " Lennert Buytenhek
2011-03-16 21:25     ` Peter Korsgaard
2011-03-08  0:00 ` [PATCH 22/28] powerpc: sysdev/mv64x60_pic " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 23/28] powerpc: sysdev/qe_lib/qe_ic " Lennert Buytenhek
2011-03-09  8:27   ` [PATCH v2 " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 24/28] powerpc: sysdev/tsi108_pci " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 25/28] powerpc: sysdev/uic " Lennert Buytenhek
2011-03-09  8:27   ` [PATCH v2 " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 26/28] powerpc: sysdev/xilinx_intc " Lennert Buytenhek
2011-03-09  8:27   ` [PATCH v2 " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 27/28] powerpc: core " Lennert Buytenhek
2011-03-08  0:00 ` [PATCH 28/28] powerpc: Enable GENERIC_HARDIRQS_NO_DEPRECATED Lennert Buytenhek
2011-03-08  4:38   ` Grant Likely
2011-03-08  4:48     ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110307235940.GQ16649@mail.wantstofly.org \
    --to=buytenh@wantstofly.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).