Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117288
b: refs/heads/master
c: 955ba39
h: refs/heads/master
v: v3
  • Loading branch information
Len Brown committed Oct 23, 2008
1 parent a176fa2 commit 85a3af2
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 128 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 383d7a11c9989205db44c7f1be339e5097062f03
refs/heads/master: 955ba395616a78780e70dc3f3b0b56ca4db52e5c
28 changes: 4 additions & 24 deletions trunk/Documentation/laptops/acer-wmi.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Acer Laptop WMI Extras Driver
http://code.google.com/p/aceracpi
Version 0.1
9th February 2008
Version 0.2
18th August 2008

Copyright 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk>

Expand Down Expand Up @@ -87,17 +87,7 @@ acer-wmi come with built-in wireless. However, should you feel so inclined to
ever wish to remove the card, or swap it out at some point, please get in touch
with me, as we may well be able to gain some data on wireless card detection.

To read the status of the wireless radio (0=off, 1=on):
cat /sys/devices/platform/acer-wmi/wireless

To enable the wireless radio:
echo 1 > /sys/devices/platform/acer-wmi/wireless

To disable the wireless radio:
echo 0 > /sys/devices/platform/acer-wmi/wireless

To set the state of the wireless radio when loading acer-wmi, pass:
wireless=X (where X is 0 or 1)
The wireless radio is exposed through rfkill.

Bluetooth
*********
Expand All @@ -117,17 +107,7 @@ For the adventurously minded - if you want to buy an internal bluetooth
module off the internet that is compatible with your laptop and fit it, then
it will work just fine with acer-wmi.

To read the status of the bluetooth module (0=off, 1=on):
cat /sys/devices/platform/acer-wmi/wireless

To enable the bluetooth module:
echo 1 > /sys/devices/platform/acer-wmi/bluetooth

To disable the bluetooth module:
echo 0 > /sys/devices/platform/acer-wmi/bluetooth

To set the state of the bluetooth module when loading acer-wmi, pass:
bluetooth=X (where X is 0 or 1)
Bluetooth is exposed through rfkill.

3G
**
Expand Down
42 changes: 24 additions & 18 deletions trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#endif

#define PFX "powernow-k8: "
#define BFX PFX "BIOS error: "
#define VERSION "version 2.20.00"
#include "powernow-k8.h"

Expand Down Expand Up @@ -536,35 +535,40 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8

for (j = 0; j < data->numps; j++) {
if (pst[j].vid > LEAST_VID) {
printk(KERN_ERR PFX "vid %d invalid : 0x%x\n", j, pst[j].vid);
printk(KERN_ERR FW_BUG PFX "vid %d invalid : 0x%x\n",
j, pst[j].vid);
return -EINVAL;
}
if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */
printk(KERN_ERR BFX "0 vid exceeded with pstate %d\n", j);
printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate"
" %d\n", j);
return -ENODEV;
}
if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */
printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j);
printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate"
" %d\n", j);
return -ENODEV;
}
if (pst[j].fid > MAX_FID) {
printk(KERN_ERR BFX "maxfid exceeded with pstate %d\n", j);
printk(KERN_ERR FW_BUG PFX "maxfid exceeded with pstate"
" %d\n", j);
return -ENODEV;
}
if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) {
/* Only first fid is allowed to be in "low" range */
printk(KERN_ERR BFX "two low fids - %d : 0x%x\n", j, pst[j].fid);
printk(KERN_ERR FW_BUG PFX "two low fids - %d : "
"0x%x\n", j, pst[j].fid);
return -EINVAL;
}
if (pst[j].fid < lastfid)
lastfid = pst[j].fid;
}
if (lastfid & 1) {
printk(KERN_ERR BFX "lastfid invalid\n");
printk(KERN_ERR FW_BUG PFX "lastfid invalid\n");
return -EINVAL;
}
if (lastfid > LO_FID_TABLE_TOP)
printk(KERN_INFO BFX "first fid not from lo freq table\n");
printk(KERN_INFO FW_BUG PFX "first fid not from lo freq table\n");

return 0;
}
Expand Down Expand Up @@ -672,13 +676,13 @@ static int find_psb_table(struct powernow_k8_data *data)

dprintk("table vers: 0x%x\n", psb->tableversion);
if (psb->tableversion != PSB_VERSION_1_4) {
printk(KERN_ERR BFX "PSB table is not v1.4\n");
printk(KERN_ERR FW_BUG PFX "PSB table is not v1.4\n");
return -ENODEV;
}

dprintk("flags: 0x%x\n", psb->flags1);
if (psb->flags1) {
printk(KERN_ERR BFX "unknown flags\n");
printk(KERN_ERR FW_BUG PFX "unknown flags\n");
return -ENODEV;
}

Expand All @@ -705,7 +709,7 @@ static int find_psb_table(struct powernow_k8_data *data)
}
}
if (cpst != 1) {
printk(KERN_ERR BFX "numpst must be 1\n");
printk(KERN_ERR FW_BUG PFX "numpst must be 1\n");
return -ENODEV;
}

Expand Down Expand Up @@ -1130,17 +1134,19 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
"ACPI Processor module before starting this "
"driver.\n");
#else
printk(KERN_ERR PFX "Your BIOS does not provide ACPI "
"_PSS objects in a way that Linux understands. "
"Please report this to the Linux ACPI maintainers"
" and complain to your BIOS vendor.\n");
printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide"
" ACPI _PSS objects in a way that Linux "
"understands. Please report this to the Linux "
"ACPI maintainers and complain to your BIOS "
"vendor.\n");
#endif
kfree(data);
return -ENODEV;
}
if (pol->cpu != 0) {
printk(KERN_ERR PFX "No ACPI _PSS objects for CPU other than "
"CPU0. Complain to your BIOS vendor.\n");
printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
"CPU other than CPU0. Complain to your BIOS "
"vendor.\n");
kfree(data);
return -ENODEV;
}
Expand Down Expand Up @@ -1193,7 +1199,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)

/* min/max the cpu is capable of */
if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) {
printk(KERN_ERR PFX "invalid powernow_table\n");
printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n");
powernow_k8_cpu_exit_acpi(data);
kfree(data->powernow_table);
kfree(data);
Expand Down
18 changes: 15 additions & 3 deletions trunk/drivers/acpi/processor_perflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#include <asm/uaccess.h>
#endif
#include <asm/cpufeature.h>

#include <acpi/acpi_bus.h>
#include <acpi/processor.h>
Expand Down Expand Up @@ -334,7 +335,6 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
acpi_status status = AE_OK;
acpi_handle handle = NULL;


if (!pr || !pr->performance || !pr->handle)
return -EINVAL;

Expand All @@ -347,13 +347,25 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)

result = acpi_processor_get_performance_control(pr);
if (result)
return result;
goto update_bios;

result = acpi_processor_get_performance_states(pr);
if (result)
return result;
goto update_bios;

return 0;

/*
* Having _PPC but missing frequencies (_PSS, _PCT) is a very good hint that
* the BIOS is older than the CPU and does not know its frequencies
*/
update_bios:
if (ACPI_SUCCESS(acpi_get_handle(pr->handle, "_PPC", &handle))){
if(boot_cpu_has(X86_FEATURE_EST))
printk(KERN_WARNING FW_BUG "BIOS needs update for CPU "
"frequency support\n");
}
return result;
}

int acpi_processor_notify_smm(struct module *calling_module)
Expand Down
39 changes: 37 additions & 2 deletions trunk/drivers/acpi/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,35 @@ static bool find_guid(const char *guid_string, struct wmi_block **out)
return 0;
}

static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
{
struct guid_block *block = NULL;
char method[5];
struct acpi_object_list input;
union acpi_object params[1];
acpi_status status;
acpi_handle handle;

block = &wblock->gblock;
handle = wblock->handle;

if (!block)
return AE_NOT_EXIST;

input.count = 1;
input.pointer = params;
params[0].type = ACPI_TYPE_INTEGER;
params[0].integer.value = enable;

snprintf(method, 5, "WE%02X", block->notify_id);
status = acpi_evaluate_object(handle, method, &input, NULL);

if (status != AE_OK && status != AE_NOT_FOUND)
return status;
else
return AE_OK;
}

/*
* Exported WMI functions
*/
Expand Down Expand Up @@ -427,6 +456,7 @@ acpi_status wmi_install_notify_handler(const char *guid,
wmi_notify_handler handler, void *data)
{
struct wmi_block *block;
acpi_status status;

if (!guid || !handler)
return AE_BAD_PARAMETER;
Expand All @@ -441,7 +471,9 @@ wmi_notify_handler handler, void *data)
block->handler = handler;
block->handler_data = data;

return AE_OK;
status = wmi_method_enable(block, 1);

return status;
}
EXPORT_SYMBOL_GPL(wmi_install_notify_handler);

Expand All @@ -453,6 +485,7 @@ EXPORT_SYMBOL_GPL(wmi_install_notify_handler);
acpi_status wmi_remove_notify_handler(const char *guid)
{
struct wmi_block *block;
acpi_status status;

if (!guid)
return AE_BAD_PARAMETER;
Expand All @@ -464,10 +497,12 @@ acpi_status wmi_remove_notify_handler(const char *guid)
if (!block->handler)
return AE_NULL_ENTRY;

status = wmi_method_enable(block, 0);

block->handler = NULL;
block->handler_data = NULL;

return AE_OK;
return status;
}
EXPORT_SYMBOL_GPL(wmi_remove_notify_handler);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ config ACER_WMI
depends on NEW_LEDS
depends on BACKLIGHT_CLASS_DEVICE
depends on SERIO_I8042
depends on RFKILL
select ACPI_WMI
---help---
This is a driver for newer Acer (and Wistron) laptops. It adds
Expand Down
Loading

0 comments on commit 85a3af2

Please sign in to comment.