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 @@ | |||
1 | /* | 1 | /* |
2 | * Acer WMI Laptop Extras | 2 | * Acer WMI Laptop Extras |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk> | 4 | * Copyright (C) 2007-2009 Carlos Corbacho <carlos@strangeworlds.co.uk> |
5 | * | 5 | * |
6 | * Based on acer_acpi: | 6 | * Based on acer_acpi: |
7 | * Copyright (C) 2005-2007 E.M. Smith | 7 | * Copyright (C) 2005-2007 E.M. Smith |
@@ -225,6 +225,25 @@ static struct quirk_entry quirk_fujitsu_amilo_li_1718 = { | |||
225 | .wireless = 2, | 225 | .wireless = 2, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | /* The Aspire One has a dummy ACPI-WMI interface - disable it */ | ||
229 | static struct dmi_system_id __devinitdata acer_blacklist[] = { | ||
230 | { | ||
231 | .ident = "Acer Aspire One (SSD)", | ||
232 | .matches = { | ||
233 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
234 | DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"), | ||
235 | }, | ||
236 | }, | ||
237 | { | ||
238 | .ident = "Acer Aspire One (HDD)", | ||
239 | .matches = { | ||
240 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
241 | DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"), | ||
242 | }, | ||
243 | }, | ||
244 | {} | ||
245 | }; | ||
246 | |||
228 | static struct dmi_system_id acer_quirks[] = { | 247 | static struct dmi_system_id acer_quirks[] = { |
229 | { | 248 | { |
230 | .callback = dmi_matched, | 249 | .callback = dmi_matched, |
@@ -1117,11 +1136,17 @@ static int __devinit acer_platform_probe(struct platform_device *device) | |||
1117 | } | 1136 | } |
1118 | 1137 | ||
1119 | err = acer_rfkill_init(&device->dev); | 1138 | err = acer_rfkill_init(&device->dev); |
1139 | if (err) | ||
1140 | goto error_rfkill; | ||
1120 | 1141 | ||
1121 | return err; | 1142 | return err; |
1122 | 1143 | ||
1144 | error_rfkill: | ||
1145 | if (has_cap(ACER_CAP_BRIGHTNESS)) | ||
1146 | acer_backlight_exit(); | ||
1123 | error_brightness: | 1147 | error_brightness: |
1124 | acer_led_exit(); | 1148 | if (has_cap(ACER_CAP_MAILLED)) |
1149 | acer_led_exit(); | ||
1125 | error_mailled: | 1150 | error_mailled: |
1126 | return err; | 1151 | return err; |
1127 | } | 1152 | } |
@@ -1254,6 +1279,12 @@ static int __init acer_wmi_init(void) | |||
1254 | 1279 | ||
1255 | printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n"); | 1280 | printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n"); |
1256 | 1281 | ||
1282 | if (dmi_check_system(acer_blacklist)) { | ||
1283 | printk(ACER_INFO "Blacklisted hardware detected - " | ||
1284 | "not loading\n"); | ||
1285 | return -ENODEV; | ||
1286 | } | ||
1287 | |||
1257 | find_quirks(); | 1288 | find_quirks(); |
1258 | 1289 | ||
1259 | /* | 1290 | /* |
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"); | |||
53 | 53 | ||
54 | static int __init hp_wmi_bios_setup(struct platform_device *device); | 54 | static int __init hp_wmi_bios_setup(struct platform_device *device); |
55 | static int __exit hp_wmi_bios_remove(struct platform_device *device); | 55 | static int __exit hp_wmi_bios_remove(struct platform_device *device); |
56 | static int hp_wmi_resume_handler(struct platform_device *device); | ||
56 | 57 | ||
57 | struct bios_args { | 58 | struct bios_args { |
58 | u32 signature; | 59 | u32 signature; |
@@ -101,6 +102,7 @@ static struct platform_driver hp_wmi_driver = { | |||
101 | }, | 102 | }, |
102 | .probe = hp_wmi_bios_setup, | 103 | .probe = hp_wmi_bios_setup, |
103 | .remove = hp_wmi_bios_remove, | 104 | .remove = hp_wmi_bios_remove, |
105 | .resume = hp_wmi_resume_handler, | ||
104 | }; | 106 | }; |
105 | 107 | ||
106 | static int hp_wmi_perform_query(int query, int write, int value) | 108 | 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) | |||
487 | return 0; | 489 | return 0; |
488 | } | 490 | } |
489 | 491 | ||
492 | static int hp_wmi_resume_handler(struct platform_device *device) | ||
493 | { | ||
494 | struct key_entry *key; | ||
495 | |||
496 | /* | ||
497 | * Docking state may have changed while suspended, so trigger | ||
498 | * an input event for the current state. As this is a switch, | ||
499 | * the input layer will only actually pass it on if the state | ||
500 | * changed. | ||
501 | */ | ||
502 | for (key = hp_wmi_keymap; key->type != KE_END; key++) { | ||
503 | switch (key->type) { | ||
504 | case KE_SW: | ||
505 | input_report_switch(hp_wmi_input_dev, key->keycode, | ||
506 | hp_wmi_dock_state()); | ||
507 | input_sync(hp_wmi_input_dev); | ||
508 | break; | ||
509 | } | ||
510 | } | ||
511 | |||
512 | return 0; | ||
513 | } | ||
514 | |||
490 | static int __init hp_wmi_init(void) | 515 | static int __init hp_wmi_init(void) |
491 | { | 516 | { |
492 | int err; | 517 | 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"); | |||
57 | * In that case max_cstate would be n-1 | 57 | * In that case max_cstate would be n-1 |
58 | * GTHS returning '0' would mean that no bandwidth control states are supported | 58 | * GTHS returning '0' would mean that no bandwidth control states are supported |
59 | */ | 59 | */ |
60 | static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev, | 60 | static int memory_get_max_bandwidth(struct thermal_cooling_device *cdev, |
61 | unsigned long *max_state) | 61 | unsigned long *max_state) |
62 | { | 62 | { |
63 | struct acpi_device *device = cdev->devdata; | 63 | struct acpi_device *device = cdev->devdata; |
64 | acpi_handle handle = device->handle; | 64 | acpi_handle handle = device->handle; |
@@ -83,22 +83,12 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev, | |||
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | static int memory_get_max_bandwidth(struct thermal_cooling_device *cdev, | ||
87 | char *buf) | ||
88 | { | ||
89 | unsigned long value; | ||
90 | if (memory_get_int_max_bandwidth(cdev, &value)) | ||
91 | return -EINVAL; | ||
92 | |||
93 | return sprintf(buf, "%ld\n", value); | ||
94 | } | ||
95 | |||
96 | static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev, | 86 | static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev, |
97 | char *buf) | 87 | unsigned long *value) |
98 | { | 88 | { |
99 | struct acpi_device *device = cdev->devdata; | 89 | struct acpi_device *device = cdev->devdata; |
100 | acpi_handle handle = device->handle; | 90 | acpi_handle handle = device->handle; |
101 | unsigned long long value; | 91 | unsigned long long result; |
102 | struct acpi_object_list arg_list; | 92 | struct acpi_object_list arg_list; |
103 | union acpi_object arg; | 93 | union acpi_object arg; |
104 | acpi_status status = AE_OK; | 94 | acpi_status status = AE_OK; |
@@ -108,15 +98,16 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev, | |||
108 | arg.type = ACPI_TYPE_INTEGER; | 98 | arg.type = ACPI_TYPE_INTEGER; |
109 | arg.integer.value = MEMORY_ARG_CUR_BANDWIDTH; | 99 | arg.integer.value = MEMORY_ARG_CUR_BANDWIDTH; |
110 | status = acpi_evaluate_integer(handle, MEMORY_GET_BANDWIDTH, | 100 | status = acpi_evaluate_integer(handle, MEMORY_GET_BANDWIDTH, |
111 | &arg_list, &value); | 101 | &arg_list, &result); |
112 | if (ACPI_FAILURE(status)) | 102 | if (ACPI_FAILURE(status)) |
113 | return -EFAULT; | 103 | return -EFAULT; |
114 | 104 | ||
115 | return sprintf(buf, "%llu\n", value); | 105 | *value = result; |
106 | return 0; | ||
116 | } | 107 | } |
117 | 108 | ||
118 | static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, | 109 | static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, |
119 | unsigned int state) | 110 | unsigned long state) |
120 | { | 111 | { |
121 | struct acpi_device *device = cdev->devdata; | 112 | struct acpi_device *device = cdev->devdata; |
122 | acpi_handle handle = device->handle; | 113 | acpi_handle handle = device->handle; |
@@ -126,7 +117,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, | |||
126 | unsigned long long temp; | 117 | unsigned long long temp; |
127 | unsigned long max_state; | 118 | unsigned long max_state; |
128 | 119 | ||
129 | if (memory_get_int_max_bandwidth(cdev, &max_state)) | 120 | if (memory_get_max_bandwidth(cdev, &max_state)) |
130 | return -EFAULT; | 121 | return -EFAULT; |
131 | 122 | ||
132 | if (state > max_state) | 123 | if (state > max_state) |
@@ -142,7 +133,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, | |||
142 | &temp); | 133 | &temp); |
143 | 134 | ||
144 | printk(KERN_INFO | 135 | printk(KERN_INFO |
145 | "Bandwidth value was %d: status is %d\n", state, status); | 136 | "Bandwidth value was %ld: status is %d\n", state, status); |
146 | if (ACPI_FAILURE(status)) | 137 | if (ACPI_FAILURE(status)) |
147 | return -EFAULT; | 138 | return -EFAULT; |
148 | 139 | ||