public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: convert dreamcast irq code to ctrl_in/out
Date: Wed, 20 Feb 2008 11:03:36 +0000	[thread overview]
Message-ID: <20080220110336.7583.79505.sendpatchset@clockwork.opensource.se> (raw)

This patch converts the dreamcast irq code to ctrl_in/out operations. There
is no point in depending on the value of generic_io_base for code like this.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
---

 arch/sh/boards/dreamcast/irq.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

--- 0001/arch/sh/boards/dreamcast/irq.c
+++ work/arch/sh/boards/dreamcast/irq.c	2008-02-18 17:02:08.000000000 +0900
@@ -12,6 +12,7 @@
 #include <linux/irq.h>
 #include <asm/io.h>
 #include <asm/irq.h>
+#include <asm/addrspace.h>
 #include <asm/dreamcast/sysasic.h>
 
 /* Dreamcast System ASIC Hardware Events -
@@ -40,8 +41,8 @@
 
 */
 
-#define ESR_BASE 0x005f6900    /* Base event status register */
-#define EMR_BASE 0x005f6910    /* Base event mask register */
+#define ESR_BASE P2SEGADDR(0x005f6900)    /* Base event status register */
+#define EMR_BASE P2SEGADDR(0x005f6910)    /* Base event mask register */
 
 /* Helps us determine the EMR group that this event belongs to: 0 = 0x6910,
    1 = 0x6920, 2 = 0x6930; also determine the event offset */
@@ -59,9 +60,9 @@ static inline void disable_systemasic_ir
         __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
         __u32 mask;
 
-        mask = inl(emr);
+        mask = ctrl_inl(emr);
         mask &= ~(1 << EVENT_BIT(irq));
-        outl(mask, emr);
+        ctrl_outl(mask, emr);
 }
 
 /* Enable the hardware event by setting its bit in its EMR */
@@ -70,9 +71,9 @@ static inline void enable_systemasic_irq
         __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
         __u32 mask;
 
-        mask = inl(emr);
+        mask = ctrl_inl(emr);
         mask |= (1 << EVENT_BIT(irq));
-        outl(mask, emr);
+        ctrl_outl(mask, emr);
 }
 
 /* Acknowledge a hardware event by writing its bit back to its ESR */
@@ -80,7 +81,7 @@ static void ack_systemasic_irq(unsigned 
 {
         __u32 esr = ESR_BASE + (LEVEL(irq) << 2);
         disable_systemasic_irq(irq);
-        outl((1 << EVENT_BIT(irq)), esr);
+        ctrl_outl((1 << EVENT_BIT(irq)), esr);
 }
 
 /* After a IRQ has been ack'd and responded to, it needs to be renabled */
@@ -137,8 +138,8 @@ int systemasic_irq_demux(int irq)
         esr = ESR_BASE + (level << 2);
 
         /* Mask the ESR to filter any spurious, unwanted interrupts */
-        status = inl(esr);
-        status &= inl(emr);
+        status = ctrl_inl(esr);
+        status &= ctrl_inl(emr);
 
         /* Now scan and find the first set bit as the event to map */
         for (bit = 1, j = 0; j < 32; bit <<= 1, j++) {

             reply	other threads:[~2008-02-20 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 11:03 Magnus Damm [this message]
2008-02-26  5:24 ` [PATCH] sh: convert dreamcast irq code to ctrl_in/out Paul Mundt

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=20080220110336.7583.79505.sendpatchset@clockwork.opensource.se \
    --to=magnus.damm@gmail.com \
    --cc=linux-sh@vger.kernel.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