x86: platform: Move iris to x86/platform where it belongs
authorThomas Gleixner <tglx@linutronix.de>
Sat, 20 Nov 2010 09:37:05 +0000 (10:37 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 20 Nov 2010 09:37:05 +0000 (10:37 +0100)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/Makefile
arch/x86/kernel/iris.c [deleted file]
arch/x86/platform/Makefile
arch/x86/platform/iris/Makefile [new file with mode: 0644]
arch/x86/platform/iris/iris.c [new file with mode: 0644]

index beac17a0fcabea7fd2ba4a1a50c65f123e6dd9f9..9e13763b609242e0c5429a364be461a7e8fc2594 100644 (file)
@@ -109,7 +109,6 @@ obj-$(CONFIG_MICROCODE)                     += microcode.o
 obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o
 
 obj-$(CONFIG_SWIOTLB)                  += pci-swiotlb.o
-obj-$(CONFIG_X86_32_IRIS)              += iris.o
 
 ###
 # 64 bit specific files
diff --git a/arch/x86/kernel/iris.c b/arch/x86/kernel/iris.c
deleted file mode 100644 (file)
index 1ba7f5e..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Eurobraille/Iris power off support.
- *
- * Eurobraille's Iris machine is a PC with no APM or ACPI support.
- * It is shutdown by a special I/O sequence which this module provides.
- *
- *  Copyright (C) Shérab <Sebastien.Hinderer@ens-lyon.org>
- *
- * This program is free software ; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation ; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY ; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the program ; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/moduleparam.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
-#include <linux/init.h>
-#include <linux/pm.h>
-#include <asm/io.h>
-
-#define IRIS_GIO_BASE          0x340
-#define IRIS_GIO_INPUT         IRIS_GIO_BASE
-#define IRIS_GIO_OUTPUT                (IRIS_GIO_BASE + 1)
-#define IRIS_GIO_PULSE         0x80 /* First byte to send */
-#define IRIS_GIO_REST          0x00 /* Second byte to send */
-#define IRIS_GIO_NODEV         0xff /* Likely not an Iris */
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>");
-MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille");
-MODULE_SUPPORTED_DEVICE("Eurobraille/Iris");
-
-static int force;
-
-module_param(force, bool, 0);
-MODULE_PARM_DESC(force, "Set to one to force poweroff handler installation.");
-
-static void (*old_pm_power_off)(void);
-
-static void iris_power_off(void)
-{
-       outb(IRIS_GIO_PULSE, IRIS_GIO_OUTPUT);
-       msleep(850);
-       outb(IRIS_GIO_REST, IRIS_GIO_OUTPUT);
-}
-
-/*
- * Before installing the power_off handler, try to make sure the OS is
- * running on an Iris.  Since Iris does not support DMI, this is done
- * by reading its input port and seeing whether the read value is
- * meaningful.
- */
-static int iris_init(void)
-{
-       unsigned char status;
-       if (force != 1) {
-               printk(KERN_ERR "The force parameter has not been set to 1 so the Iris poweroff handler will not be installed.\n");
-               return -ENODEV;
-       }
-       status = inb(IRIS_GIO_INPUT);
-       if (status == IRIS_GIO_NODEV) {
-               printk(KERN_ERR "This machine does not seem to be an Iris. Power_off handler not installed.\n");
-               return -ENODEV;
-       }
-       old_pm_power_off = pm_power_off;
-       pm_power_off = &iris_power_off;
-       printk(KERN_INFO "Iris power_off handler installed.\n");
-
-       return 0;
-}
-
-static void iris_exit(void)
-{
-       pm_power_off = old_pm_power_off;
-       printk(KERN_INFO "Iris power_off handler uninstalled.\n");
-}
-
-module_init(iris_init);
-module_exit(iris_exit);
index a019bc3088a05cdc32cef82d0c98374c74026746..021eee91c0562503dbb68c5bea490674d9db8618 100644 (file)
@@ -1,6 +1,7 @@
 # Platform specific code goes here
 obj-y  += ce4100/
 obj-y  += efi/
+obj-y  += iris/
 obj-y  += mrst/
 obj-y  += olpc/
 obj-y  += scx200/
diff --git a/arch/x86/platform/iris/Makefile b/arch/x86/platform/iris/Makefile
new file mode 100644 (file)
index 0000000..db92198
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_X86_32_IRIS)              += iris.o
diff --git a/arch/x86/platform/iris/iris.c b/arch/x86/platform/iris/iris.c
new file mode 100644 (file)
index 0000000..1ba7f5e
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Eurobraille/Iris power off support.
+ *
+ * Eurobraille's Iris machine is a PC with no APM or ACPI support.
+ * It is shutdown by a special I/O sequence which this module provides.
+ *
+ *  Copyright (C) Shérab <Sebastien.Hinderer@ens-lyon.org>
+ *
+ * This program is free software ; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation ; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY ; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the program ; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/moduleparam.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/pm.h>
+#include <asm/io.h>
+
+#define IRIS_GIO_BASE          0x340
+#define IRIS_GIO_INPUT         IRIS_GIO_BASE
+#define IRIS_GIO_OUTPUT                (IRIS_GIO_BASE + 1)
+#define IRIS_GIO_PULSE         0x80 /* First byte to send */
+#define IRIS_GIO_REST          0x00 /* Second byte to send */
+#define IRIS_GIO_NODEV         0xff /* Likely not an Iris */
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>");
+MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille");
+MODULE_SUPPORTED_DEVICE("Eurobraille/Iris");
+
+static int force;
+
+module_param(force, bool, 0);
+MODULE_PARM_DESC(force, "Set to one to force poweroff handler installation.");
+
+static void (*old_pm_power_off)(void);
+
+static void iris_power_off(void)
+{
+       outb(IRIS_GIO_PULSE, IRIS_GIO_OUTPUT);
+       msleep(850);
+       outb(IRIS_GIO_REST, IRIS_GIO_OUTPUT);
+}
+
+/*
+ * Before installing the power_off handler, try to make sure the OS is
+ * running on an Iris.  Since Iris does not support DMI, this is done
+ * by reading its input port and seeing whether the read value is
+ * meaningful.
+ */
+static int iris_init(void)
+{
+       unsigned char status;
+       if (force != 1) {
+               printk(KERN_ERR "The force parameter has not been set to 1 so the Iris poweroff handler will not be installed.\n");
+               return -ENODEV;
+       }
+       status = inb(IRIS_GIO_INPUT);
+       if (status == IRIS_GIO_NODEV) {
+               printk(KERN_ERR "This machine does not seem to be an Iris. Power_off handler not installed.\n");
+               return -ENODEV;
+       }
+       old_pm_power_off = pm_power_off;
+       pm_power_off = &iris_power_off;
+       printk(KERN_INFO "Iris power_off handler installed.\n");
+
+       return 0;
+}
+
+static void iris_exit(void)
+{
+       pm_power_off = old_pm_power_off;
+       printk(KERN_INFO "Iris power_off handler uninstalled.\n");
+}
+
+module_init(iris_init);
+module_exit(iris_exit);