Commit ba9912ec authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.7

into intel.com:/home/lenb/src/linux-acpi-test-2.6.8
parents 493b9f60 c8d992fb
......@@ -123,14 +123,16 @@ struct asus_hotk {
L3C, //L3800C
L3D, //L3400D
L3H, //L3H, but also L2000E
L4R, //L4500R
L5x, //L5800C
L8L, //L8400L
M1A, //M1300A
M2E, //M2400E, L4400L
M6N, //M6800N
P30, //Samsung P30
S1x, //S1300A, but also L1400B and M2400A (L84F)
S2x, //S200 (J1 reported), Victor MP-XP7210
xxN, //M2400N, M3700N, M6800N, S1300N, S5200N (Centrino)
xxN, //M2400N, M3700N, M5200N, S1300N, S5200N (Centrino)
END_MODEL
} model; //Models currently supported
u16 event_count[128]; //count for each event TODO make this better
......@@ -246,6 +248,19 @@ static struct model_data model_conf[END_MODEL] = {
.display_get = "\\INFB"
},
{
.name = "L4R",
.mt_mled = "MLED",
.mt_wled = "WLED",
.wled_status = "\\_SB.PCI0.SBRG.SG13",
.mt_lcd_switch = xxN_PREFIX "_Q10",
.lcd_status = "\\_SB.PCI0.SBSM.SEO4",
.brightness_set = "SPLV",
.brightness_get = "GPLV",
.display_set = "SDSP",
.display_get = "\\_SB.PCI0.P0P1.VGA.GETD"
},
{
.name = "L5x",
.mt_mled = "MLED",
......@@ -288,6 +303,19 @@ static struct model_data model_conf[END_MODEL] = {
.display_get = "\\INFB"
},
{
.name = "M6N",
.mt_mled = "MLED",
.mt_wled = "WLED",
.wled_status = "\\_SB.PCI0.SBRG.SG13",
.mt_lcd_switch = xxN_PREFIX "_Q10",
.lcd_status = "\\_SB.BKLT",
.brightness_set = "SPLV",
.brightness_get = "GPLV",
.display_set = "SDSP",
.display_get = "\\SSTE"
},
{
.name = "P30",
.mt_wled = "WLED",
......@@ -428,7 +456,7 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
len += sprintf(page + len, "SFUN value : 0x%04x\n", temp);
/*
* Another value for userspace: the ASYM method returns 0x02 for
* battery low and 0x04 for battery critical, it's readings tend to be
* battery low and 0x04 for battery critical, its readings tend to be
* more accurate than those provided by _BST.
* Note: since not all the laptops provide this method, errors are
* silently ignored.
......@@ -580,7 +608,6 @@ proc_write_tled(struct file *file, const char __user *buffer,
}
static int get_lcd_state(struct asus_hotk *hotk)
{
int lcd = 0;
......@@ -764,6 +791,7 @@ proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
printk(KERN_WARNING "Asus ACPI: Error reading display status\n");
value &= 0x07; /* needed for some models, shouldn't hurt others */
return sprintf(page, "%d\n", value);
}
......@@ -869,13 +897,12 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
}
if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
(hotk->methods->brightness_get && hotk->methods->brightness_get)) {
(hotk->methods->brightness_get && hotk->methods->brightness_set)) {
asus_proc_add(PROC_BRN, &proc_write_brn, &proc_read_brn, mode, device);
}
if (hotk->methods->display_set) {
asus_proc_add(PROC_DISP, &proc_write_disp, &proc_read_disp, mode, device);
}
return 0;
......@@ -886,7 +913,7 @@ static int asus_hotk_remove_fs(struct acpi_device* device)
struct asus_hotk* hotk = acpi_driver_data(device);
if(acpi_device_dir(device)){
if(acpi_device_dir(device)) {
remove_proc_entry(PROC_INFO,acpi_device_dir(device));
if (hotk->methods->mt_wled)
remove_proc_entry(PROC_WLED,acpi_device_dir(device));
......@@ -896,7 +923,8 @@ static int asus_hotk_remove_fs(struct acpi_device* device)
remove_proc_entry(PROC_TLED,acpi_device_dir(device));
if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status)
remove_proc_entry(PROC_LCD, acpi_device_dir(device));
if ((hotk->methods->brightness_up && hotk->methods->brightness_down) || (hotk->methods->brightness_get && hotk->methods->brightness_get))
if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
(hotk->methods->brightness_get && hotk->methods->brightness_set))
remove_proc_entry(PROC_BRN, acpi_device_dir(device));
if (hotk->methods->display_set)
remove_proc_entry(PROC_DISP, acpi_device_dir(device));
......@@ -998,8 +1026,13 @@ static int __init asus_hotk_get_info(struct asus_hotk *hotk)
hotk->model = L3C;
else if (strncmp(model->string.pointer, "L8L", 3) == 0)
hotk->model = L8L;
else if (strncmp(model->string.pointer, "L4R", 3) == 0)
hotk->model = L4R;
else if (strncmp(model->string.pointer, "M6N", 3) == 0)
hotk->model = M6N;
else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
strncmp(model->string.pointer, "M3N", 3) == 0 ||
strncmp(model->string.pointer, "M5N", 3) == 0 ||
strncmp(model->string.pointer, "M6N", 3) == 0 ||
strncmp(model->string.pointer, "S1N", 3) == 0 ||
strncmp(model->string.pointer, "S5N", 3) == 0)
......@@ -1025,7 +1058,6 @@ static int __init asus_hotk_get_info(struct asus_hotk *hotk)
hotk->model = L5x;
if (hotk->model == END_MODEL) {
/* By default use the same values, as I don't know others */
printk("unsupported, trying default values, supply the "
"developers with your DSDT\n");
hotk->model = M2E;
......@@ -1043,13 +1075,9 @@ static int __init asus_hotk_get_info(struct asus_hotk *hotk)
else if (strncmp(model->string.pointer, "S5N", 3) == 0)
hotk->methods->mt_mled = NULL;
/* S5N has no MLED */
else if (strncmp(model->string.pointer, "M6N", 3) == 0) {
hotk->methods->display_get = NULL; //TODO
hotk->methods->lcd_status = "\\_SB.BKLT";
else if (strncmp(model->string.pointer, "M2N", 3) == 0)
hotk->methods->mt_wled = "WLED";
hotk->methods->wled_status = "\\_SB.PCI0.SBRG.SG13";
/* M6N differs slightly and has a usable WLED */
}
/* M2N has a usable WLED */
else if (asus_info) {
if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
hotk->methods->mled_status = NULL;
......@@ -1062,7 +1090,6 @@ static int __init asus_hotk_get_info(struct asus_hotk *hotk)
}
static int __init asus_hotk_check(struct asus_hotk *hotk)
{
int result = 0;
......@@ -1085,7 +1112,6 @@ static int __init asus_hotk_check(struct asus_hotk *hotk)
}
static int __init asus_hotk_add(struct acpi_device *device)
{
struct asus_hotk *hotk = NULL;
......@@ -1152,6 +1178,7 @@ static int __init asus_hotk_add(struct acpi_device *device)
return(result);
}
static int asus_hotk_remove(struct acpi_device *device, int type)
{
acpi_status status = 0;
......
......@@ -370,6 +370,7 @@ acpi_bus_driver_init (
static int acpi_driver_attach(struct acpi_driver * drv)
{
struct list_head * node, * next;
int count = 0;
ACPI_FUNCTION_TRACE("acpi_driver_attach");
......@@ -384,6 +385,7 @@ static int acpi_driver_attach(struct acpi_driver * drv)
if (!acpi_bus_match(dev, drv)) {
if (!acpi_bus_driver_init(dev, drv)) {
atomic_inc(&drv->references);
count++;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found driver [%s] for device [%s]\n",
drv->name, dev->pnp.bus_id));
}
......@@ -391,7 +393,7 @@ static int acpi_driver_attach(struct acpi_driver * drv)
spin_lock(&acpi_device_lock);
}
spin_unlock(&acpi_device_lock);
return_VALUE(0);
return_VALUE(count);
}
static int acpi_driver_detach(struct acpi_driver * drv)
......@@ -422,28 +424,30 @@ static int acpi_driver_detach(struct acpi_driver * drv)
* acpi_bus_register_driver
* ------------------------
* Registers a driver with the ACPI bus. Searches the namespace for all
* devices that match the driver's criteria and binds.
* devices that match the driver's criteria and binds. Returns the
* number of devices that were claimed by the driver, or a negative
* error status for failure.
*/
int
acpi_bus_register_driver (
struct acpi_driver *driver)
{
int error = 0;
int count;
ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
if (acpi_disabled)
return_VALUE(-ENODEV);
if (driver) {
if (!driver)
return_VALUE(-EINVAL);
spin_lock(&acpi_device_lock);
list_add_tail(&driver->node, &acpi_bus_drivers);
spin_unlock(&acpi_device_lock);
acpi_driver_attach(driver);
} else
error = -EINVAL;
count = acpi_driver_attach(driver);
return_VALUE(error);
return_VALUE(count);
}
......
......@@ -384,10 +384,10 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
return 0;
}
static int
static ssize_t
acpi_system_write_wakeup_device (
struct file *file,
const char *buffer,
const char __user *buffer,
size_t count,
loff_t *ppos)
{
......
......@@ -151,6 +151,8 @@ static int __init acpi_wakeup_device_init(void)
{
struct list_head * node, * next;
if (acpi_disabled)
return 0;
printk("ACPI wakeup devices: \n");
spin_lock(&acpi_device_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment