From: Len Brown Date: Wed, 30 Apr 2008 17:58:00 +0000 (-0400) Subject: Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla... X-Git-Tag: v2.6.26-rc1~101^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=96916090f488986a4ebb8e9ffa6a3b50881d5ccd;p=linux-2.6-omap-h63xx.git Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release --- 96916090f488986a4ebb8e9ffa6a3b50881d5ccd diff --cc arch/mips/au1000/common/power.c index 54047d69b82,54047d69b82,812a5f8b7d2,54047d69b82,54047d69b82,812a5f8b7d2,54047d69b82,812a5f8b7d2,725a52f364b,54047d69b82,812a5f8b7d2,812a5f8b7d2,812a5f8b7d2..a8cd2c1b9e1 --- a/arch/mips/au1000/common/power.c +++ b/arch/mips/au1000/common/power.c @@@@@@@@@@@@@@ -278,36 -278,36 -271,36 -278,36 -278,36 -271,36 -278,36 -271,36 -277,12 -278,36 -271,36 -271,36 -271,36 +270,12 @@@@@@@@@@@@@@ static int pm_do_sleep(ctl_table * ctl p = buf; sleep_ticks = simple_strtoul(p, &p, 0); #endif -------- ---- retval = pm_send_all(PM_SUSPEND, (void *) 2); -------- ---- -------- ---- if (retval) -------- ---- return retval; au_sleep(); -- -- - - retval = pm_send_all(PM_RESUME, (void *) 0); -- -- - - } -- -- - - return retval; -- -- - - } -- -- - - -- -- - - static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, -- -- - - void __user *buffer, size_t * len, loff_t *ppos) -- -- - - { -- -- - - int retval = 0; -- -- - - -- -- - - if (!write) { -- -- - - *len = 0; -- -- - - } else { -- -- - - retval = pm_send_all(PM_SUSPEND, (void *) 2); -- -- - - if (retval) -- -- - - return retval; -- -- - - suspend_mode = 1; -- -- - - -------- ---- retval = pm_send_all(PM_RESUME, (void *) 0); } - - - --- return retval; - - - ---} - - - --- - - - ---static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, - - - --- void __user *buffer, size_t * len, loff_t *ppos) - - - ---{ - - - --- int retval = 0; - - - --- - - - --- if (!write) { - - - --- *len = 0; - - - --- } else { - - - --- retval = pm_send_all(PM_SUSPEND, (void *) 2); - - - --- if (retval) - - - --- return retval; - - - --- suspend_mode = 1; - - - --- - - - --- retval = pm_send_all(PM_RESUME, (void *) 0); - - - --- } -------- ---- return retval; ++++++++ ++++ return 0; } -------- ---- static int pm_do_freq(ctl_table * ctl, int write, struct file *file, void __user *buffer, size_t * len, loff_t *ppos) { diff --cc drivers/acpi/processor_idle.c index 788da9781f8,788da9781f8,0d90ff5fd11,788da9781f8,e8e2d886923,0d90ff5fd11,47b167c731a,0d90ff5fd11,788da9781f8,6f3b217699e,0d90ff5fd11,0d90ff5fd11,0d90ff5fd11..55d69dce47c --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@@@@@@@@@@@@@ -418,14 -418,14 -418,13 -418,14 -418,14 -418,13 -418,14 -418,13 -418,14 -416,12 -418,13 -418,13 -418,13 +418,13 @@@@@@@@@@@@@@ static void acpi_processor_idle(void cx = pr->power.state; if (!cx || acpi_idle_suspend) { -- -- - -- if (pm_idle_save) -- -- - -- pm_idle_save(); -- -- - -- else ++ ++ + ++ if (pm_idle_save) { ++ ++ + ++ pm_idle_save(); /* enables IRQs */ ++ ++ + ++ } else { acpi_safe_halt(); -- -- - - -- -- - - if (irqs_disabled()) + local_irq_enable(); ++ ++ + ++ } - local_irq_enable(); return; } @@@@@@@@@@@@@@ -534,9 -534,9 -535,7 -534,9 -534,9 -535,7 -534,9 -535,7 -534,9 -530,7 -535,7 -535,7 -535,7 +535,7 @@@@@@@@@@@@@@ * skew otherwise. */ sleep_ticks = 0xFFFFFFFF; -- -- - - if (irqs_disabled()) -- -- - - local_irq_enable(); - local_irq_enable(); + break; case ACPI_STATE_C2: diff --cc drivers/acpi/video.c index 980a7418878,980a7418878,980a7418878,980a7418878,12fb44f1676,980a7418878,980a7418878,980a7418878,980a7418878,12cce69b544,55c09561937,980a7418878,c24a1d74325..33c502e5602 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@@@@@@@@@@@@@ -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1337,79 -1366,108 -1335,79 -1337,79 -1338,79 +1336,79 @@@@@@@@@@@@@@ acpi_video_bus_write_DOS(struct file *f static int acpi_video_bus_add_fs(struct acpi_device *device) { - long device_id; - int status; ------------ struct proc_dir_entry *entry = NULL; ------------ struct acpi_video_bus *video; --------- -- - struct device *dev; ++++++++++++ struct acpi_video_bus *video = acpi_driver_data(device); ++++++++++++ struct proc_dir_entry *device_dir; ++++++++++++ struct proc_dir_entry *entry; --------- -- video = acpi_driver_data(device); - status = - acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); ++++++++++++ device_dir = proc_mkdir(acpi_device_bid(device), acpi_video_dir); ++++++++++++ if (!device_dir) ++++++++++++ return -ENOMEM; - if (!ACPI_SUCCESS(status)) - return -ENODEV; - - /* We need to attempt to determine whether the _ADR refers to a - PCI device or not. There's no terribly good way to do this, - so the best we can hope for is to assume that there'll never - be a video device in the host bridge */ - if (device_id >= 0x10000) { - /* It looks like a PCI device. Does it exist? */ - dev = acpi_get_physical_device(device->handle); - } else { - /* It doesn't look like a PCI device. Does its parent - exist? */ - acpi_handle phandle; - if (acpi_get_parent(device->handle, &phandle)) - return -ENODEV; - dev = acpi_get_physical_device(phandle); - } - if (!dev) - return -ENODEV; - put_device(dev); - - - - video = acpi_driver_data(device); - ------------ if (!acpi_device_dir(device)) { ------------ acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), ------------ acpi_video_dir); ------------ if (!acpi_device_dir(device)) ------------ return -ENODEV; ------------ video->dir = acpi_device_dir(device); ------------ acpi_device_dir(device)->owner = THIS_MODULE; ------------ } ++++++++++++ device_dir->owner = THIS_MODULE; /* 'info' [R] */ ------------ entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); ++++++++++++ entry = create_proc_entry("info", S_IRUGO, device_dir); if (!entry) ------------ return -ENODEV; ------------ else { ------------ entry->proc_fops = &acpi_video_bus_info_fops; ------------ entry->data = acpi_driver_data(device); ------------ entry->owner = THIS_MODULE; ------------ } ++++++++++++ goto err_remove_dir; ++++++++++++ ++++++++++++ entry->proc_fops = &acpi_video_bus_info_fops; ++++++++++++ entry->data = acpi_driver_data(device); ++++++++++++ entry->owner = THIS_MODULE; /* 'ROM' [R] */ ------------ entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device)); ++++++++++++ entry = create_proc_entry("ROM", S_IRUGO, device_dir); if (!entry) ------------ return -ENODEV; ------------ else { ------------ entry->proc_fops = &acpi_video_bus_ROM_fops; ------------ entry->data = acpi_driver_data(device); ------------ entry->owner = THIS_MODULE; ------------ } ++++++++++++ goto err_remove_info; ++++++++++++ ++++++++++++ entry->proc_fops = &acpi_video_bus_ROM_fops; ++++++++++++ entry->data = acpi_driver_data(device); ++++++++++++ entry->owner = THIS_MODULE; /* 'POST_info' [R] */ ------------ entry = ------------ create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device)); ++++++++++++ entry = create_proc_entry("POST_info", S_IRUGO, device_dir); if (!entry) ------------ return -ENODEV; ------------ else { ------------ entry->proc_fops = &acpi_video_bus_POST_info_fops; ------------ entry->data = acpi_driver_data(device); ------------ entry->owner = THIS_MODULE; ------------ } ++++++++++++ goto err_remove_rom; ++++++++++++ ++++++++++++ entry->proc_fops = &acpi_video_bus_POST_info_fops; ++++++++++++ entry->data = acpi_driver_data(device); ++++++++++++ entry->owner = THIS_MODULE; /* 'POST' [R/W] */ ------------ entry = ------------ create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR, ------------ acpi_device_dir(device)); ++++++++++++ entry = create_proc_entry("POST", S_IFREG | S_IRUGO | S_IWUSR, ++++++++++++ device_dir); if (!entry) ------------ return -ENODEV; ------------ else { ------------ acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; ------------ entry->proc_fops = &acpi_video_bus_POST_fops; ------------ entry->data = acpi_driver_data(device); ------------ entry->owner = THIS_MODULE; ------------ } ++++++++++++ goto err_remove_post_info; ++++++++++++ ++++++++++++ acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; ++++++++++++ entry->proc_fops = &acpi_video_bus_POST_fops; ++++++++++++ entry->data = acpi_driver_data(device); ++++++++++++ entry->owner = THIS_MODULE; /* 'DOS' [R/W] */ ------------ entry = ------------ create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR, ------------ acpi_device_dir(device)); ++++++++++++ entry = create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IWUSR, ++++++++++++ device_dir); if (!entry) ------------ return -ENODEV; ------------ else { ------------ acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; ------------ entry->proc_fops = &acpi_video_bus_DOS_fops; ------------ entry->data = acpi_driver_data(device); ------------ entry->owner = THIS_MODULE; ------------ } ++++++++++++ goto err_remove_post; ++++++++++ + ++++++++++++ acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; ++++++++++++ entry->proc_fops = &acpi_video_bus_DOS_fops; ++++++++++++ entry->data = acpi_driver_data(device); ++++++++++++ entry->owner = THIS_MODULE; + ++++++++++++ video->dir = acpi_device_dir(device) = device_dir; return 0; ++++++++++++ ++++++++++++ err_remove_post: ++++++++++++ remove_proc_entry("POST", device_dir); ++++++++++++ err_remove_post_info: ++++++++++++ remove_proc_entry("POST_info", device_dir); ++++++++++++ err_remove_rom: ++++++++++++ remove_proc_entry("ROM", device_dir); ++++++++++++ err_remove_info: ++++++++++++ remove_proc_entry("info", device_dir); ++++++++++++ err_remove_dir: ++++++++++++ remove_proc_entry(acpi_device_bid(device), acpi_video_dir); ++++++++++++ return -ENOMEM; } static int acpi_video_bus_remove_fs(struct acpi_device *device) diff --cc drivers/misc/Kconfig index 962817e49fb,962817e49fb,297a48f8544,297a48f8544,962817e49fb,7a4869a9db8,962817e49fb,38cce4d1e2f,962817e49fb,982e27b86d1,08f35d76dcd,2e217947d97,297a48f8544..636af286230 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@@@@@@@@@@@@@ -107,8 -107,8 -140,8 -140,8 -107,8 -140,8 -107,8 -140,9 -107,8 -107,7 -140,8 -140,8 -140,8 +140,9 @@@@@@@@@@@@@@ config ACER_WM depends on EXPERIMENTAL depends on ACPI depends on LEDS_CLASS +++++++ +++++ depends on NEW_LEDS depends on BACKLIGHT_CLASS_DEVICE + depends on SERIO_I8042 select ACPI_WMI ---help--- This is a driver for newer Acer (and Wistron) laptops. It adds diff --cc drivers/misc/thinkpad_acpi.c index 6cb781262f9,6cb781262f9,6cb781262f9,6cb781262f9,6cb781262f9,6cb781262f9,6cb781262f9,31115c9cfb3,6cb781262f9,bb269d0c677,6cb781262f9,d29ad2e4afc,6cb781262f9..3f28f6eabdb --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@@@@@@@@@@@@@ -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4266,106 -4265,106 -4266,106 -4697,23 -4266,106 +4697,23 @@@@@@@@@@@@@@ static int brightness_update_status(str bd->props.brightness : 0); } ----------- -static struct backlight_ops ibm_backlight_data = { ----------- - .get_brightness = brightness_get, ----------- - .update_status = brightness_update_status, ----------- -}; ----------- - ----------- -/* --------------------------------------------------------------------- */ ----------- - ----------- -static int __init tpacpi_query_bcll_levels(acpi_handle handle) ----------- -{ ----------- - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; ----------- - union acpi_object *obj; ----------- - int rc; ----------- - ----------- - if (ACPI_SUCCESS(acpi_evaluate_object(handle, NULL, NULL, &buffer))) { ----------- - obj = (union acpi_object *)buffer.pointer; ----------- - if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { ----------- - printk(TPACPI_ERR "Unknown BCLL data, " ----------- - "please report this to %s\n", TPACPI_MAIL); ----------- - rc = 0; ----------- - } else { ----------- - rc = obj->package.count; ----------- - } ----------- - } else { ----------- - return 0; ----------- - } ----------- - ----------- - kfree(buffer.pointer); ----------- - return rc; ----------- -} ----------- - ----------- -static acpi_status __init brightness_find_bcll(acpi_handle handle, u32 lvl, ----------- - void *context, void **rv) --------- - -{ --------- - - char name[ACPI_PATH_SEGMENT_LENGTH]; --------- - - struct acpi_buffer buffer = { sizeof(name), &name }; --------- - - --------- - - if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) && --------- - - !strncmp("BCLL", name, sizeof(name) - 1)) { --------- - - if (tpacpi_query_bcll_levels(handle) == 16) { --------- - - *rv = handle; --------- - - return AE_CTRL_TERMINATE; --------- - - } else { --------- - - return AE_OK; --------- - - } --------- - - } else { --------- - - return AE_OK; --------- - - } --------- - -} --------- - - --------- - -static int __init brightness_check_levels(void) +++++++++++ +static int brightness_get(struct backlight_device *bd) { --------- - - int status; --------- - - void *found_node = NULL; - char name[ACPI_PATH_SEGMENT_LENGTH]; - struct acpi_buffer buffer = { sizeof(name), &name }; +++++++++++ + int status, res; - if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) && - !strncmp("BCLL", name, sizeof(name) - 1)) { - if (tpacpi_query_bcll_levels(handle) == 16) { - *rv = handle; - return AE_CTRL_TERMINATE; - } else { - return AE_OK; - } - } else { - return AE_OK; - } - } - - static int __init brightness_check_levels(void) - { - int status; - void *found_node = NULL; - ----------- - if (!vid_handle) { ----------- - TPACPI_ACPIHANDLE_INIT(vid); ----------- - } ----------- - if (!vid_handle) ----------- - return 0; ----------- - ----------- - /* Search for a BCLL package with 16 levels */ ----------- - status = acpi_walk_namespace(ACPI_TYPE_PACKAGE, vid_handle, 3, ----------- - brightness_find_bcll, NULL, ----------- - &found_node); ----------- - ----------- - return (ACPI_SUCCESS(status) && found_node != NULL); ----------- -} ----------- - ----------- -static acpi_status __init brightness_find_bcl(acpi_handle handle, u32 lvl, ----------- - void *context, void **rv) ----------- -{ ----------- - char name[ACPI_PATH_SEGMENT_LENGTH]; ----------- - struct acpi_buffer buffer = { sizeof(name), &name }; +++++++++++ + res = brightness_get_raw(&status); +++++++++++ + if (res < 0) +++++++++++ + return 0; /* FIXME: teach backlight about error handling */ ----------- - if (ACPI_SUCCESS(acpi_get_name(handle, ACPI_SINGLE_NAME, &buffer)) && ----------- - !strncmp("_BCL", name, sizeof(name) - 1)) { ----------- - *rv = handle; ----------- - return AE_CTRL_TERMINATE; ----------- - } else { ----------- - return AE_OK; ----------- - } +++++++++++ + return status & TP_EC_BACKLIGHT_LVLMSK; } ----------- -static int __init brightness_check_std_acpi_support(void) ----------- -{ ----------- - int status; ----------- - void *found_node = NULL; ----------- - ----------- - if (!vid_handle) { ----------- - TPACPI_ACPIHANDLE_INIT(vid); ----------- - } ----------- - if (!vid_handle) ----------- - return 0; ----------- - ----------- - /* Search for a _BCL method, but don't execute it */ ----------- - status = acpi_walk_namespace(ACPI_TYPE_METHOD, vid_handle, 3, ----------- - brightness_find_bcl, NULL, &found_node); +++++++++++ +static struct backlight_ops ibm_backlight_data = { +++++++++++ + .get_brightness = brightness_get, +++++++++++ + .update_status = brightness_update_status, +++++++++++ +}; ----------- - return (ACPI_SUCCESS(status) && found_node != NULL); ----------- -} +++++++++++ +/* --------------------------------------------------------------------- */ static int __init brightness_init(struct ibm_init_struct *iibm) {