]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/osl.c
ACPI: Enable MSR (FixedHW) support for T-States
[linux-2.6-omap-h63xx.git] / drivers / acpi / osl.c
index 00d53c2fd1e823bbf088863d3ae6577ef1da0606..e3a673a008453dfda694aab503dad0c89b19cb1e 100644 (file)
@@ -77,13 +77,7 @@ static struct workqueue_struct *kacpi_notify_wq;
 #define        OSI_STRING_LENGTH_MAX 64        /* arbitrary */
 static char osi_additional_string[OSI_STRING_LENGTH_MAX];
 
-#define OSI_LINUX_ENABLED
-#ifdef OSI_LINUX_ENABLED
-int osi_linux = 1;     /* enable _OSI(Linux) by default */
-#else
-int osi_linux;         /* disable _OSI(Linux) by default */
-#endif
-
+static int osi_linux;          /* disable _OSI(Linux) by default */
 
 #ifdef CONFIG_DMI
 static struct __initdata dmi_system_id acpi_osl_dmi_table[];
@@ -393,17 +387,14 @@ acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width)
        if (!value)
                value = &dummy;
 
-       switch (width) {
-       case 8:
+       *value = 0;
+       if (width <= 8) {
                *(u8 *) value = inb(port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                *(u16 *) value = inw(port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                *(u32 *) value = inl(port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
@@ -414,17 +405,13 @@ EXPORT_SYMBOL(acpi_os_read_port);
 
 acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
 {
-       switch (width) {
-       case 8:
+       if (width <= 8) {
                outb(value, port);
-               break;
-       case 16:
+       } else if (width <= 16) {
                outw(value, port);
-               break;
-       case 32:
+       } else if (width <= 32) {
                outl(value, port);
-               break;
-       default:
+       } else {
                BUG();
        }
 
@@ -1048,14 +1035,6 @@ static int __init acpi_wake_gpes_always_on_setup(char *str)
 
 __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
 
-/*
- * max_cstate is defined in the base kernel so modules can
- * change it w/o depending on the state of the processor module.
- */
-unsigned int max_cstate = ACPI_PROCESSOR_MAX_POWER;
-
-EXPORT_SYMBOL(max_cstate);
-
 /*
  * Acquire a spinlock.
  *
@@ -1183,17 +1162,10 @@ acpi_os_validate_interface (char *interface)
        if (!strcmp("Linux", interface)) {
                printk(KERN_WARNING PREFIX
                        "System BIOS is requesting _OSI(Linux)\n");
-#ifdef OSI_LINUX_ENABLED
-               printk(KERN_WARNING PREFIX
-                       "Please test with \"acpi_osi=!Linux\"\n"
-                       "Please send dmidecode "
-                       "to linux-acpi@vger.kernel.org\n");
-#else
                printk(KERN_WARNING PREFIX
                        "If \"acpi_osi=Linux\" works better,\n"
                        "Please send dmidecode "
                        "to linux-acpi@vger.kernel.org\n");
-#endif
                if(osi_linux)
                        return AE_OK;
        }
@@ -1227,36 +1199,14 @@ acpi_os_validate_address (
 }
 
 #ifdef CONFIG_DMI
-#ifdef OSI_LINUX_ENABLED
-static int dmi_osi_not_linux(struct dmi_system_id *d)
+static int dmi_osi_linux(const struct dmi_system_id *d)
 {
-       printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident);
-       enable_osi_linux(0);
-       return 0;
-}
-#else
-static int dmi_osi_linux(struct dmi_system_id *d)
-{
-       printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident);
+       printk(KERN_NOTICE "%s detected: enabling _OSI(Linux)\n", d->ident);
        enable_osi_linux(1);
        return 0;
 }
-#endif
 
 static struct dmi_system_id acpi_osl_dmi_table[] __initdata = {
-#ifdef OSI_LINUX_ENABLED
-       /*
-        * Boxes that need NOT _OSI(Linux)
-        */
-       {
-        .callback = dmi_osi_not_linux,
-        .ident = "Toshiba Satellite P100",
-        .matches = {
-                    DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"),
-                    DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"),
-                    },
-        },
-#else
        /*
         * Boxes that need _OSI(Linux)
         */
@@ -1268,7 +1218,6 @@ static struct dmi_system_id acpi_osl_dmi_table[] __initdata = {
                     DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"),
                     },
         },
-#endif
        {}
 };
 #endif /* CONFIG_DMI */