diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 35 | ||||
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 25 | ||||
-rw-r--r-- | drivers/platform/x86/intel_menlow.c | 29 |
3 files changed, 68 insertions, 21 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index a6a42e8c060b..0f6e43bf4fc2 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1,7 +1,7 @@ /* * Acer WMI Laptop Extras * - * Copyright (C) 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk> + * Copyright (C) 2007-2009 Carlos Corbacho <carlos@strangeworlds.co.uk> * * Based on acer_acpi: * Copyright (C) 2005-2007 E.M. Smith @@ -225,6 +225,25 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = { .wireless = 2, }; +/* The Aspire One has a dummy ACPI-WMI interface - disable it */ +static struct dmi_system_id __devinitdata acer_blacklist[] = { + { + .ident = "Acer Aspire One (SSD)", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), + }, + }, + { + .ident = "Acer Aspire One (HDD)", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"), + }, + }, + {} +}; + static struct dmi_system_id acer_quirks[] = { { .callback = dmi_matched, @@ -1117,11 +1136,17 @@ static int __devinit acer_platform_probe(struct platform_device *device) } err = acer_rfkill_init(&device->dev); + if (err) + goto error_rfkill; return err; +error_rfkill: + if (has_cap(ACER_CAP_BRIGHTNESS)) + acer_backlight_exit(); error_brightness: - acer_led_exit(); + if (has_cap(ACER_CAP_MAILLED)) + acer_led_exit(); error_mailled: return err; } @@ -1254,6 +1279,12 @@ static int __init acer_wmi_init(void) printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n"); + if (dmi_check_system(acer_blacklist)) { + printk(ACER_INFO "Blacklisted hardware detected - " + "not loading\n"); + return -ENODEV; + } + find_quirks(); /* diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index f41135f2fb29..50d9019de2be 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -53,6 +53,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); static int __init hp_wmi_bios_setup(struct platform_device *device); static int __exit hp_wmi_bios_remove(struct platform_device *device); +static int hp_wmi_resume_handler(struct platform_device *device); struct bios_args { u32 signature; @@ -101,6 +102,7 @@ static struct platform_driver hp_wmi_driver = { }, .probe = hp_wmi_bios_setup, .remove = hp_wmi_bios_remove, + .resume = hp_wmi_resume_handler, }; static int hp_wmi_perform_query(int query, int write, int value) @@ -487,6 +489,29 @@ static int __exit hp_wmi_bios_remove(struct platform_device *device) return 0; } +static int hp_wmi_resume_handler(struct platform_device *device) +{ + struct key_entry *key; + + /* + * Docking state may have changed while suspended, so trigger + * an input event for the current state. As this is a switch, + * the input layer will only actually pass it on if the state + * changed. + */ + for (key = hp_wmi_keymap; key->type != KE_END; key++) { + switch (key->type) { + case KE_SW: + input_report_switch(hp_wmi_input_dev, key->keycode, + hp_wmi_dock_state()); + input_sync(hp_wmi_input_dev); + break; + } + } + + return 0; +} + static int __init hp_wmi_init(void) { int err; diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c index 27b7662955bb..29432a50be45 100644 --- a/drivers/platform/x86/intel_menlow.c +++ b/drivers/platform/x86/intel_menlow.c @@ -57,8 +57,8 @@ MODULE_LICENSE("GPL"); * In that case max_cstate would be n-1 * GTHS returning '0' would mean that no bandwidth control states are supported */ -static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev, - unsigned long *max_state) +static int memory_get_max_bandwidth(struct thermal_cooling_device *cdev, + unsigned long *max_state) { struct acpi_device *device = cdev->devdata; acpi_handle handle = device->handle; @@ -83,22 +83,12 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev, return 0; } -static int memory_get_max_bandwidth(struct thermal_cooling_device *cdev, - char *buf) -{ - unsigned long value; - if (memory_get_int_max_bandwidth(cdev, &value)) - return -EINVAL; - - return sprintf(buf, "%ld\n", value); -} - static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev, - char *buf) + unsigned long *value) { struct acpi_device *device = cdev->devdata; acpi_handle handle = device->handle; - unsigned long long value; + unsigned long long result; struct acpi_object_list arg_list; union acpi_object arg; acpi_status status = AE_OK; @@ -108,15 +98,16 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev, arg.type = ACPI_TYPE_INTEGER; arg.integer.value = MEMORY_ARG_CUR_BANDWIDTH; status = acpi_evaluate_integer(handle, MEMORY_GET_BANDWIDTH, - &arg_list, &value); + &arg_list, &result); if (ACPI_FAILURE(status)) return -EFAULT; - return sprintf(buf, "%llu\n", value); + *value = result; + return 0; } static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, - unsigned int state) + unsigned long state) { struct acpi_device *device = cdev->devdata; acpi_handle handle = device->handle; @@ -126,7 +117,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, unsigned long long temp; unsigned long max_state; - if (memory_get_int_max_bandwidth(cdev, &max_state)) + if (memory_get_max_bandwidth(cdev, &max_state)) return -EFAULT; if (state > max_state) @@ -142,7 +133,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, &temp); printk(KERN_INFO - "Bandwidth value was %d: status is %d\n", state, status); + "Bandwidth value was %ld: status is %d\n", state, status); if (ACPI_FAILURE(status)) return -EFAULT; |