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 25/28] powerpc: sysdev/uic irq_data conversion.
Date: Tue, 8 Mar 2011 01:00:16 +0100	[thread overview]
Message-ID: <20110308000015.GD16649@mail.wantstofly.org> (raw)
In-Reply-To: <cover.1299541392.git.buytenh@wantstofly.org>

Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
---
 arch/powerpc/sysdev/uic.c |   59 +++++++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 0038fb7..861fb99 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -55,11 +55,11 @@ struct uic {
 	struct irq_host	*irqhost;
 };
 
-static void uic_unmask_irq(unsigned int virq)
+static void uic_unmask_irq(struct irq_data *d)
 {
-	struct irq_desc *desc = irq_to_desc(virq);
-	struct uic *uic = get_irq_chip_data(virq);
-	unsigned int src = uic_irq_to_hw(virq);
+	struct irq_desc *desc = irq_to_desc(d->irq);
+	struct uic *uic = get_irq_chip_data(d->irq);
+	unsigned int src = uic_irq_to_hw(d->irq);
 	unsigned long flags;
 	u32 er, sr;
 
@@ -74,10 +74,10 @@ static void uic_unmask_irq(unsigned int virq)
 	spin_unlock_irqrestore(&uic->lock, flags);
 }
 
-static void uic_mask_irq(unsigned int virq)
+static void uic_mask_irq(struct irq_data *d)
 {
-	struct uic *uic = get_irq_chip_data(virq);
-	unsigned int src = uic_irq_to_hw(virq);
+	struct uic *uic = get_irq_chip_data(d->irq);
+	unsigned int src = uic_irq_to_hw(d->irq);
 	unsigned long flags;
 	u32 er;
 
@@ -88,10 +88,10 @@ static void uic_mask_irq(unsigned int virq)
 	spin_unlock_irqrestore(&uic->lock, flags);
 }
 
-static void uic_ack_irq(unsigned int virq)
+static void uic_ack_irq(struct irq_data *d)
 {
-	struct uic *uic = get_irq_chip_data(virq);
-	unsigned int src = uic_irq_to_hw(virq);
+	struct uic *uic = get_irq_chip_data(d->irq);
+	unsigned int src = uic_irq_to_hw(d->irq);
 	unsigned long flags;
 
 	spin_lock_irqsave(&uic->lock, flags);
@@ -99,11 +99,11 @@ static void uic_ack_irq(unsigned int virq)
 	spin_unlock_irqrestore(&uic->lock, flags);
 }
 
-static void uic_mask_ack_irq(unsigned int virq)
+static void uic_mask_ack_irq(struct irq_data *d)
 {
-	struct irq_desc *desc = irq_to_desc(virq);
-	struct uic *uic = get_irq_chip_data(virq);
-	unsigned int src = uic_irq_to_hw(virq);
+	struct irq_desc *desc = irq_to_desc(d->irq);
+	struct uic *uic = get_irq_chip_data(d->irq);
+	unsigned int src = uic_irq_to_hw(d->irq);
 	unsigned long flags;
 	u32 er, sr;
 
@@ -125,18 +125,18 @@ static void uic_mask_ack_irq(unsigned int virq)
 	spin_unlock_irqrestore(&uic->lock, flags);
 }
 
-static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
+static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
 {
-	struct uic *uic = get_irq_chip_data(virq);
-	unsigned int src = uic_irq_to_hw(virq);
-	struct irq_desc *desc = irq_to_desc(virq);
+	struct uic *uic = get_irq_chip_data(d->irq);
+	unsigned int src = uic_irq_to_hw(d->irq);
+	struct irq_desc *desc = irq_to_desc(d->irq);
 	unsigned long flags;
 	int trigger, polarity;
 	u32 tr, pr, mask;
 
 	switch (flow_type & IRQ_TYPE_SENSE_MASK) {
 	case IRQ_TYPE_NONE:
-		uic_mask_irq(virq);
+		uic_mask_irq(d);
 		return 0;
 
 	case IRQ_TYPE_EDGE_RISING:
@@ -178,11 +178,11 @@ static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
 
 static struct irq_chip uic_irq_chip = {
 	.name		= "UIC",
-	.unmask		= uic_unmask_irq,
-	.mask		= uic_mask_irq,
- 	.mask_ack	= uic_mask_ack_irq,
-	.ack		= uic_ack_irq,
-	.set_type	= uic_set_irq_type,
+	.irq_unmask	= uic_unmask_irq,
+	.irq_mask	= uic_mask_irq,
+	.irq_mask_ack	= uic_mask_ack_irq,
+	.irq_ack	= uic_ack_irq,
+	.irq_set_type	= uic_set_irq_type,
 };
 
 static int uic_host_map(struct irq_host *h, unsigned int virq,
@@ -220,6 +220,7 @@ static struct irq_host_ops uic_host_ops = {
 
 void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
 {
+	struct irq_chip *chip = get_irq_desc_chip(desc);
 	struct uic *uic = get_irq_data(virq);
 	u32 msr;
 	int src;
@@ -227,9 +228,9 @@ void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
 
 	raw_spin_lock(&desc->lock);
 	if (desc->status & IRQ_LEVEL)
-		desc->chip->mask(virq);
+		chip->irq_mask(&desc->irq_data);
 	else
-		desc->chip->mask_ack(virq);
+		chip->irq_mask_ack(&desc->irq_data);
 	raw_spin_unlock(&desc->lock);
 
 	msr = mfdcr(uic->dcrbase + UIC_MSR);
@@ -244,9 +245,9 @@ void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
 uic_irq_ret:
 	raw_spin_lock(&desc->lock);
 	if (desc->status & IRQ_LEVEL)
-		desc->chip->ack(virq);
-	if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
-		desc->chip->unmask(virq);
+		chip->irq_ack(&desc->irq_data);
+	if (!(desc->status & IRQ_DISABLED) && chip->irq_unmask)
+		chip->irq_unmask(&desc->irq_data);
 	raw_spin_unlock(&desc->lock);
 }
 
-- 
1.7.4

  parent reply	other threads:[~2011-03-08  0:00 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 ` [PATCH 12/28] powerpc: platforms/powermac " Lennert Buytenhek
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 ` Lennert Buytenhek [this message]
2011-03-09  8:27   ` [PATCH v2 25/28] powerpc: sysdev/uic " 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=20110308000015.GD16649@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).