Patch to fix asus_acpi on Samsung P30/P35

From: Hanno BÃck
Date: Mon Nov 28 2005 - 04:52:29 EST


For a while now asus_acpi is broken on samsung laptops (causes oopses on
module loading and kernel panic if compiled into the kernel).

The attached Patch (by Christian Aichinger, so credits to him) fixes this.
Please apply this before 2.6.15.

Patch:


diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1006,6 +1006,24 @@ static int __init asus_hotk_get_info(voi
}

model = (union acpi_object *)buffer.pointer;
+
+ /* INIT on Samsung's P35 returns an integer, possible return
+ * values are tested below */
+ if (model->type == ACPI_TYPE_INTEGER) {
+ if (model->integer.value == -1 ||
+ model->integer.value == 0x58 ||
+ model->integer.value == 0x38) {
+ hotk->model = P30;
+ printk(KERN_NOTICE
+ " Samsung P35 detected, supported\n");
+ goto out_known;
+ } else {
+ printk(KERN_WARNING
+ " unknown integer returned by INIT\n");
+ goto out_unknown;
+ }
+ }
+
if (model->type == ACPI_TYPE_STRING) {
printk(KERN_NOTICE " %s model detected, ",
model->string.pointer);
@@ -1057,9 +1075,7 @@ static int __init asus_hotk_get_info(voi
hotk->model = L5x;

if (hotk->model == END_MODEL) {
- printk("unsupported, trying default values, supply the "
- "developers with your DSDT\n");
- hotk->model = M2E;
+ goto out_unknown;
} else {
printk("supported\n");
}
@@ -1088,6 +1104,15 @@ static int __init asus_hotk_get_info(voi
acpi_os_free(model);

return AE_OK;
+
+out_unknown:
+ printk(KERN_WARNING " unsupported, trying default values, "
+ "supply the developers with your DSDT\n");
+ hotk->model = M2E;
+out_known:
+ hotk->methods = &model_conf[hotk->model];
+ acpi_os_free(model);
+ return AE_OK;
}

static int __init asus_hotk_check(void)

Attachment: pgp00000.pgp
Description: PGP signature