Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (23 commits)
ACPI PCI hotplug: harden against panic regression
ACPI: rename main.c to sleep.c
dell-laptop: move to drivers/platform/x86/ from drivers/misc/
eeepc-laptop: enable Bluetooth ACPI details
ACPI: fix ACPI_FADT_S4_RTC_WAKE comment
kprobes: check CONFIG_FREEZER instead of CONFIG_PM
PM: Fix freezer compilation if PM_SLEEP is unset
thermal fixup for broken BIOS which has invalid trip points.
ACPI: EC: Don't trust ECDT tables from ASUS
ACPI: EC: Limit workaround for ASUS notebooks even more
ACPI: thinkpad-acpi: bump up version to 0.22
ACPI: thinkpad-acpi: handle HKEY event 6030
ACPI: thinkpad-acpi: clean-up fan subdriver quirk
ACPI: thinkpad-acpi: start the event hunt season
ACPI: thinkpad-acpi: handle HKEY thermal and battery alarms
ACPI: thinkpad-acpi: clean up hotkey_notify()
ACPI: thinkpad-acpi: use killable instead of interruptible mutexes
ACPI: thinkpad-acpi: add UWB radio support
ACPI: thinkpad-acpi: preserve radio state across shutdown
ACPI: thinkpad-acpi: resume with radios disabled
...

+858 -212
+22 -3
Documentation/laptops/thinkpad-acpi.txt
··· 1 1 ThinkPad ACPI Extras Driver 2 2 3 - Version 0.21 4 - May 29th, 2008 3 + Version 0.22 4 + November 23rd, 2008 5 5 6 6 Borislav Deianov <borislav@users.sf.net> 7 7 Henrique de Moraes Holschuh <hmh@hmh.eng.br> ··· 16 16 This driver used to be named ibm-acpi until kernel 2.6.21 and release 17 17 0.13-20070314. It used to be in the drivers/acpi tree, but it was 18 18 moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel 19 - 2.6.22, and release 0.14. 19 + 2.6.22, and release 0.14. It was moved to drivers/platform/x86 for 20 + kernel 2.6.29 and release 0.22. 20 21 21 22 The driver is named "thinkpad-acpi". In some places, like module 22 23 names, "thinkpad_acpi" is used because of userspace issues. ··· 1411 1410 2010. 1412 1411 1413 1412 rfkill controller switch "tpacpi_wwan_sw": refer to 1413 + Documentation/rfkill.txt for details. 1414 + 1415 + EXPERIMENTAL: UWB 1416 + ----------------- 1417 + 1418 + This feature is marked EXPERIMENTAL because it has not been extensively 1419 + tested and validated in various ThinkPad models yet. The feature may not 1420 + work as expected. USE WITH CAUTION! To use this feature, you need to supply 1421 + the experimental=1 parameter when loading the module. 1422 + 1423 + sysfs rfkill class: switch "tpacpi_uwb_sw" 1424 + 1425 + This feature exports an rfkill controller for the UWB device, if one is 1426 + present and enabled in the BIOS. 1427 + 1428 + Sysfs notes: 1429 + 1430 + rfkill controller switch "tpacpi_uwb_sw": refer to 1414 1431 Documentation/rfkill.txt for details. 1415 1432 1416 1433 Multiple Commands, Module Parameters
+1 -1
arch/ia64/kernel/kprobes.c
··· 870 870 return 1; 871 871 872 872 ss_probe: 873 - #if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) 873 + #if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) 874 874 if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) { 875 875 /* Boost up -- we can execute copied instructions directly */ 876 876 ia64_psr(regs)->ri = p->ainsn.slot;
+1 -1
arch/x86/kernel/kprobes.c
··· 446 446 static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs, 447 447 struct kprobe_ctlblk *kcb) 448 448 { 449 - #if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) 449 + #if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER) 450 450 if (p->ainsn.boostable == 1 && !p->post_handler) { 451 451 /* Boost up -- we can execute copied instructions directly */ 452 452 reset_current_kprobe();
+1 -1
drivers/acpi/Makefile
··· 19 19 20 20 # sleep related files 21 21 obj-y += wakeup.o 22 - obj-y += main.o 22 + obj-y += sleep.o 23 23 obj-$(CONFIG_ACPI_SLEEP) += proc.o 24 24 25 25
+30 -43
drivers/acpi/ec.c
··· 120 120 spinlock_t curr_lock; 121 121 } *boot_ec, *first_ec; 122 122 123 - /* 124 - * Some Asus system have exchanged ECDT data/command IO addresses. 125 - */ 126 - static int print_ecdt_error(const struct dmi_system_id *id) 127 - { 128 - printk(KERN_NOTICE PREFIX "%s detected - " 129 - "ECDT has exchanged control/data I/O address\n", 130 - id->ident); 131 - return 0; 132 - } 133 - 134 - static struct dmi_system_id __cpuinitdata ec_dmi_table[] = { 135 - { 136 - print_ecdt_error, "Asus L4R", { 137 - DMI_MATCH(DMI_BIOS_VERSION, "1008.006"), 138 - DMI_MATCH(DMI_PRODUCT_NAME, "L4R"), 139 - DMI_MATCH(DMI_BOARD_NAME, "L4R") }, NULL}, 140 - { 141 - print_ecdt_error, "Asus M6R", { 142 - DMI_MATCH(DMI_BIOS_VERSION, "0207"), 143 - DMI_MATCH(DMI_PRODUCT_NAME, "M6R"), 144 - DMI_MATCH(DMI_BOARD_NAME, "M6R") }, NULL}, 145 - {}, 146 - }; 147 - 148 123 /* -------------------------------------------------------------------------- 149 124 Transaction Management 150 125 -------------------------------------------------------------------------- */ ··· 958 983 int __init acpi_ec_ecdt_probe(void) 959 984 { 960 985 acpi_status status; 986 + struct acpi_ec *saved_ec = NULL; 961 987 struct acpi_table_ecdt *ecdt_ptr; 962 - acpi_handle dummy; 963 988 964 989 boot_ec = make_acpi_ec(); 965 990 if (!boot_ec) ··· 973 998 pr_info(PREFIX "EC description table is found, configuring boot EC\n"); 974 999 boot_ec->command_addr = ecdt_ptr->control.address; 975 1000 boot_ec->data_addr = ecdt_ptr->data.address; 976 - if (dmi_check_system(ec_dmi_table)) { 977 - /* 978 - * If the board falls into ec_dmi_table, it means 979 - * that ECDT table gives the incorrect command/status 980 - * & data I/O address. Just fix it. 981 - */ 982 - boot_ec->data_addr = ecdt_ptr->control.address; 983 - boot_ec->command_addr = ecdt_ptr->data.address; 984 - } 985 1001 boot_ec->gpe = ecdt_ptr->gpe; 986 1002 boot_ec->handle = ACPI_ROOT_OBJECT; 987 1003 acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle); 988 - /* Add some basic check against completely broken table */ 989 - if (boot_ec->data_addr != boot_ec->command_addr) 1004 + /* Don't trust ECDT, which comes from ASUSTek */ 1005 + if (!dmi_name_in_vendors("ASUS")) 990 1006 goto install; 1007 + saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 1008 + if (!saved_ec) 1009 + return -ENOMEM; 1010 + memcpy(&saved_ec, boot_ec, sizeof(saved_ec)); 991 1011 /* fall through */ 992 1012 } 993 1013 /* This workaround is needed only on some broken machines, ··· 993 1023 /* Check that acpi_get_devices actually find something */ 994 1024 if (ACPI_FAILURE(status) || !boot_ec->handle) 995 1025 goto error; 996 - /* We really need to limit this workaround, the only ASUS, 997 - * which needs it, has fake EC._INI method, so use it as flag. 998 - * Keep boot_ec struct as it will be needed soon. 999 - */ 1000 - if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy))) 1001 - return -ENODEV; 1026 + if (saved_ec) { 1027 + /* try to find good ECDT from ASUSTek */ 1028 + if (saved_ec->command_addr != boot_ec->command_addr || 1029 + saved_ec->data_addr != boot_ec->data_addr || 1030 + saved_ec->gpe != boot_ec->gpe || 1031 + saved_ec->handle != boot_ec->handle) 1032 + pr_info(PREFIX "ASUSTek keeps feeding us with broken " 1033 + "ECDT tables, which are very hard to workaround. " 1034 + "Trying to use DSDT EC info instead. Please send " 1035 + "output of acpidump to linux-acpi@vger.kernel.org\n"); 1036 + kfree(saved_ec); 1037 + saved_ec = NULL; 1038 + } else { 1039 + /* We really need to limit this workaround, the only ASUS, 1040 + * which needs it, has fake EC._INI method, so use it as flag. 1041 + * Keep boot_ec struct as it will be needed soon. 1042 + */ 1043 + acpi_handle dummy; 1044 + if (!dmi_name_in_vendors("ASUS") || 1045 + ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", 1046 + &dummy))) 1047 + return -ENODEV; 1048 + } 1002 1049 install: 1003 1050 if (!ec_install_handlers(boot_ec)) { 1004 1051 first_ec = boot_ec;
drivers/acpi/main.c drivers/acpi/sleep.c
+12 -4
drivers/acpi/thermal.c
··· 416 416 } 417 417 418 418 /* Passive (optional) */ 419 - if (flag & ACPI_TRIPS_PASSIVE) { 419 + if (((flag & ACPI_TRIPS_PASSIVE) && tz->trips.passive.flags.valid) || 420 + (flag == ACPI_TRIPS_INIT)) { 420 421 valid = tz->trips.passive.flags.valid; 421 422 if (psv == -1) { 422 423 status = AE_SUPPORT; ··· 463 462 memset(&devices, 0, sizeof(struct acpi_handle_list)); 464 463 status = acpi_evaluate_reference(tz->device->handle, "_PSL", 465 464 NULL, &devices); 466 - if (ACPI_FAILURE(status)) 465 + if (ACPI_FAILURE(status)) { 466 + printk(KERN_WARNING PREFIX 467 + "Invalid passive threshold\n"); 467 468 tz->trips.passive.flags.valid = 0; 469 + } 468 470 else 469 471 tz->trips.passive.flags.valid = 1; 470 472 ··· 491 487 if (act == -1) 492 488 break; /* disable all active trip points */ 493 489 494 - if (flag & ACPI_TRIPS_ACTIVE) { 490 + if ((flag == ACPI_TRIPS_INIT) || ((flag & ACPI_TRIPS_ACTIVE) && 491 + tz->trips.active[i].flags.valid)) { 495 492 status = acpi_evaluate_integer(tz->device->handle, 496 493 name, NULL, &tmp); 497 494 if (ACPI_FAILURE(status)) { ··· 526 521 memset(&devices, 0, sizeof(struct acpi_handle_list)); 527 522 status = acpi_evaluate_reference(tz->device->handle, 528 523 name, NULL, &devices); 529 - if (ACPI_FAILURE(status)) 524 + if (ACPI_FAILURE(status)) { 525 + printk(KERN_WARNING PREFIX 526 + "Invalid active%d threshold\n", i); 530 527 tz->trips.active[i].flags.valid = 0; 528 + } 531 529 else 532 530 tz->trips.active[i].flags.valid = 1; 533 531
-1
drivers/misc/Makefile
··· 10 10 obj-$(CONFIG_ICS932S401) += ics932s401.o 11 11 obj-$(CONFIG_LKDTM) += lkdtm.o 12 12 obj-$(CONFIG_TIFM_CORE) += tifm_core.o 13 - obj-$(CONFIG_DELL_LAPTOP) += dell-laptop.o 14 13 obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o 15 14 obj-$(CONFIG_PHANTOM) += phantom.o 16 15 obj-$(CONFIG_SGI_IOC4) += ioc4.o
+1 -1
drivers/misc/dell-laptop.c drivers/platform/x86/dell-laptop.c
··· 22 22 #include <linux/rfkill.h> 23 23 #include <linux/power_supply.h> 24 24 #include <linux/acpi.h> 25 - #include "../firmware/dcdbas.h" 25 + #include "../../firmware/dcdbas.h" 26 26 27 27 #define BRIGHTNESS_TOKEN 0x7d 28 28
+2
drivers/pci/hotplug/acpiphp_glue.c
··· 266 266 int found = acpi_pci_detect_ejectable(pbus); 267 267 if (!found) { 268 268 acpi_handle bridge_handle = acpi_pci_get_bridge_handle(pbus); 269 + if (!bridge_handle) 270 + return 0; 269 271 acpi_walk_namespace(ACPI_TYPE_DEVICE, bridge_handle, (u32)1, 270 272 is_pci_dock_device, (void *)&found, NULL); 271 273 }
+23
drivers/platform/x86/Kconfig
··· 54 54 55 55 If you have an ACPI-compatible ASUS laptop, say Y or M here. 56 56 57 + config DELL_LAPTOP 58 + tristate "Dell Laptop Extras (EXPERIMENTAL)" 59 + depends on X86 60 + depends on DCDBAS 61 + depends on EXPERIMENTAL 62 + depends on BACKLIGHT_CLASS_DEVICE 63 + depends on RFKILL 64 + default n 65 + ---help--- 66 + This driver adds support for rfkill and backlight control to Dell 67 + laptops. 68 + 57 69 config FUJITSU_LAPTOP 58 70 tristate "Fujitsu Laptop Extras" 59 71 depends on ACPI ··· 203 191 This driver was formerly known as ibm-acpi. 204 192 205 193 If you have an IBM or Lenovo ThinkPad laptop, say Y or M here. 194 + 195 + config THINKPAD_ACPI_DEBUGFACILITIES 196 + bool "Maintainer debug facilities" 197 + depends on THINKPAD_ACPI 198 + default n 199 + ---help--- 200 + Enables extra stuff in the thinkpad-acpi which is completely useless 201 + for normal use. Read the driver source to find out what it does. 202 + 203 + Say N here, unless you were told by a kernel maintainer to do 204 + otherwise. 206 205 207 206 config THINKPAD_ACPI_DEBUG 208 207 bool "Verbose debug mode"
+1
drivers/platform/x86/Makefile
··· 6 6 obj-$(CONFIG_EEEPC_LAPTOP) += eeepc-laptop.o 7 7 obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o 8 8 obj-$(CONFIG_COMPAL_LAPTOP) += compal-laptop.o 9 + obj-$(CONFIG_DELL_LAPTOP) += dell-laptop.o 9 10 obj-$(CONFIG_ACER_WMI) += acer-wmi.o 10 11 obj-$(CONFIG_HP_WMI) += hp-wmi.o 11 12 obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o
+2 -2
drivers/platform/x86/eeepc-laptop.c
··· 90 90 }; 91 91 92 92 static const char *cm_getv[] = { 93 - "WLDG", NULL, NULL, NULL, 93 + "WLDG", "BTHG", NULL, NULL, 94 94 "CAMG", NULL, NULL, NULL, 95 95 NULL, "PBLG", NULL, NULL, 96 96 "CFVG", NULL, NULL, NULL, ··· 99 99 }; 100 100 101 101 static const char *cm_setv[] = { 102 - "WLDS", NULL, NULL, NULL, 102 + "WLDS", "BTHS", NULL, NULL, 103 103 "CAMS", NULL, NULL, NULL, 104 104 "SDSP", "PBLS", "HDPS", NULL, 105 105 "CFVS", NULL, NULL, NULL,
+758 -152
drivers/platform/x86/thinkpad_acpi.c
··· 21 21 * 02110-1301, USA. 22 22 */ 23 23 24 - #define TPACPI_VERSION "0.21" 24 + #define TPACPI_VERSION "0.22" 25 25 #define TPACPI_SYSFS_VERSION 0x020200 26 26 27 27 /* ··· 122 122 #define TPACPI_HKEY_INPUT_PRODUCT 0x5054 /* "TP" */ 123 123 #define TPACPI_HKEY_INPUT_VERSION 0x4101 124 124 125 + /* ACPI \WGSV commands */ 126 + enum { 127 + TP_ACPI_WGSV_GET_STATE = 0x01, /* Get state information */ 128 + TP_ACPI_WGSV_PWR_ON_ON_RESUME = 0x02, /* Resume WWAN powered on */ 129 + TP_ACPI_WGSV_PWR_OFF_ON_RESUME = 0x03, /* Resume WWAN powered off */ 130 + TP_ACPI_WGSV_SAVE_STATE = 0x04, /* Save state for S4/S5 */ 131 + }; 132 + 133 + /* TP_ACPI_WGSV_GET_STATE bits */ 134 + enum { 135 + TP_ACPI_WGSV_STATE_WWANEXIST = 0x0001, /* WWAN hw available */ 136 + TP_ACPI_WGSV_STATE_WWANPWR = 0x0002, /* WWAN radio enabled */ 137 + TP_ACPI_WGSV_STATE_WWANPWRRES = 0x0004, /* WWAN state at resume */ 138 + TP_ACPI_WGSV_STATE_WWANBIOSOFF = 0x0008, /* WWAN disabled in BIOS */ 139 + TP_ACPI_WGSV_STATE_BLTHEXIST = 0x0001, /* BLTH hw available */ 140 + TP_ACPI_WGSV_STATE_BLTHPWR = 0x0002, /* BLTH radio enabled */ 141 + TP_ACPI_WGSV_STATE_BLTHPWRRES = 0x0004, /* BLTH state at resume */ 142 + TP_ACPI_WGSV_STATE_BLTHBIOSOFF = 0x0008, /* BLTH disabled in BIOS */ 143 + TP_ACPI_WGSV_STATE_UWBEXIST = 0x0010, /* UWB hw available */ 144 + TP_ACPI_WGSV_STATE_UWBPWR = 0x0020, /* UWB radio enabled */ 145 + }; 125 146 126 147 /**************************************************************************** 127 148 * Main driver ··· 169 148 enum { 170 149 TPACPI_RFK_BLUETOOTH_SW_ID = 0, 171 150 TPACPI_RFK_WWAN_SW_ID, 151 + TPACPI_RFK_UWB_SW_ID, 172 152 }; 173 153 174 154 /* Debugging */ 175 155 #define TPACPI_LOG TPACPI_FILE ": " 176 - #define TPACPI_ERR KERN_ERR TPACPI_LOG 177 - #define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG 178 - #define TPACPI_INFO KERN_INFO TPACPI_LOG 179 - #define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG 156 + #define TPACPI_ALERT KERN_ALERT TPACPI_LOG 157 + #define TPACPI_CRIT KERN_CRIT TPACPI_LOG 158 + #define TPACPI_ERR KERN_ERR TPACPI_LOG 159 + #define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG 160 + #define TPACPI_INFO KERN_INFO TPACPI_LOG 161 + #define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG 180 162 181 163 #define TPACPI_DBG_ALL 0xffff 182 164 #define TPACPI_DBG_INIT 0x0001 ··· 225 201 void (*exit) (void); 226 202 void (*resume) (void); 227 203 void (*suspend) (pm_message_t state); 204 + void (*shutdown) (void); 228 205 229 206 struct list_head all_drivers; 230 207 ··· 264 239 u32 bright_16levels:1; 265 240 u32 bright_acpimode:1; 266 241 u32 wan:1; 242 + u32 uwb:1; 267 243 u32 fan_ctrl_status_undef:1; 268 244 u32 input_device_registered:1; 269 245 u32 platform_drv_registered:1; ··· 313 287 enum led_brightness new_brightness; 314 288 unsigned int led; 315 289 }; 290 + 291 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 292 + static int dbg_wlswemul; 293 + static int tpacpi_wlsw_emulstate; 294 + static int dbg_bluetoothemul; 295 + static int tpacpi_bluetooth_emulstate; 296 + static int dbg_wwanemul; 297 + static int tpacpi_wwan_emulstate; 298 + static int dbg_uwbemul; 299 + static int tpacpi_uwb_emulstate; 300 + #endif 301 + 316 302 317 303 /**************************************************************************** 318 304 **************************************************************************** ··· 766 728 return 0; 767 729 } 768 730 731 + static void tpacpi_shutdown_handler(struct platform_device *pdev) 732 + { 733 + struct ibm_struct *ibm, *itmp; 734 + 735 + list_for_each_entry_safe(ibm, itmp, 736 + &tpacpi_all_drivers, 737 + all_drivers) { 738 + if (ibm->shutdown) 739 + (ibm->shutdown)(); 740 + } 741 + } 742 + 769 743 static struct platform_driver tpacpi_pdriver = { 770 744 .driver = { 771 745 .name = TPACPI_DRVR_NAME, ··· 785 735 }, 786 736 .suspend = tpacpi_suspend_handler, 787 737 .resume = tpacpi_resume_handler, 738 + .shutdown = tpacpi_shutdown_handler, 788 739 }; 789 740 790 741 static struct platform_driver tpacpi_hwmon_pdriver = { ··· 973 922 struct rfkill **rfk, 974 923 const enum rfkill_type rfktype, 975 924 const char *name, 925 + const bool set_default, 976 926 int (*toggle_radio)(void *, enum rfkill_state), 977 927 int (*get_state)(void *, enum rfkill_state *)) 978 928 { 979 929 int res; 980 - enum rfkill_state initial_state; 930 + enum rfkill_state initial_state = RFKILL_STATE_SOFT_BLOCKED; 931 + 932 + res = get_state(NULL, &initial_state); 933 + if (res < 0) { 934 + printk(TPACPI_ERR 935 + "failed to read initial state for %s, error %d; " 936 + "will turn radio off\n", name, res); 937 + } else if (set_default) { 938 + /* try to set the initial state as the default for the rfkill 939 + * type, since we ask the firmware to preserve it across S5 in 940 + * NVRAM */ 941 + rfkill_set_default(rfktype, 942 + (initial_state == RFKILL_STATE_UNBLOCKED) ? 943 + RFKILL_STATE_UNBLOCKED : 944 + RFKILL_STATE_SOFT_BLOCKED); 945 + } 981 946 982 947 *rfk = rfkill_allocate(&tpacpi_pdev->dev, rfktype); 983 948 if (!*rfk) { ··· 1005 938 (*rfk)->name = name; 1006 939 (*rfk)->get_state = get_state; 1007 940 (*rfk)->toggle_radio = toggle_radio; 1008 - 1009 - if (!get_state(NULL, &initial_state)) 1010 - (*rfk)->state = initial_state; 941 + (*rfk)->state = initial_state; 1011 942 1012 943 res = rfkill_register(*rfk); 1013 944 if (res < 0) { ··· 1071 1006 1072 1007 /* --------------------------------------------------------------------- */ 1073 1008 1009 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 1010 + 1011 + static void tpacpi_send_radiosw_update(void); 1012 + 1013 + /* wlsw_emulstate ------------------------------------------------------ */ 1014 + static ssize_t tpacpi_driver_wlsw_emulstate_show(struct device_driver *drv, 1015 + char *buf) 1016 + { 1017 + return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_wlsw_emulstate); 1018 + } 1019 + 1020 + static ssize_t tpacpi_driver_wlsw_emulstate_store(struct device_driver *drv, 1021 + const char *buf, size_t count) 1022 + { 1023 + unsigned long t; 1024 + 1025 + if (parse_strtoul(buf, 1, &t)) 1026 + return -EINVAL; 1027 + 1028 + if (tpacpi_wlsw_emulstate != t) { 1029 + tpacpi_wlsw_emulstate = !!t; 1030 + tpacpi_send_radiosw_update(); 1031 + } else 1032 + tpacpi_wlsw_emulstate = !!t; 1033 + 1034 + return count; 1035 + } 1036 + 1037 + static DRIVER_ATTR(wlsw_emulstate, S_IWUSR | S_IRUGO, 1038 + tpacpi_driver_wlsw_emulstate_show, 1039 + tpacpi_driver_wlsw_emulstate_store); 1040 + 1041 + /* bluetooth_emulstate ------------------------------------------------- */ 1042 + static ssize_t tpacpi_driver_bluetooth_emulstate_show( 1043 + struct device_driver *drv, 1044 + char *buf) 1045 + { 1046 + return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_bluetooth_emulstate); 1047 + } 1048 + 1049 + static ssize_t tpacpi_driver_bluetooth_emulstate_store( 1050 + struct device_driver *drv, 1051 + const char *buf, size_t count) 1052 + { 1053 + unsigned long t; 1054 + 1055 + if (parse_strtoul(buf, 1, &t)) 1056 + return -EINVAL; 1057 + 1058 + tpacpi_bluetooth_emulstate = !!t; 1059 + 1060 + return count; 1061 + } 1062 + 1063 + static DRIVER_ATTR(bluetooth_emulstate, S_IWUSR | S_IRUGO, 1064 + tpacpi_driver_bluetooth_emulstate_show, 1065 + tpacpi_driver_bluetooth_emulstate_store); 1066 + 1067 + /* wwan_emulstate ------------------------------------------------- */ 1068 + static ssize_t tpacpi_driver_wwan_emulstate_show( 1069 + struct device_driver *drv, 1070 + char *buf) 1071 + { 1072 + return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_wwan_emulstate); 1073 + } 1074 + 1075 + static ssize_t tpacpi_driver_wwan_emulstate_store( 1076 + struct device_driver *drv, 1077 + const char *buf, size_t count) 1078 + { 1079 + unsigned long t; 1080 + 1081 + if (parse_strtoul(buf, 1, &t)) 1082 + return -EINVAL; 1083 + 1084 + tpacpi_wwan_emulstate = !!t; 1085 + 1086 + return count; 1087 + } 1088 + 1089 + static DRIVER_ATTR(wwan_emulstate, S_IWUSR | S_IRUGO, 1090 + tpacpi_driver_wwan_emulstate_show, 1091 + tpacpi_driver_wwan_emulstate_store); 1092 + 1093 + /* uwb_emulstate ------------------------------------------------- */ 1094 + static ssize_t tpacpi_driver_uwb_emulstate_show( 1095 + struct device_driver *drv, 1096 + char *buf) 1097 + { 1098 + return snprintf(buf, PAGE_SIZE, "%d\n", !!tpacpi_uwb_emulstate); 1099 + } 1100 + 1101 + static ssize_t tpacpi_driver_uwb_emulstate_store( 1102 + struct device_driver *drv, 1103 + const char *buf, size_t count) 1104 + { 1105 + unsigned long t; 1106 + 1107 + if (parse_strtoul(buf, 1, &t)) 1108 + return -EINVAL; 1109 + 1110 + tpacpi_uwb_emulstate = !!t; 1111 + 1112 + return count; 1113 + } 1114 + 1115 + static DRIVER_ATTR(uwb_emulstate, S_IWUSR | S_IRUGO, 1116 + tpacpi_driver_uwb_emulstate_show, 1117 + tpacpi_driver_uwb_emulstate_store); 1118 + #endif 1119 + 1120 + /* --------------------------------------------------------------------- */ 1121 + 1074 1122 static struct driver_attribute *tpacpi_driver_attributes[] = { 1075 1123 &driver_attr_debug_level, &driver_attr_version, 1076 1124 &driver_attr_interface_version, ··· 1200 1022 i++; 1201 1023 } 1202 1024 1025 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 1026 + if (!res && dbg_wlswemul) 1027 + res = driver_create_file(drv, &driver_attr_wlsw_emulstate); 1028 + if (!res && dbg_bluetoothemul) 1029 + res = driver_create_file(drv, &driver_attr_bluetooth_emulstate); 1030 + if (!res && dbg_wwanemul) 1031 + res = driver_create_file(drv, &driver_attr_wwan_emulstate); 1032 + if (!res && dbg_uwbemul) 1033 + res = driver_create_file(drv, &driver_attr_uwb_emulstate); 1034 + #endif 1035 + 1203 1036 return res; 1204 1037 } 1205 1038 ··· 1220 1031 1221 1032 for (i = 0; i < ARRAY_SIZE(tpacpi_driver_attributes); i++) 1222 1033 driver_remove_file(drv, tpacpi_driver_attributes[i]); 1034 + 1035 + #ifdef THINKPAD_ACPI_DEBUGFACILITIES 1036 + driver_remove_file(drv, &driver_attr_wlsw_emulstate); 1037 + driver_remove_file(drv, &driver_attr_bluetooth_emulstate); 1038 + driver_remove_file(drv, &driver_attr_wwan_emulstate); 1039 + driver_remove_file(drv, &driver_attr_uwb_emulstate); 1040 + #endif 1223 1041 } 1224 1042 1225 1043 /**************************************************************************** ··· 1412 1216 1413 1217 static int hotkey_get_wlsw(int *status) 1414 1218 { 1219 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 1220 + if (dbg_wlswemul) { 1221 + *status = !!tpacpi_wlsw_emulstate; 1222 + return 0; 1223 + } 1224 + #endif 1415 1225 if (!acpi_evalf(hkey_handle, status, "WLSW", "d")) 1416 1226 return -EIO; 1417 1227 return 0; ··· 1880 1678 { 1881 1679 int res; 1882 1680 1883 - if (mutex_lock_interruptible(&hotkey_mutex)) 1681 + if (mutex_lock_killable(&hotkey_mutex)) 1884 1682 return -ERESTARTSYS; 1885 1683 res = hotkey_mask_get(); 1886 1684 mutex_unlock(&hotkey_mutex); ··· 1899 1697 if (parse_strtoul(buf, 0xffffffffUL, &t)) 1900 1698 return -EINVAL; 1901 1699 1902 - if (mutex_lock_interruptible(&hotkey_mutex)) 1700 + if (mutex_lock_killable(&hotkey_mutex)) 1903 1701 return -ERESTARTSYS; 1904 1702 1905 1703 res = hotkey_mask_set(t); ··· 1985 1783 ((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0)) 1986 1784 return -EINVAL; 1987 1785 1988 - if (mutex_lock_interruptible(&hotkey_mutex)) 1786 + if (mutex_lock_killable(&hotkey_mutex)) 1989 1787 return -ERESTARTSYS; 1990 1788 1991 1789 HOTKEY_CONFIG_CRITICAL_START ··· 2020 1818 if (parse_strtoul(buf, 25, &t)) 2021 1819 return -EINVAL; 2022 1820 2023 - if (mutex_lock_interruptible(&hotkey_mutex)) 1821 + if (mutex_lock_killable(&hotkey_mutex)) 2024 1822 return -ERESTARTSYS; 2025 1823 2026 1824 hotkey_poll_freq = t; ··· 2160 1958 2161 1959 static void bluetooth_update_rfk(void); 2162 1960 static void wan_update_rfk(void); 1961 + static void uwb_update_rfk(void); 2163 1962 static void tpacpi_send_radiosw_update(void) 2164 1963 { 2165 1964 int wlsw; ··· 2170 1967 bluetooth_update_rfk(); 2171 1968 if (tp_features.wan) 2172 1969 wan_update_rfk(); 1970 + if (tp_features.uwb) 1971 + uwb_update_rfk(); 2173 1972 2174 1973 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { 2175 1974 mutex_lock(&tpacpi_inputdev_send_mutex); ··· 2427 2222 hotkey_source_mask, hotkey_poll_freq); 2428 2223 #endif 2429 2224 2225 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 2226 + if (dbg_wlswemul) { 2227 + tp_features.hotkey_wlsw = 1; 2228 + printk(TPACPI_INFO 2229 + "radio switch emulation enabled\n"); 2230 + } else 2231 + #endif 2430 2232 /* Not all thinkpads have a hardware radio switch */ 2431 2233 if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) { 2432 2234 tp_features.hotkey_wlsw = 1; ··· 2573 2361 return (res < 0)? res : 1; 2574 2362 } 2575 2363 2364 + static bool hotkey_notify_hotkey(const u32 hkey, 2365 + bool *send_acpi_ev, 2366 + bool *ignore_acpi_ev) 2367 + { 2368 + /* 0x1000-0x1FFF: key presses */ 2369 + unsigned int scancode = hkey & 0xfff; 2370 + *send_acpi_ev = true; 2371 + *ignore_acpi_ev = false; 2372 + 2373 + if (scancode > 0 && scancode < 0x21) { 2374 + scancode--; 2375 + if (!(hotkey_source_mask & (1 << scancode))) { 2376 + tpacpi_input_send_key(scancode); 2377 + *send_acpi_ev = false; 2378 + } else { 2379 + *ignore_acpi_ev = true; 2380 + } 2381 + return true; 2382 + } 2383 + return false; 2384 + } 2385 + 2386 + static bool hotkey_notify_wakeup(const u32 hkey, 2387 + bool *send_acpi_ev, 2388 + bool *ignore_acpi_ev) 2389 + { 2390 + /* 0x2000-0x2FFF: Wakeup reason */ 2391 + *send_acpi_ev = true; 2392 + *ignore_acpi_ev = false; 2393 + 2394 + switch (hkey) { 2395 + case 0x2304: /* suspend, undock */ 2396 + case 0x2404: /* hibernation, undock */ 2397 + hotkey_wakeup_reason = TP_ACPI_WAKEUP_UNDOCK; 2398 + *ignore_acpi_ev = true; 2399 + break; 2400 + 2401 + case 0x2305: /* suspend, bay eject */ 2402 + case 0x2405: /* hibernation, bay eject */ 2403 + hotkey_wakeup_reason = TP_ACPI_WAKEUP_BAYEJ; 2404 + *ignore_acpi_ev = true; 2405 + break; 2406 + 2407 + case 0x2313: /* Battery on critical low level (S3) */ 2408 + case 0x2413: /* Battery on critical low level (S4) */ 2409 + printk(TPACPI_ALERT 2410 + "EMERGENCY WAKEUP: battery almost empty\n"); 2411 + /* how to auto-heal: */ 2412 + /* 2313: woke up from S3, go to S4/S5 */ 2413 + /* 2413: woke up from S4, go to S5 */ 2414 + break; 2415 + 2416 + default: 2417 + return false; 2418 + } 2419 + 2420 + if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) { 2421 + printk(TPACPI_INFO 2422 + "woke up due to a hot-unplug " 2423 + "request...\n"); 2424 + hotkey_wakeup_reason_notify_change(); 2425 + } 2426 + return true; 2427 + } 2428 + 2429 + static bool hotkey_notify_usrevent(const u32 hkey, 2430 + bool *send_acpi_ev, 2431 + bool *ignore_acpi_ev) 2432 + { 2433 + /* 0x5000-0x5FFF: human interface helpers */ 2434 + *send_acpi_ev = true; 2435 + *ignore_acpi_ev = false; 2436 + 2437 + switch (hkey) { 2438 + case 0x5010: /* Lenovo new BIOS: brightness changed */ 2439 + case 0x500b: /* X61t: tablet pen inserted into bay */ 2440 + case 0x500c: /* X61t: tablet pen removed from bay */ 2441 + return true; 2442 + 2443 + case 0x5009: /* X41t-X61t: swivel up (tablet mode) */ 2444 + case 0x500a: /* X41t-X61t: swivel down (normal mode) */ 2445 + tpacpi_input_send_tabletsw(); 2446 + hotkey_tablet_mode_notify_change(); 2447 + *send_acpi_ev = false; 2448 + return true; 2449 + 2450 + case 0x5001: 2451 + case 0x5002: 2452 + /* LID switch events. Do not propagate */ 2453 + *ignore_acpi_ev = true; 2454 + return true; 2455 + 2456 + default: 2457 + return false; 2458 + } 2459 + } 2460 + 2461 + static bool hotkey_notify_thermal(const u32 hkey, 2462 + bool *send_acpi_ev, 2463 + bool *ignore_acpi_ev) 2464 + { 2465 + /* 0x6000-0x6FFF: thermal alarms */ 2466 + *send_acpi_ev = true; 2467 + *ignore_acpi_ev = false; 2468 + 2469 + switch (hkey) { 2470 + case 0x6011: 2471 + printk(TPACPI_CRIT 2472 + "THERMAL ALARM: battery is too hot!\n"); 2473 + /* recommended action: warn user through gui */ 2474 + return true; 2475 + case 0x6012: 2476 + printk(TPACPI_ALERT 2477 + "THERMAL EMERGENCY: battery is extremely hot!\n"); 2478 + /* recommended action: immediate sleep/hibernate */ 2479 + return true; 2480 + case 0x6021: 2481 + printk(TPACPI_CRIT 2482 + "THERMAL ALARM: " 2483 + "a sensor reports something is too hot!\n"); 2484 + /* recommended action: warn user through gui, that */ 2485 + /* some internal component is too hot */ 2486 + return true; 2487 + case 0x6022: 2488 + printk(TPACPI_ALERT 2489 + "THERMAL EMERGENCY: " 2490 + "a sensor reports something is extremely hot!\n"); 2491 + /* recommended action: immediate sleep/hibernate */ 2492 + return true; 2493 + case 0x6030: 2494 + printk(TPACPI_INFO 2495 + "EC reports that Thermal Table has changed\n"); 2496 + /* recommended action: do nothing, we don't have 2497 + * Lenovo ATM information */ 2498 + return true; 2499 + default: 2500 + printk(TPACPI_ALERT 2501 + "THERMAL ALERT: unknown thermal alarm received\n"); 2502 + return false; 2503 + } 2504 + } 2505 + 2576 2506 static void hotkey_notify(struct ibm_struct *ibm, u32 event) 2577 2507 { 2578 2508 u32 hkey; 2579 - unsigned int scancode; 2580 - int send_acpi_ev; 2581 - int ignore_acpi_ev; 2582 - int unk_ev; 2509 + bool send_acpi_ev; 2510 + bool ignore_acpi_ev; 2511 + bool known_ev; 2583 2512 2584 2513 if (event != 0x80) { 2585 2514 printk(TPACPI_ERR ··· 2728 2375 /* forward it to userspace, maybe it knows how to handle it */ 2729 2376 acpi_bus_generate_netlink_event( 2730 2377 ibm->acpi->device->pnp.device_class, 2731 - ibm->acpi->device->dev.bus_id, 2378 + dev_name(&ibm->acpi->device->dev), 2732 2379 event, 0); 2733 2380 return; 2734 2381 } ··· 2744 2391 return; 2745 2392 } 2746 2393 2747 - send_acpi_ev = 1; 2748 - ignore_acpi_ev = 0; 2749 - unk_ev = 0; 2394 + send_acpi_ev = true; 2395 + ignore_acpi_ev = false; 2750 2396 2751 2397 switch (hkey >> 12) { 2752 2398 case 1: 2753 2399 /* 0x1000-0x1FFF: key presses */ 2754 - scancode = hkey & 0xfff; 2755 - if (scancode > 0 && scancode < 0x21) { 2756 - scancode--; 2757 - if (!(hotkey_source_mask & (1 << scancode))) { 2758 - tpacpi_input_send_key(scancode); 2759 - send_acpi_ev = 0; 2760 - } else { 2761 - ignore_acpi_ev = 1; 2762 - } 2763 - } else { 2764 - unk_ev = 1; 2765 - } 2400 + known_ev = hotkey_notify_hotkey(hkey, &send_acpi_ev, 2401 + &ignore_acpi_ev); 2766 2402 break; 2767 2403 case 2: 2768 - /* Wakeup reason */ 2769 - switch (hkey) { 2770 - case 0x2304: /* suspend, undock */ 2771 - case 0x2404: /* hibernation, undock */ 2772 - hotkey_wakeup_reason = TP_ACPI_WAKEUP_UNDOCK; 2773 - ignore_acpi_ev = 1; 2774 - break; 2775 - case 0x2305: /* suspend, bay eject */ 2776 - case 0x2405: /* hibernation, bay eject */ 2777 - hotkey_wakeup_reason = TP_ACPI_WAKEUP_BAYEJ; 2778 - ignore_acpi_ev = 1; 2779 - break; 2780 - default: 2781 - unk_ev = 1; 2782 - } 2783 - if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) { 2784 - printk(TPACPI_INFO 2785 - "woke up due to a hot-unplug " 2786 - "request...\n"); 2787 - hotkey_wakeup_reason_notify_change(); 2788 - } 2404 + /* 0x2000-0x2FFF: Wakeup reason */ 2405 + known_ev = hotkey_notify_wakeup(hkey, &send_acpi_ev, 2406 + &ignore_acpi_ev); 2789 2407 break; 2790 2408 case 3: 2791 - /* bay-related wakeups */ 2409 + /* 0x3000-0x3FFF: bay-related wakeups */ 2792 2410 if (hkey == 0x3003) { 2793 2411 hotkey_autosleep_ack = 1; 2794 2412 printk(TPACPI_INFO 2795 2413 "bay ejected\n"); 2796 2414 hotkey_wakeup_hotunplug_complete_notify_change(); 2415 + known_ev = true; 2797 2416 } else { 2798 - unk_ev = 1; 2417 + known_ev = false; 2799 2418 } 2800 2419 break; 2801 2420 case 4: 2802 - /* dock-related wakeups */ 2421 + /* 0x4000-0x4FFF: dock-related wakeups */ 2803 2422 if (hkey == 0x4003) { 2804 2423 hotkey_autosleep_ack = 1; 2805 2424 printk(TPACPI_INFO 2806 2425 "undocked\n"); 2807 2426 hotkey_wakeup_hotunplug_complete_notify_change(); 2427 + known_ev = true; 2808 2428 } else { 2809 - unk_ev = 1; 2429 + known_ev = false; 2810 2430 } 2811 2431 break; 2812 2432 case 5: 2813 2433 /* 0x5000-0x5FFF: human interface helpers */ 2814 - switch (hkey) { 2815 - case 0x5010: /* Lenovo new BIOS: brightness changed */ 2816 - case 0x500b: /* X61t: tablet pen inserted into bay */ 2817 - case 0x500c: /* X61t: tablet pen removed from bay */ 2818 - break; 2819 - case 0x5009: /* X41t-X61t: swivel up (tablet mode) */ 2820 - case 0x500a: /* X41t-X61t: swivel down (normal mode) */ 2821 - tpacpi_input_send_tabletsw(); 2822 - hotkey_tablet_mode_notify_change(); 2823 - send_acpi_ev = 0; 2824 - break; 2825 - case 0x5001: 2826 - case 0x5002: 2827 - /* LID switch events. Do not propagate */ 2828 - ignore_acpi_ev = 1; 2829 - break; 2830 - default: 2831 - unk_ev = 1; 2832 - } 2434 + known_ev = hotkey_notify_usrevent(hkey, &send_acpi_ev, 2435 + &ignore_acpi_ev); 2436 + break; 2437 + case 6: 2438 + /* 0x6000-0x6FFF: thermal alarms */ 2439 + known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev, 2440 + &ignore_acpi_ev); 2833 2441 break; 2834 2442 case 7: 2835 2443 /* 0x7000-0x7FFF: misc */ 2836 2444 if (tp_features.hotkey_wlsw && hkey == 0x7000) { 2837 2445 tpacpi_send_radiosw_update(); 2838 2446 send_acpi_ev = 0; 2447 + known_ev = true; 2839 2448 break; 2840 2449 } 2841 2450 /* fallthrough to default */ 2842 2451 default: 2843 - unk_ev = 1; 2452 + known_ev = false; 2844 2453 } 2845 - if (unk_ev) { 2454 + if (!known_ev) { 2846 2455 printk(TPACPI_NOTICE 2847 2456 "unhandled HKEY event 0x%04x\n", hkey); 2457 + printk(TPACPI_NOTICE 2458 + "please report the conditions when this " 2459 + "event happened to %s\n", TPACPI_MAIL); 2848 2460 } 2849 2461 2850 2462 /* Legacy events */ ··· 2823 2505 if (!ignore_acpi_ev && send_acpi_ev) { 2824 2506 acpi_bus_generate_netlink_event( 2825 2507 ibm->acpi->device->pnp.device_class, 2826 - ibm->acpi->device->dev.bus_id, 2508 + dev_name(&ibm->acpi->device->dev), 2827 2509 event, hkey); 2828 2510 } 2829 2511 } ··· 2862 2544 return len; 2863 2545 } 2864 2546 2865 - if (mutex_lock_interruptible(&hotkey_mutex)) 2547 + if (mutex_lock_killable(&hotkey_mutex)) 2866 2548 return -ERESTARTSYS; 2867 2549 res = hotkey_status_get(&status); 2868 2550 if (!res) ··· 2893 2575 if (!tp_features.hotkey) 2894 2576 return -ENODEV; 2895 2577 2896 - if (mutex_lock_interruptible(&hotkey_mutex)) 2578 + if (mutex_lock_killable(&hotkey_mutex)) 2897 2579 return -ERESTARTSYS; 2898 2580 2899 2581 status = -1; ··· 2958 2640 /* ACPI GBDC/SBDC bits */ 2959 2641 TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ 2960 2642 TP_ACPI_BLUETOOTH_RADIOSSW = 0x02, /* Bluetooth radio enabled */ 2961 - TP_ACPI_BLUETOOTH_UNK = 0x04, /* unknown function */ 2643 + TP_ACPI_BLUETOOTH_RESUMECTRL = 0x04, /* Bluetooth state at resume: 2644 + off / last state */ 2645 + }; 2646 + 2647 + enum { 2648 + /* ACPI \BLTH commands */ 2649 + TP_ACPI_BLTH_GET_ULTRAPORT_ID = 0x00, /* Get Ultraport BT ID */ 2650 + TP_ACPI_BLTH_GET_PWR_ON_RESUME = 0x01, /* Get power-on-resume state */ 2651 + TP_ACPI_BLTH_PWR_ON_ON_RESUME = 0x02, /* Resume powered on */ 2652 + TP_ACPI_BLTH_PWR_OFF_ON_RESUME = 0x03, /* Resume powered off */ 2653 + TP_ACPI_BLTH_SAVE_STATE = 0x05, /* Save state for S4/S5 */ 2962 2654 }; 2963 2655 2964 2656 static struct rfkill *tpacpi_bluetooth_rfkill; 2657 + 2658 + static void bluetooth_suspend(pm_message_t state) 2659 + { 2660 + /* Try to make sure radio will resume powered off */ 2661 + acpi_evalf(NULL, NULL, "\\BLTH", "vd", 2662 + TP_ACPI_BLTH_PWR_OFF_ON_RESUME); 2663 + } 2965 2664 2966 2665 static int bluetooth_get_radiosw(void) 2967 2666 { ··· 2990 2655 /* WLSW overrides bluetooth in firmware/hardware, reflect that */ 2991 2656 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status) 2992 2657 return RFKILL_STATE_HARD_BLOCKED; 2658 + 2659 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 2660 + if (dbg_bluetoothemul) 2661 + return (tpacpi_bluetooth_emulstate) ? 2662 + RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; 2663 + #endif 2993 2664 2994 2665 if (!acpi_evalf(hkey_handle, &status, "GBDC", "d")) 2995 2666 return -EIO; ··· 3030 2689 && radio_on) 3031 2690 return -EPERM; 3032 2691 3033 - if (!acpi_evalf(hkey_handle, &status, "GBDC", "d")) 3034 - return -EIO; 2692 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 2693 + if (dbg_bluetoothemul) { 2694 + tpacpi_bluetooth_emulstate = !!radio_on; 2695 + if (update_rfk) 2696 + bluetooth_update_rfk(); 2697 + return 0; 2698 + } 2699 + #endif 2700 + 2701 + /* We make sure to keep TP_ACPI_BLUETOOTH_RESUMECTRL off */ 3035 2702 if (radio_on) 3036 - status |= TP_ACPI_BLUETOOTH_RADIOSSW; 2703 + status = TP_ACPI_BLUETOOTH_RADIOSSW; 3037 2704 else 3038 - status &= ~TP_ACPI_BLUETOOTH_RADIOSSW; 2705 + status = 0; 3039 2706 if (!acpi_evalf(hkey_handle, NULL, "SBDC", "vd", status)) 3040 2707 return -EIO; 3041 2708 ··· 3114 2765 return bluetooth_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0); 3115 2766 } 3116 2767 2768 + static void bluetooth_shutdown(void) 2769 + { 2770 + /* Order firmware to save current state to NVRAM */ 2771 + if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd", 2772 + TP_ACPI_BLTH_SAVE_STATE)) 2773 + printk(TPACPI_NOTICE 2774 + "failed to save bluetooth state to NVRAM\n"); 2775 + } 2776 + 3117 2777 static void bluetooth_exit(void) 3118 2778 { 2779 + bluetooth_shutdown(); 2780 + 3119 2781 if (tpacpi_bluetooth_rfkill) 3120 2782 rfkill_unregister(tpacpi_bluetooth_rfkill); 3121 2783 ··· 3152 2792 str_supported(tp_features.bluetooth), 3153 2793 status); 3154 2794 2795 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 2796 + if (dbg_bluetoothemul) { 2797 + tp_features.bluetooth = 1; 2798 + printk(TPACPI_INFO 2799 + "bluetooth switch emulation enabled\n"); 2800 + } else 2801 + #endif 3155 2802 if (tp_features.bluetooth && 3156 2803 !(status & TP_ACPI_BLUETOOTH_HWPRESENT)) { 3157 2804 /* no bluetooth hardware present in system */ ··· 3179 2812 &tpacpi_bluetooth_rfkill, 3180 2813 RFKILL_TYPE_BLUETOOTH, 3181 2814 "tpacpi_bluetooth_sw", 2815 + true, 3182 2816 tpacpi_bluetooth_rfk_set, 3183 2817 tpacpi_bluetooth_rfk_get); 3184 2818 if (res) { ··· 3232 2864 .read = bluetooth_read, 3233 2865 .write = bluetooth_write, 3234 2866 .exit = bluetooth_exit, 2867 + .suspend = bluetooth_suspend, 2868 + .shutdown = bluetooth_shutdown, 3235 2869 }; 3236 2870 3237 2871 /************************************************************************* ··· 3244 2874 /* ACPI GWAN/SWAN bits */ 3245 2875 TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ 3246 2876 TP_ACPI_WANCARD_RADIOSSW = 0x02, /* Wan radio enabled */ 3247 - TP_ACPI_WANCARD_UNK = 0x04, /* unknown function */ 2877 + TP_ACPI_WANCARD_RESUMECTRL = 0x04, /* Wan state at resume: 2878 + off / last state */ 3248 2879 }; 3249 2880 3250 2881 static struct rfkill *tpacpi_wan_rfkill; 2882 + 2883 + static void wan_suspend(pm_message_t state) 2884 + { 2885 + /* Try to make sure radio will resume powered off */ 2886 + acpi_evalf(NULL, NULL, "\\WGSV", "qvd", 2887 + TP_ACPI_WGSV_PWR_OFF_ON_RESUME); 2888 + } 3251 2889 3252 2890 static int wan_get_radiosw(void) 3253 2891 { ··· 3267 2889 /* WLSW overrides WWAN in firmware/hardware, reflect that */ 3268 2890 if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status) 3269 2891 return RFKILL_STATE_HARD_BLOCKED; 2892 + 2893 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 2894 + if (dbg_wwanemul) 2895 + return (tpacpi_wwan_emulstate) ? 2896 + RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; 2897 + #endif 3270 2898 3271 2899 if (!acpi_evalf(hkey_handle, &status, "GWAN", "d")) 3272 2900 return -EIO; ··· 3307 2923 && radio_on) 3308 2924 return -EPERM; 3309 2925 3310 - if (!acpi_evalf(hkey_handle, &status, "GWAN", "d")) 3311 - return -EIO; 2926 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 2927 + if (dbg_wwanemul) { 2928 + tpacpi_wwan_emulstate = !!radio_on; 2929 + if (update_rfk) 2930 + wan_update_rfk(); 2931 + return 0; 2932 + } 2933 + #endif 2934 + 2935 + /* We make sure to keep TP_ACPI_WANCARD_RESUMECTRL off */ 3312 2936 if (radio_on) 3313 - status |= TP_ACPI_WANCARD_RADIOSSW; 2937 + status = TP_ACPI_WANCARD_RADIOSSW; 3314 2938 else 3315 - status &= ~TP_ACPI_WANCARD_RADIOSSW; 2939 + status = 0; 3316 2940 if (!acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status)) 3317 2941 return -EIO; 3318 2942 ··· 3391 2999 return wan_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0); 3392 3000 } 3393 3001 3002 + static void wan_shutdown(void) 3003 + { 3004 + /* Order firmware to save current state to NVRAM */ 3005 + if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd", 3006 + TP_ACPI_WGSV_SAVE_STATE)) 3007 + printk(TPACPI_NOTICE 3008 + "failed to save WWAN state to NVRAM\n"); 3009 + } 3010 + 3394 3011 static void wan_exit(void) 3395 3012 { 3013 + wan_shutdown(); 3014 + 3396 3015 if (tpacpi_wan_rfkill) 3397 3016 rfkill_unregister(tpacpi_wan_rfkill); 3398 3017 ··· 3427 3024 str_supported(tp_features.wan), 3428 3025 status); 3429 3026 3027 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 3028 + if (dbg_wwanemul) { 3029 + tp_features.wan = 1; 3030 + printk(TPACPI_INFO 3031 + "wwan switch emulation enabled\n"); 3032 + } else 3033 + #endif 3430 3034 if (tp_features.wan && 3431 3035 !(status & TP_ACPI_WANCARD_HWPRESENT)) { 3432 3036 /* no wan hardware present in system */ ··· 3454 3044 &tpacpi_wan_rfkill, 3455 3045 RFKILL_TYPE_WWAN, 3456 3046 "tpacpi_wwan_sw", 3047 + true, 3457 3048 tpacpi_wan_rfk_set, 3458 3049 tpacpi_wan_rfk_get); 3459 3050 if (res) { ··· 3507 3096 .read = wan_read, 3508 3097 .write = wan_write, 3509 3098 .exit = wan_exit, 3099 + .suspend = wan_suspend, 3100 + .shutdown = wan_shutdown, 3101 + }; 3102 + 3103 + /************************************************************************* 3104 + * UWB subdriver 3105 + */ 3106 + 3107 + enum { 3108 + /* ACPI GUWB/SUWB bits */ 3109 + TP_ACPI_UWB_HWPRESENT = 0x01, /* UWB hw available */ 3110 + TP_ACPI_UWB_RADIOSSW = 0x02, /* UWB radio enabled */ 3111 + }; 3112 + 3113 + static struct rfkill *tpacpi_uwb_rfkill; 3114 + 3115 + static int uwb_get_radiosw(void) 3116 + { 3117 + int status; 3118 + 3119 + if (!tp_features.uwb) 3120 + return -ENODEV; 3121 + 3122 + /* WLSW overrides UWB in firmware/hardware, reflect that */ 3123 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status) 3124 + return RFKILL_STATE_HARD_BLOCKED; 3125 + 3126 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 3127 + if (dbg_uwbemul) 3128 + return (tpacpi_uwb_emulstate) ? 3129 + RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; 3130 + #endif 3131 + 3132 + if (!acpi_evalf(hkey_handle, &status, "GUWB", "d")) 3133 + return -EIO; 3134 + 3135 + return ((status & TP_ACPI_UWB_RADIOSSW) != 0) ? 3136 + RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; 3137 + } 3138 + 3139 + static void uwb_update_rfk(void) 3140 + { 3141 + int status; 3142 + 3143 + if (!tpacpi_uwb_rfkill) 3144 + return; 3145 + 3146 + status = uwb_get_radiosw(); 3147 + if (status < 0) 3148 + return; 3149 + rfkill_force_state(tpacpi_uwb_rfkill, status); 3150 + } 3151 + 3152 + static int uwb_set_radiosw(int radio_on, int update_rfk) 3153 + { 3154 + int status; 3155 + 3156 + if (!tp_features.uwb) 3157 + return -ENODEV; 3158 + 3159 + /* WLSW overrides UWB in firmware/hardware, but there is no 3160 + * reason to risk weird behaviour. */ 3161 + if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status 3162 + && radio_on) 3163 + return -EPERM; 3164 + 3165 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 3166 + if (dbg_uwbemul) { 3167 + tpacpi_uwb_emulstate = !!radio_on; 3168 + if (update_rfk) 3169 + uwb_update_rfk(); 3170 + return 0; 3171 + } 3172 + #endif 3173 + 3174 + status = (radio_on) ? TP_ACPI_UWB_RADIOSSW : 0; 3175 + if (!acpi_evalf(hkey_handle, NULL, "SUWB", "vd", status)) 3176 + return -EIO; 3177 + 3178 + if (update_rfk) 3179 + uwb_update_rfk(); 3180 + 3181 + return 0; 3182 + } 3183 + 3184 + /* --------------------------------------------------------------------- */ 3185 + 3186 + static int tpacpi_uwb_rfk_get(void *data, enum rfkill_state *state) 3187 + { 3188 + int uwbs = uwb_get_radiosw(); 3189 + 3190 + if (uwbs < 0) 3191 + return uwbs; 3192 + 3193 + *state = uwbs; 3194 + return 0; 3195 + } 3196 + 3197 + static int tpacpi_uwb_rfk_set(void *data, enum rfkill_state state) 3198 + { 3199 + return uwb_set_radiosw((state == RFKILL_STATE_UNBLOCKED), 0); 3200 + } 3201 + 3202 + static void uwb_exit(void) 3203 + { 3204 + if (tpacpi_uwb_rfkill) 3205 + rfkill_unregister(tpacpi_uwb_rfkill); 3206 + } 3207 + 3208 + static int __init uwb_init(struct ibm_init_struct *iibm) 3209 + { 3210 + int res; 3211 + int status = 0; 3212 + 3213 + vdbg_printk(TPACPI_DBG_INIT, "initializing uwb subdriver\n"); 3214 + 3215 + TPACPI_ACPIHANDLE_INIT(hkey); 3216 + 3217 + tp_features.uwb = hkey_handle && 3218 + acpi_evalf(hkey_handle, &status, "GUWB", "qd"); 3219 + 3220 + vdbg_printk(TPACPI_DBG_INIT, "uwb is %s, status 0x%02x\n", 3221 + str_supported(tp_features.uwb), 3222 + status); 3223 + 3224 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 3225 + if (dbg_uwbemul) { 3226 + tp_features.uwb = 1; 3227 + printk(TPACPI_INFO 3228 + "uwb switch emulation enabled\n"); 3229 + } else 3230 + #endif 3231 + if (tp_features.uwb && 3232 + !(status & TP_ACPI_UWB_HWPRESENT)) { 3233 + /* no uwb hardware present in system */ 3234 + tp_features.uwb = 0; 3235 + dbg_printk(TPACPI_DBG_INIT, 3236 + "uwb hardware not installed\n"); 3237 + } 3238 + 3239 + if (!tp_features.uwb) 3240 + return 1; 3241 + 3242 + res = tpacpi_new_rfkill(TPACPI_RFK_UWB_SW_ID, 3243 + &tpacpi_uwb_rfkill, 3244 + RFKILL_TYPE_UWB, 3245 + "tpacpi_uwb_sw", 3246 + false, 3247 + tpacpi_uwb_rfk_set, 3248 + tpacpi_uwb_rfk_get); 3249 + 3250 + return res; 3251 + } 3252 + 3253 + static struct ibm_struct uwb_driver_data = { 3254 + .name = "uwb", 3255 + .exit = uwb_exit, 3256 + .flags.experimental = 1, 3510 3257 }; 3511 3258 3512 3259 /************************************************************************* ··· 4293 3724 } 4294 3725 acpi_bus_generate_proc_event(ibm->acpi->device, event, data); 4295 3726 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, 4296 - ibm->acpi->device->dev.bus_id, 3727 + dev_name(&ibm->acpi->device->dev), 4297 3728 event, data); 4298 3729 } 4299 3730 ··· 4395 3826 { 4396 3827 acpi_bus_generate_proc_event(ibm->acpi->device, event, 0); 4397 3828 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, 4398 - ibm->acpi->device->dev.bus_id, 3829 + dev_name(&ibm->acpi->device->dev), 4399 3830 event, 0); 4400 3831 } 4401 3832 ··· 5419 4850 value < 0) 5420 4851 return -EINVAL; 5421 4852 5422 - res = mutex_lock_interruptible(&brightness_mutex); 4853 + res = mutex_lock_killable(&brightness_mutex); 5423 4854 if (res < 0) 5424 4855 return res; 5425 4856 ··· 5903 5334 ); /* all others */ 5904 5335 5905 5336 /* 5337 + * Unitialized HFSP quirk: ACPI DSDT and EC fail to initialize the 5338 + * HFSP register at boot, so it contains 0x07 but the Thinkpad could 5339 + * be in auto mode (0x80). 5340 + * 5341 + * This is corrected by any write to HFSP either by the driver, or 5342 + * by the firmware. 5343 + * 5344 + * We assume 0x07 really means auto mode while this quirk is active, 5345 + * as this is far more likely than the ThinkPad being in level 7, 5346 + * which is only used by the firmware during thermal emergencies. 5347 + */ 5348 + 5349 + static void fan_quirk1_detect(void) 5350 + { 5351 + /* In some ThinkPads, neither the EC nor the ACPI 5352 + * DSDT initialize the HFSP register, and it ends up 5353 + * being initially set to 0x07 when it *could* be 5354 + * either 0x07 or 0x80. 5355 + * 5356 + * Enable for TP-1Y (T43), TP-78 (R51e), 5357 + * TP-76 (R52), TP-70 (T43, R52), which are known 5358 + * to be buggy. */ 5359 + if (fan_control_initial_status == 0x07) { 5360 + switch (thinkpad_id.ec_model) { 5361 + case 0x5931: /* TP-1Y */ 5362 + case 0x3837: /* TP-78 */ 5363 + case 0x3637: /* TP-76 */ 5364 + case 0x3037: /* TP-70 */ 5365 + printk(TPACPI_NOTICE 5366 + "fan_init: initial fan status is unknown, " 5367 + "assuming it is in auto mode\n"); 5368 + tp_features.fan_ctrl_status_undef = 1; 5369 + ;; 5370 + } 5371 + } 5372 + } 5373 + 5374 + static void fan_quirk1_handle(u8 *fan_status) 5375 + { 5376 + if (unlikely(tp_features.fan_ctrl_status_undef)) { 5377 + if (*fan_status != fan_control_initial_status) { 5378 + /* something changed the HFSP regisnter since 5379 + * driver init time, so it is not undefined 5380 + * anymore */ 5381 + tp_features.fan_ctrl_status_undef = 0; 5382 + } else { 5383 + /* Return most likely status. In fact, it 5384 + * might be the only possible status */ 5385 + *fan_status = TP_EC_FAN_AUTO; 5386 + } 5387 + } 5388 + } 5389 + 5390 + /* 5906 5391 * Call with fan_mutex held 5907 5392 */ 5908 5393 static void fan_update_desired_level(u8 status) ··· 5994 5371 if (unlikely(!acpi_ec_read(fan_status_offset, &s))) 5995 5372 return -EIO; 5996 5373 5997 - if (likely(status)) 5374 + if (likely(status)) { 5998 5375 *status = s; 5376 + fan_quirk1_handle(status); 5377 + } 5999 5378 6000 5379 break; 6001 5380 ··· 6013 5388 int rc; 6014 5389 u8 s; 6015 5390 6016 - if (mutex_lock_interruptible(&fan_mutex)) 5391 + if (mutex_lock_killable(&fan_mutex)) 6017 5392 return -ERESTARTSYS; 6018 5393 rc = fan_get_status(&s); 6019 5394 if (!rc) ··· 6096 5471 if (!fan_control_allowed) 6097 5472 return -EPERM; 6098 5473 6099 - if (mutex_lock_interruptible(&fan_mutex)) 5474 + if (mutex_lock_killable(&fan_mutex)) 6100 5475 return -ERESTARTSYS; 6101 5476 6102 5477 if (level == TPACPI_FAN_LAST_LEVEL) ··· 6118 5493 if (!fan_control_allowed) 6119 5494 return -EPERM; 6120 5495 6121 - if (mutex_lock_interruptible(&fan_mutex)) 5496 + if (mutex_lock_killable(&fan_mutex)) 6122 5497 return -ERESTARTSYS; 6123 5498 6124 5499 switch (fan_control_access_mode) { ··· 6173 5548 if (!fan_control_allowed) 6174 5549 return -EPERM; 6175 5550 6176 - if (mutex_lock_interruptible(&fan_mutex)) 5551 + if (mutex_lock_killable(&fan_mutex)) 6177 5552 return -ERESTARTSYS; 6178 5553 6179 5554 rc = 0; ··· 6211 5586 if (!fan_control_allowed) 6212 5587 return -EPERM; 6213 5588 6214 - if (mutex_lock_interruptible(&fan_mutex)) 5589 + if (mutex_lock_killable(&fan_mutex)) 6215 5590 return -ERESTARTSYS; 6216 5591 6217 5592 rc = 0; ··· 6307 5682 if (res) 6308 5683 return res; 6309 5684 6310 - if (unlikely(tp_features.fan_ctrl_status_undef)) { 6311 - if (status != fan_control_initial_status) { 6312 - tp_features.fan_ctrl_status_undef = 0; 6313 - } else { 6314 - /* Return most likely status. In fact, it 6315 - * might be the only possible status */ 6316 - status = TP_EC_FAN_AUTO; 6317 - } 6318 - } 6319 - 6320 5685 if (status & TP_EC_FAN_FULLSPEED) { 6321 5686 mode = 0; 6322 5687 } else if (status & TP_EC_FAN_AUTO) { ··· 6371 5756 if (res) 6372 5757 return res; 6373 5758 6374 - if (unlikely(tp_features.fan_ctrl_status_undef)) { 6375 - if (status != fan_control_initial_status) { 6376 - tp_features.fan_ctrl_status_undef = 0; 6377 - } else { 6378 - status = TP_EC_FAN_AUTO; 6379 - } 6380 - } 6381 - 6382 5759 if ((status & 6383 5760 (TP_EC_FAN_AUTO | TP_EC_FAN_FULLSPEED)) != 0) 6384 5761 status = fan_control_desired_level; ··· 6395 5788 /* scale down from 0-255 to 0-7 */ 6396 5789 newlevel = (s >> 5) & 0x07; 6397 5790 6398 - if (mutex_lock_interruptible(&fan_mutex)) 5791 + if (mutex_lock_killable(&fan_mutex)) 6399 5792 return -ERESTARTSYS; 6400 5793 6401 5794 rc = fan_get_status(&status); ··· 6502 5895 if (likely(acpi_ec_read(fan_status_offset, 6503 5896 &fan_control_initial_status))) { 6504 5897 fan_status_access_mode = TPACPI_FAN_RD_TPEC; 6505 - 6506 - /* In some ThinkPads, neither the EC nor the ACPI 6507 - * DSDT initialize the fan status, and it ends up 6508 - * being set to 0x07 when it *could* be either 6509 - * 0x07 or 0x80. 6510 - * 6511 - * Enable for TP-1Y (T43), TP-78 (R51e), 6512 - * TP-76 (R52), TP-70 (T43, R52), which are known 6513 - * to be buggy. */ 6514 - if (fan_control_initial_status == 0x07) { 6515 - switch (thinkpad_id.ec_model) { 6516 - case 0x5931: /* TP-1Y */ 6517 - case 0x3837: /* TP-78 */ 6518 - case 0x3637: /* TP-76 */ 6519 - case 0x3037: /* TP-70 */ 6520 - printk(TPACPI_NOTICE 6521 - "fan_init: initial fan status " 6522 - "is unknown, assuming it is " 6523 - "in auto mode\n"); 6524 - tp_features.fan_ctrl_status_undef = 1; 6525 - ;; 6526 - } 6527 - } 5898 + fan_quirk1_detect(); 6528 5899 } else { 6529 5900 printk(TPACPI_ERR 6530 5901 "ThinkPad ACPI EC access misbehaving, " ··· 6690 6105 rc = fan_get_status_safe(&status); 6691 6106 if (rc < 0) 6692 6107 return rc; 6693 - 6694 - if (unlikely(tp_features.fan_ctrl_status_undef)) { 6695 - if (status != fan_control_initial_status) 6696 - tp_features.fan_ctrl_status_undef = 0; 6697 - else 6698 - /* Return most likely status. In fact, it 6699 - * might be the only possible status */ 6700 - status = TP_EC_FAN_AUTO; 6701 - } 6702 6108 6703 6109 len += sprintf(p + len, "status:\t\t%s\n", 6704 6110 (status != 0) ? "enabled" : "disabled"); ··· 7139 6563 .init = wan_init, 7140 6564 .data = &wan_driver_data, 7141 6565 }, 6566 + { 6567 + .init = uwb_init, 6568 + .data = &uwb_driver_data, 6569 + }, 7142 6570 #ifdef CONFIG_THINKPAD_ACPI_VIDEO 7143 6571 { 7144 6572 .init = video_init, ··· 7280 6700 TPACPI_PARAM(brightness); 7281 6701 TPACPI_PARAM(volume); 7282 6702 TPACPI_PARAM(fan); 6703 + 6704 + #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 6705 + module_param(dbg_wlswemul, uint, 0); 6706 + MODULE_PARM_DESC(dbg_wlswemul, "Enables WLSW emulation"); 6707 + module_param_named(wlsw_state, tpacpi_wlsw_emulstate, bool, 0); 6708 + MODULE_PARM_DESC(wlsw_state, 6709 + "Initial state of the emulated WLSW switch"); 6710 + 6711 + module_param(dbg_bluetoothemul, uint, 0); 6712 + MODULE_PARM_DESC(dbg_bluetoothemul, "Enables bluetooth switch emulation"); 6713 + module_param_named(bluetooth_state, tpacpi_bluetooth_emulstate, bool, 0); 6714 + MODULE_PARM_DESC(bluetooth_state, 6715 + "Initial state of the emulated bluetooth switch"); 6716 + 6717 + module_param(dbg_wwanemul, uint, 0); 6718 + MODULE_PARM_DESC(dbg_wwanemul, "Enables WWAN switch emulation"); 6719 + module_param_named(wwan_state, tpacpi_wwan_emulstate, bool, 0); 6720 + MODULE_PARM_DESC(wwan_state, 6721 + "Initial state of the emulated WWAN switch"); 6722 + 6723 + module_param(dbg_uwbemul, uint, 0); 6724 + MODULE_PARM_DESC(dbg_uwbemul, "Enables UWB switch emulation"); 6725 + module_param_named(uwb_state, tpacpi_uwb_emulstate, bool, 0); 6726 + MODULE_PARM_DESC(uwb_state, 6727 + "Initial state of the emulated UWB switch"); 6728 + #endif 7283 6729 7284 6730 static void thinkpad_acpi_module_exit(void) 7285 6731 {
+1 -1
include/acpi/actbl.h
··· 245 245 #define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: Power button is handled as a generic feature */ 246 246 #define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: Sleep button is handled as a generic feature, or not present */ 247 247 #define ACPI_FADT_FIXED_RTC (1<<6) /* 06: RTC wakeup stat not in fixed register space */ 248 - #define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup stat not possible from S4 */ 248 + #define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup possible from S4 */ 249 249 #define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: tmr_val is 32 bits 0=24-bits */ 250 250 #define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: Docking supported */ 251 251 #define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: System reset via the FADT RESET_REG supported */
+1 -1
kernel/kprobes.c
··· 123 123 static int __kprobes check_safety(void) 124 124 { 125 125 int ret = 0; 126 - #if defined(CONFIG_PREEMPT) && defined(CONFIG_PM) 126 + #if defined(CONFIG_PREEMPT) && defined(CONFIG_FREEZER) 127 127 ret = freeze_processes(); 128 128 if (ret == 0) { 129 129 struct task_struct *p, *q;
+2 -1
kernel/power/Makefile
··· 4 4 endif 5 5 6 6 obj-y := main.o 7 - obj-$(CONFIG_PM_SLEEP) += process.o console.o 7 + obj-$(CONFIG_PM_SLEEP) += console.o 8 + obj-$(CONFIG_FREEZER) += process.o 8 9 obj-$(CONFIG_HIBERNATION) += swsusp.o disk.o snapshot.o swap.o user.o 9 10 10 11 obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o