Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
[sfrench/cifs-2.6.git] / arch / sh / boards / se / 770x / setup.c
index f3f82b7c821740b22849caadb665d82330fdca0c..45cbc36b9fb70780e820cba14f05e6ec1b5164f8 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: setup.c,v 1.1.2.4 2002/03/02 21:57:07 lethal Exp $
- *
+/*
  * linux/arch/sh/boards/se/770x/setup.c
  *
  * Copyright (C) 2000  Kazumoto Kojima
@@ -8,15 +7,12 @@
  *
  */
 #include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/hdreg.h>
-#include <linux/ide.h>
-#include <asm/io.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
 #include <asm/se.h>
+#include <asm/io.h>
 #include <asm/smc37c93x.h>
-#include <asm/machvec.h>
 
-void heartbeat_se(void);
 void init_se_IRQ(void);
 
 /*
@@ -39,11 +35,6 @@ static void __init smsc_setup(char **cmdline_p)
        smsc_config(ACTIVATE_INDEX, 0x01);
        smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
 
-       /* IDE1 */
-       smsc_config(CURRENT_LDN_INDEX, LDN_IDE1);
-       smsc_config(ACTIVATE_INDEX, 0x01);
-       smsc_config(IRQ_SELECT_INDEX, 14); /* IRQ14 */
-
        /* AUXIO (GPIO): to use IDE1 */
        smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
        smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
@@ -72,6 +63,36 @@ static void __init smsc_setup(char **cmdline_p)
        outb_p(CONFIG_EXIT, CONFIG_PORT);
 }
 
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = heartbeat_bit_pos,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct platform_device *se_devices[] __initdata = {
+       &heartbeat_device,
+};
+
+static int __init se_devices_setup(void)
+{
+       return platform_add_devices(se_devices, ARRAY_SIZE(se_devices));
+}
+__initcall(se_devices_setup);
+
 /*
  * The Machine Vector
  */
@@ -110,8 +131,5 @@ struct sh_machine_vector mv_se __initmv = {
        .mv_outsl               = se_outsl,
 
        .mv_init_irq            = init_se_IRQ,
-#ifdef CONFIG_HEARTBEAT
-       .mv_heartbeat           = heartbeat_se,
-#endif
 };
 ALIAS_MV(se)