From 6acafb8d981f79c039178bd9ae3c4cbe37b31ef0 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sun, 12 Aug 2007 00:12:17 -0400 Subject: [PATCH] --- yaml --- r: 63946 b: refs/heads/master c: 72b33ef8bb1ac7f6c5a16d23304ab25ddc73d93d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/kernel-parameters.txt | 5 ++- trunk/Documentation/thinkpad-acpi.txt | 4 +- trunk/drivers/acpi/asus_acpi.c | 1 - trunk/drivers/acpi/battery.c | 47 +++++++++++++++-------- trunk/drivers/acpi/tables/tbxface.c | 23 ----------- trunk/drivers/acpi/thermal.c | 9 ++++- trunk/drivers/char/sonypi.c | 7 +--- trunk/drivers/misc/Kconfig | 22 ++++------- trunk/drivers/misc/sony-laptop.c | 7 +--- trunk/drivers/misc/thinkpad_acpi.c | 10 +---- trunk/drivers/misc/thinkpad_acpi.h | 2 - 12 files changed, 55 insertions(+), 84 deletions(-) diff --git a/[refs] b/[refs] index 7a9df53899e4..cb61ad690057 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fc0dc4d3aa9c73e275accf2966e0bdf16bff45f1 +refs/heads/master: 72b33ef8bb1ac7f6c5a16d23304ab25ddc73d93d diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index 09c0ec100f61..de3300c9056a 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -163,8 +163,6 @@ and is between 256 and 4096 characters. It is defined in the file acpi_irq_isa= [HW,ACPI] If irq_balance, mark listed IRQs used by ISA Format: ,... - acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT - acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS Format: To spoof as Windows 98: ="Microsoft Windows" @@ -1822,6 +1820,9 @@ and is between 256 and 4096 characters. It is defined in the file thash_entries= [KNL,NET] Set number of hash buckets for TCP connection + thermal.off= [HW,ACPI] + 1: disable ACPI thermal control + time Show timing data prefixed to each printk message line [deprecated, see 'printk.time'] diff --git a/trunk/Documentation/thinkpad-acpi.txt b/trunk/Documentation/thinkpad-acpi.txt index eb2f5986e1eb..6711fbcf4080 100644 --- a/trunk/Documentation/thinkpad-acpi.txt +++ b/trunk/Documentation/thinkpad-acpi.txt @@ -105,10 +105,10 @@ The version of thinkpad-acpi's sysfs interface is exported by the driver as a driver attribute (see below). Sysfs driver attributes are on the driver's sysfs attribute space, -for 2.6.20 this is /sys/bus/platform/drivers/thinkpad_acpi/. +for 2.6.20 this is /sys/bus/platform/drivers/thinkpad-acpi/. Sysfs device attributes are on the driver's sysfs attribute space, -for 2.6.20 this is /sys/devices/platform/thinkpad_acpi/. +for 2.6.20 this is /sys/devices/platform/thinkpad-acpi/. Driver version -------------- diff --git a/trunk/drivers/acpi/asus_acpi.c b/trunk/drivers/acpi/asus_acpi.c index 86fd142f4bf3..9c4bd220c44f 100644 --- a/trunk/drivers/acpi/asus_acpi.c +++ b/trunk/drivers/acpi/asus_acpi.c @@ -1192,7 +1192,6 @@ static int asus_hotk_get_info(void) break; default: kfree(model); - model = NULL; break; } } diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index d7b499fe0cd9..81651032791b 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -113,7 +113,7 @@ struct acpi_battery_info { acpi_string oem_info; }; -enum acpi_battery_files { +enum acpi_battery_files{ ACPI_BATTERY_INFO = 0, ACPI_BATTERY_STATE, ACPI_BATTERY_ALARM, @@ -129,14 +129,13 @@ struct acpi_battery_flags { }; struct acpi_battery { + struct mutex mutex; struct acpi_device *device; struct acpi_battery_flags flags; struct acpi_buffer bif_data; struct acpi_buffer bst_data; - struct mutex lock; unsigned long alarm; unsigned long update_time[ACPI_BATTERY_NUMFILES]; - }; inline int acpi_battery_present(struct acpi_battery *battery) @@ -236,10 +235,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery) return 0; /* Evaluate _BIF */ - mutex_lock(&battery->lock); - status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", - NULL, &buffer); - mutex_unlock(&battery->lock); + + status = + acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL, + &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); return -ENODEV; @@ -286,10 +285,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery) return 0; /* Evaluate _BST */ - mutex_lock(&battery->lock); - status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST", - NULL, &buffer); - mutex_unlock(&battery->lock); + + status = + acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL, + &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); return -ENODEV; @@ -337,10 +336,9 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery, arg0.integer.value = alarm; - mutex_lock(&battery->lock); - status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", + status = + acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", &arg_list, NULL); - mutex_unlock(&battery->lock); if (ACPI_FAILURE(status)) return -ENODEV; @@ -660,6 +658,8 @@ acpi_battery_write_alarm(struct file *file, if (!battery || (count > sizeof(alarm_string) - 1)) return -EINVAL; + mutex_lock(&battery->mutex); + result = acpi_battery_update(battery, 1, &update_result); if (result) { result = -ENODEV; @@ -688,7 +688,9 @@ acpi_battery_write_alarm(struct file *file, acpi_battery_check_result(battery, result); if (!result) - return count; + result = count; + + mutex_unlock(&battery->mutex); return result; } @@ -712,6 +714,8 @@ static int acpi_battery_read(int fid, struct seq_file *seq) int update_result = ACPI_BATTERY_NONE_UPDATE; int update = 0; + mutex_lock(&battery->mutex); + update = (get_seconds() - battery->update_time[fid] >= update_time); update = (update | battery->flags.update[fid]); @@ -729,6 +733,7 @@ static int acpi_battery_read(int fid, struct seq_file *seq) result = acpi_read_funcs[fid].print(seq, result); acpi_battery_check_result(battery, result); battery->flags.update[fid] = result; + mutex_unlock(&battery->mutex); return result; } @@ -892,7 +897,10 @@ static int acpi_battery_add(struct acpi_device *device) if (!battery) return -ENOMEM; - mutex_init(&battery->lock); + mutex_init(&battery->mutex); + + mutex_lock(&battery->mutex); + battery->device = device; strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); @@ -928,6 +936,7 @@ static int acpi_battery_add(struct acpi_device *device) kfree(battery); } + mutex_unlock(&battery->mutex); return result; } @@ -942,6 +951,8 @@ static int acpi_battery_remove(struct acpi_device *device, int type) battery = acpi_driver_data(device); + mutex_lock(&battery->mutex); + status = acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY, acpi_battery_notify); @@ -952,7 +963,9 @@ static int acpi_battery_remove(struct acpi_device *device, int type) kfree(battery->bst_data.pointer); - mutex_destroy(&battery->lock); + mutex_unlock(&battery->mutex); + + mutex_destroy(&battery->mutex); kfree(battery); diff --git a/trunk/drivers/acpi/tables/tbxface.c b/trunk/drivers/acpi/tables/tbxface.c index a9e3331fee5d..5b302c4e293f 100644 --- a/trunk/drivers/acpi/tables/tbxface.c +++ b/trunk/drivers/acpi/tables/tbxface.c @@ -52,8 +52,6 @@ ACPI_MODULE_NAME("tbxface") /* Local prototypes */ static acpi_status acpi_tb_load_namespace(void); -static int no_auto_ssdt; - /******************************************************************************* * * FUNCTION: acpi_allocate_root_table @@ -538,10 +536,6 @@ static acpi_status acpi_tb_load_namespace(void) ACPI_INFO((AE_INFO, "Table DSDT replaced by host OS")); acpi_tb_print_table_header(0, table); - - if (no_auto_ssdt == 0) { - printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\""); - } } status = @@ -583,11 +577,6 @@ static acpi_status acpi_tb_load_namespace(void) continue; } - if (no_auto_ssdt) { - printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n"); - continue; - } - /* Ignore errors while loading tables, get as many as possible */ (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); @@ -633,15 +622,3 @@ acpi_status acpi_load_tables(void) } ACPI_EXPORT_SYMBOL(acpi_load_tables) - - -static int __init acpi_no_auto_ssdt_setup(char *s) { - - printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n"); - - no_auto_ssdt = 1; - - return 1; -} - -__setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup); diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 5a62de1b7f2a..61337d969d7f 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -78,6 +78,10 @@ static int tzp; module_param(tzp, int, 0); MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); +static int off; +module_param(off, int, 0); +MODULE_PARM_DESC(off, "Set to disable ACPI thermal support.\n"); + static int acpi_thermal_add(struct acpi_device *device); static int acpi_thermal_remove(struct acpi_device *device, int type); static int acpi_thermal_resume(struct acpi_device *device); @@ -1285,7 +1289,10 @@ static int __init acpi_thermal_init(void) { int result = 0; - + if (off) { + printk(KERN_NOTICE "ACPI: thermal control disabled\n"); + return -ENODEV; + } acpi_thermal_dir = proc_mkdir(ACPI_THERMAL_CLASS, acpi_root_dir); if (!acpi_thermal_dir) return -ENODEV; diff --git a/trunk/drivers/char/sonypi.c b/trunk/drivers/char/sonypi.c index aeec67e27264..73037a4d3c50 100644 --- a/trunk/drivers/char/sonypi.c +++ b/trunk/drivers/char/sonypi.c @@ -1147,15 +1147,10 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type) return 0; } -const static struct acpi_device_id sonypi_device_ids[] = { - {"SNY6001", 0}, - {"", 0}, -}; - static struct acpi_driver sonypi_acpi_driver = { .name = "sonypi", .class = "hkey", - .ids = sonypi_device_ids, + .ids = "SNY6001", .ops = { .add = sonypi_acpi_add, .remove = sonypi_acpi_remove, diff --git a/trunk/drivers/misc/Kconfig b/trunk/drivers/misc/Kconfig index 518d5d335464..aaaa61ea4217 100644 --- a/trunk/drivers/misc/Kconfig +++ b/trunk/drivers/misc/Kconfig @@ -200,22 +200,14 @@ config THINKPAD_ACPI_BAY config THINKPAD_ACPI_INPUT_ENABLED bool "Enable input layer support by default" depends on THINKPAD_ACPI - default n + default y ---help--- - This option enables thinkpad-acpi hot key handling over the input - layer at driver load time. When it is unset, the driver does not - enable hot key handling by default, and also starts up with a mostly - empty keymap. - - This option should be enabled if you have a new enough HAL or other - userspace support that properly handles the thinkpad-acpi event - device. It auto-tunes the hot key support to those reported by the - firmware and enables it automatically. - - If unsure, say N here to retain the old behaviour of ibm-acpi, and - thinkpad-acpi up to kernel 2.6.21: userspace will have to enable and - set up the thinkpad-acpi hot key handling using the sysfs interace - after loading the driver. + Enables hot key handling over the input layer by default. If unset, + the driver does not enable any hot key handling by default, and also + starts up with a mostly empty keymap. + + If you are not sure, say Y here. Say N to retain the deprecated + behavior of ibm-acpi, and thinkpad-acpi for kernels up to 2.6.21. endif # MISC_DEVICES diff --git a/trunk/drivers/misc/sony-laptop.c b/trunk/drivers/misc/sony-laptop.c index 91da6880ae93..14ee06c8f127 100644 --- a/trunk/drivers/misc/sony-laptop.c +++ b/trunk/drivers/misc/sony-laptop.c @@ -845,7 +845,7 @@ static struct sony_nc_event sony_C_events[] = { }; /* SNC-only model map */ -static struct dmi_system_id sony_nc_ids[] = { +struct dmi_system_id sony_nc_ids[] = { { .ident = "Sony Vaio FE Series", .callback = sony_nc_C_enable, @@ -942,11 +942,6 @@ static int sony_nc_resume(struct acpi_device *device) } } - /* set the last requested brightness level */ - if (sony_backlight_device && - !sony_backlight_update_status(sony_backlight_device)) - printk(KERN_WARNING DRV_PFX "unable to restore brightness level"); - /* re-initialize models with specific requirements */ dmi_check_system(sony_nc_ids); diff --git a/trunk/drivers/misc/thinkpad_acpi.c b/trunk/drivers/misc/thinkpad_acpi.c index f6cd34a3dbac..fa80f355e522 100644 --- a/trunk/drivers/misc/thinkpad_acpi.c +++ b/trunk/drivers/misc/thinkpad_acpi.c @@ -4668,15 +4668,12 @@ static int __init thinkpad_acpi_module_init(void) thinkpad_acpi_module_exit(); return ret; } - tp_features.platform_drv_registered = 1; - ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); if (ret) { printk(IBM_ERR "unable to create sysfs driver attributes\n"); thinkpad_acpi_module_exit(); return ret; } - tp_features.platform_drv_attrs_registered = 1; /* Device initialization */ @@ -4759,11 +4756,8 @@ static void thinkpad_acpi_module_exit(void) if (tpacpi_pdev) platform_device_unregister(tpacpi_pdev); - if (tp_features.platform_drv_attrs_registered) - tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); - - if (tp_features.platform_drv_registered) - platform_driver_unregister(&tpacpi_pdriver); + tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); + platform_driver_unregister(&tpacpi_pdriver); if (proc_dir) remove_proc_entry(IBM_PROC_DIR, acpi_root_dir); diff --git a/trunk/drivers/misc/thinkpad_acpi.h b/trunk/drivers/misc/thinkpad_acpi.h index eee8809a50d9..88af089d6494 100644 --- a/trunk/drivers/misc/thinkpad_acpi.h +++ b/trunk/drivers/misc/thinkpad_acpi.h @@ -246,8 +246,6 @@ static struct { u16 wan:1; u16 fan_ctrl_status_undef:1; u16 input_device_registered:1; - u16 platform_drv_registered:1; - u16 platform_drv_attrs_registered:1; } tp_features; struct thinkpad_id_data {