diff options
Diffstat (limited to 'drivers/acpi/asus_acpi.c')
-rw-r--r-- | drivers/acpi/asus_acpi.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index fec895af6ae6..f4c87750dbf2 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -78,9 +78,9 @@ MODULE_LICENSE("GPL"); | |||
78 | static uid_t asus_uid; | 78 | static uid_t asus_uid; |
79 | static gid_t asus_gid; | 79 | static gid_t asus_gid; |
80 | module_param(asus_uid, uint, 0); | 80 | module_param(asus_uid, uint, 0); |
81 | MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n"); | 81 | MODULE_PARM_DESC(asus_uid, "UID for entries in /proc/acpi/asus.\n"); |
82 | module_param(asus_gid, uint, 0); | 82 | module_param(asus_gid, uint, 0); |
83 | MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n"); | 83 | MODULE_PARM_DESC(asus_gid, "GID for entries in /proc/acpi/asus.\n"); |
84 | 84 | ||
85 | /* For each model, all features implemented, | 85 | /* For each model, all features implemented, |
86 | * those marked with R are relative to HOTK, A for absolute */ | 86 | * those marked with R are relative to HOTK, A for absolute */ |
@@ -302,7 +302,7 @@ static struct model_data model_conf[END_MODEL] = { | |||
302 | .brightness_set = "SPLV", | 302 | .brightness_set = "SPLV", |
303 | .brightness_get = "GPLV", | 303 | .brightness_get = "GPLV", |
304 | .display_set = "SDSP", | 304 | .display_set = "SDSP", |
305 | .display_get = "\\SSTE"}, | 305 | .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"}, |
306 | { | 306 | { |
307 | .name = "M6R", | 307 | .name = "M6R", |
308 | .mt_mled = "MLED", | 308 | .mt_mled = "MLED", |
@@ -851,6 +851,8 @@ static int __init asus_hotk_add_fs(struct acpi_device *device) | |||
851 | mode = S_IFREG | S_IRUGO | S_IWUGO; | 851 | mode = S_IFREG | S_IRUGO | S_IWUGO; |
852 | } else { | 852 | } else { |
853 | mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; | 853 | mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; |
854 | printk(KERN_WARNING " asus_uid and asus_gid parameters are " | ||
855 | "deprecated, use chown and chmod instead!\n"); | ||
854 | } | 856 | } |
855 | 857 | ||
856 | acpi_device_dir(device) = asus_proc_dir; | 858 | acpi_device_dir(device) = asus_proc_dir; |
@@ -987,9 +989,21 @@ static int __init asus_hotk_get_info(void) | |||
987 | printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", | 989 | printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", |
988 | bsts_result); | 990 | bsts_result); |
989 | 991 | ||
990 | /* Samsung P30 has a device with a valid _HID whose INIT does not | 992 | /* This is unlikely with implicit return */ |
991 | * return anything. Catch this one and any similar here */ | 993 | if (buffer.pointer == NULL) |
992 | if (buffer.pointer == NULL) { | 994 | return -EINVAL; |
995 | |||
996 | model = (union acpi_object *) buffer.pointer; | ||
997 | /* | ||
998 | * Samsung P30 has a device with a valid _HID whose INIT does not | ||
999 | * return anything. It used to be possible to catch this exception, | ||
1000 | * but the implicit return code will now happily confuse the | ||
1001 | * driver. We assume that every ACPI_TYPE_STRING is a valid model | ||
1002 | * identifier but it's still possible to get completely bogus data. | ||
1003 | */ | ||
1004 | if (model->type == ACPI_TYPE_STRING) { | ||
1005 | printk(KERN_NOTICE " %s model detected, ", model->string.pointer); | ||
1006 | } else { | ||
993 | if (asus_info && /* Samsung P30 */ | 1007 | if (asus_info && /* Samsung P30 */ |
994 | strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) { | 1008 | strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) { |
995 | hotk->model = P30; | 1009 | hotk->model = P30; |
@@ -1002,13 +1016,10 @@ static int __init asus_hotk_get_info(void) | |||
1002 | "the developers with your DSDT\n"); | 1016 | "the developers with your DSDT\n"); |
1003 | } | 1017 | } |
1004 | hotk->methods = &model_conf[hotk->model]; | 1018 | hotk->methods = &model_conf[hotk->model]; |
1005 | return AE_OK; | 1019 | |
1006 | } | 1020 | acpi_os_free(model); |
1007 | 1021 | ||
1008 | model = (union acpi_object *)buffer.pointer; | 1022 | return AE_OK; |
1009 | if (model->type == ACPI_TYPE_STRING) { | ||
1010 | printk(KERN_NOTICE " %s model detected, ", | ||
1011 | model->string.pointer); | ||
1012 | } | 1023 | } |
1013 | 1024 | ||
1014 | hotk->model = END_MODEL; | 1025 | hotk->model = END_MODEL; |