]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/acpi/bus.c
ACPI: introduce drivers/acpi/debugfs.c
[net-next-2.6.git] / drivers / acpi / bus.c
index 743576bf1bd79e5e7b8c6fc10bafb674d88c8803..7136f24e3002c361c804ca57ee76219409c43119 100644 (file)
@@ -69,6 +69,44 @@ static struct dmi_system_id __cpuinitdata power_nocheck_dmi_table[] = {
 };
 
 
+#ifdef CONFIG_X86
+static int set_copy_dsdt(const struct dmi_system_id *id)
+{
+       printk(KERN_NOTICE "%s detected - "
+               "force copy of DSDT to local memory\n", id->ident);
+       acpi_gbl_copy_dsdt_locally = 1;
+       return 0;
+}
+
+static struct dmi_system_id dsdt_dmi_table[] __initdata = {
+       /*
+        * Insyde BIOS on some TOSHIBA machines corrupt the DSDT.
+        * https://bugzilla.kernel.org/show_bug.cgi?id=14679
+        */
+       {
+        .callback = set_copy_dsdt,
+        .ident = "TOSHIBA Satellite A505",
+        .matches = {
+               DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+               DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"),
+               },
+       },
+       {
+        .callback = set_copy_dsdt,
+        .ident = "TOSHIBA Satellite L505D",
+        .matches = {
+               DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+               DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"),
+               },
+       },
+       {}
+};
+#else
+static struct dmi_system_id dsdt_dmi_table[] __initdata = {
+       {}
+};
+#endif
+
 /* --------------------------------------------------------------------------
                                 Device Management
    -------------------------------------------------------------------------- */
@@ -363,11 +401,6 @@ static void acpi_print_osc_error(acpi_handle handle,
        printk("\n");
 }
 
-static u8 hex_val(unsigned char c)
-{
-       return isdigit(c) ? c - '0' : toupper(c) - 'A' + 10;
-}
-
 static acpi_status acpi_str_to_uuid(char *str, u8 *uuid)
 {
        int i;
@@ -384,8 +417,8 @@ static acpi_status acpi_str_to_uuid(char *str, u8 *uuid)
                        return AE_BAD_PARAMETER;
        }
        for (i = 0; i < 16; i++) {
-               uuid[i] = hex_val(str[opc_map_to_uuid[i]]) << 4;
-               uuid[i] |= hex_val(str[opc_map_to_uuid[i] + 1]);
+               uuid[i] = hex_to_bin(str[opc_map_to_uuid[i]]) << 4;
+               uuid[i] |= hex_to_bin(str[opc_map_to_uuid[i] + 1]);
        }
        return AE_OK;
 }
@@ -813,6 +846,12 @@ void __init acpi_early_init(void)
 
        acpi_gbl_permanent_mmap = 1;
 
+       /*
+        * If the machine falls into the DMI check table,
+        * DSDT will be copied to memory
+        */
+       dmi_check_system(dsdt_dmi_table);
+
        status = acpi_reallocate_root_table();
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR PREFIX
@@ -997,6 +1036,7 @@ static int __init acpi_init(void)
        acpi_power_init();
        acpi_system_init();
        acpi_debug_init();
+       acpi_debugfs_init();
        acpi_sleep_proc_init();
        acpi_wakeup_device_init();
        return result;