Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[linux-drm-fsl-dcu.git] / arch / sh / boards / mpc1211 / setup.c
index 8eb5d430397257f0884400a5e6abc2ee72d915ec..1a0604b23ce0f4bac86f65fa1e783d8e372cdb04 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/arch/sh/board/mpc1211/setup.c
+ * linux/arch/sh/boards/mpc1211/setup.c
  *
  * Copyright (C) 2002  Saito.K & Jeanne,  Fujii.Y
  *
@@ -10,6 +10,7 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/interrupt.h>
+#include <linux/platform_device.h>
 #include <asm/io.h>
 #include <asm/machvec.h>
 #include <asm/mpc1211/mpc1211.h>
@@ -69,7 +70,6 @@ static void __init pci_write_config(unsigned long busNo,
 
 static unsigned char m_irq_mask = 0xfb;
 static unsigned char s_irq_mask = 0xff;
-volatile unsigned long irq_err_count;
 
 static void disable_mpc1211_irq(unsigned int irq)
 {
@@ -118,7 +118,7 @@ static void mask_and_ack_mpc1211(unsigned int irq)
        if(irq < 8) {
                if(m_irq_mask & (1<<irq)){
                  if(!mpc1211_irq_real(irq)){
-                   irq_err_count++;
+                   atomic_inc(&irq_err_count)
                    printk("spurious 8259A interrupt: IRQ %x\n",irq);
                   }
                } else {
@@ -131,7 +131,7 @@ static void mask_and_ack_mpc1211(unsigned int irq)
        } else {
                if(s_irq_mask & (1<<(irq - 8))){
                  if(!mpc1211_irq_real(irq)){
-                   irq_err_count++;
+                   atomic_inc(&irq_err_count);
                    printk("spurious 8259A interrupt: IRQ %x\n",irq);
                  }
                } else {
@@ -282,6 +282,32 @@ static int put_smb_blk(unsigned char *p, int address, int command, int no)
        return 0;
 }
 
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = 0xa2000000,
+               .end    = 0xa2000000 + 8 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *mpc1211_devices[] __initdata = {
+       &heartbeat_device,
+};
+
+static int __init mpc1211_devices_setup(void)
+{
+       return platform_add_devices(mpc1211_devices,
+                                   ARRAY_SIZE(mpc1211_devices));
+}
+__initcall(mpc1211_devices_setup);
+
 /* arch/sh/boards/mpc1211/rtc.c */
 void mpc1211_time_init(void);
 
@@ -318,9 +344,5 @@ struct sh_machine_vector mv_mpc1211 __initmv = {
        .mv_nr_irqs             = 48,
        .mv_irq_demux           = mpc1211_irq_demux,
        .mv_init_irq            = init_mpc1211_IRQ,
-
-#ifdef CONFIG_HEARTBEAT
-       .mv_heartbeat           = heartbeat_mpc1211,
-#endif
 };
 ALIAS_MV(mpc1211)