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:
ACPI: remove CONFIG_ACPI_SYSTEM
fujitsu-laptop: Use RFKILL support bitmask from firmware
x86_64: Fix S3 fail path
x86_64: acpi/wakeup_64 cleanup
battery: don't assume we are fully charged when not charging or discharging
ACPI: EC: Add delay for slow MSI controller

+62 -36
+10 -20
arch/x86/kernel/acpi/wakeup_64.S
··· 13 * Hooray, we are in Long 64-bit mode (but still running in low memory) 14 */ 15 ENTRY(wakeup_long64) 16 - wakeup_long64: 17 movq saved_magic, %rax 18 movq $0x123456789abcdef0, %rdx 19 cmpq %rdx, %rax ··· 33 34 movq saved_rip, %rax 35 jmp *%rax 36 37 bogus_64_magic: 38 jmp bogus_64_magic 39 40 - .align 2 41 - .p2align 4,,15 42 - .globl do_suspend_lowlevel 43 - .type do_suspend_lowlevel,@function 44 - do_suspend_lowlevel: 45 - .LFB5: 46 subq $8, %rsp 47 xorl %eax, %eax 48 call save_processor_state ··· 62 pushfq 63 popq pt_regs_flags(%rax) 64 65 - movq $.L97, saved_rip(%rip) 66 67 movq %rsp, saved_rsp 68 movq %rbp, saved_rbp ··· 73 addq $8, %rsp 74 movl $3, %edi 75 xorl %eax, %eax 76 - jmp acpi_enter_sleep_state 77 - .L97: 78 - .p2align 4,,7 79 - .L99: 80 - .align 4 81 - movl $24, %eax 82 - movw %ax, %ds 83 84 /* We don't restore %rax, it must be 0 anyway */ 85 movq $saved_context, %rax 86 movq saved_context_cr4(%rax), %rbx ··· 110 xorl %eax, %eax 111 addq $8, %rsp 112 jmp restore_processor_state 113 - .LFE5: 114 - .Lfe5: 115 - .size do_suspend_lowlevel, .Lfe5-do_suspend_lowlevel 116 - 117 .data 118 - ALIGN 119 ENTRY(saved_rbp) .quad 0 120 ENTRY(saved_rsi) .quad 0 121 ENTRY(saved_rdi) .quad 0
··· 13 * Hooray, we are in Long 64-bit mode (but still running in low memory) 14 */ 15 ENTRY(wakeup_long64) 16 movq saved_magic, %rax 17 movq $0x123456789abcdef0, %rdx 18 cmpq %rdx, %rax ··· 34 35 movq saved_rip, %rax 36 jmp *%rax 37 + ENDPROC(wakeup_long64) 38 39 bogus_64_magic: 40 jmp bogus_64_magic 41 42 + ENTRY(do_suspend_lowlevel) 43 subq $8, %rsp 44 xorl %eax, %eax 45 call save_processor_state ··· 67 pushfq 68 popq pt_regs_flags(%rax) 69 70 + movq $resume_point, saved_rip(%rip) 71 72 movq %rsp, saved_rsp 73 movq %rbp, saved_rbp ··· 78 addq $8, %rsp 79 movl $3, %edi 80 xorl %eax, %eax 81 + call acpi_enter_sleep_state 82 + /* in case something went wrong, restore the machine status and go on */ 83 + jmp resume_point 84 85 + .align 4 86 + resume_point: 87 /* We don't restore %rax, it must be 0 anyway */ 88 movq $saved_context, %rax 89 movq saved_context_cr4(%rax), %rbx ··· 117 xorl %eax, %eax 118 addq $8, %rsp 119 jmp restore_processor_state 120 + ENDPROC(do_suspend_lowlevel) 121 + 122 .data 123 ENTRY(saved_rbp) .quad 0 124 ENTRY(saved_rsi) .quad 0 125 ENTRY(saved_rdi) .quad 0
-7
drivers/acpi/Kconfig
··· 254 help you correlate PCI bus addresses with the physical geography 255 of your slots. If you are unsure, say N. 256 257 - config ACPI_SYSTEM 258 - bool 259 - default y 260 - help 261 - This driver will enable your system to shut down using ACPI, and 262 - dump your ACPI DSDT table using /proc/acpi/dsdt. 263 - 264 config X86_PM_TIMER 265 bool "Power Management Timer Support" if EMBEDDED 266 depends on X86
··· 254 help you correlate PCI bus addresses with the physical geography 255 of your slots. If you are unsure, say N. 256 257 config X86_PM_TIMER 258 bool "Power Management Timer Support" if EMBEDDED 259 depends on X86
+1 -1
drivers/acpi/Makefile
··· 52 obj-$(CONFIG_ACPI_CONTAINER) += container.o 53 obj-$(CONFIG_ACPI_THERMAL) += thermal.o 54 obj-y += power.o 55 - obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o 56 obj-$(CONFIG_ACPI_DEBUG) += debug.o 57 obj-$(CONFIG_ACPI_NUMA) += numa.o 58 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
··· 52 obj-$(CONFIG_ACPI_CONTAINER) += container.o 53 obj-$(CONFIG_ACPI_THERMAL) += thermal.o 54 obj-y += power.o 55 + obj-y += system.o event.o 56 obj-$(CONFIG_ACPI_DEBUG) += debug.o 57 obj-$(CONFIG_ACPI_NUMA) += numa.o 58 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
+24 -1
drivers/acpi/battery.c
··· 138 139 static int acpi_battery_get_state(struct acpi_battery *battery); 140 141 static int acpi_battery_get_property(struct power_supply *psy, 142 enum power_supply_property psp, 143 union power_supply_propval *val) ··· 178 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; 179 else if (battery->state & 0x02) 180 val->intval = POWER_SUPPLY_STATUS_CHARGING; 181 - else if (battery->state == 0) 182 val->intval = POWER_SUPPLY_STATUS_FULL; 183 else 184 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
··· 138 139 static int acpi_battery_get_state(struct acpi_battery *battery); 140 141 + static int acpi_battery_is_charged(struct acpi_battery *battery) 142 + { 143 + /* either charging or discharging */ 144 + if (battery->state != 0) 145 + return 0; 146 + 147 + /* battery not reporting charge */ 148 + if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN || 149 + battery->capacity_now == 0) 150 + return 0; 151 + 152 + /* good batteries update full_charge as the batteries degrade */ 153 + if (battery->full_charge_capacity == battery->capacity_now) 154 + return 1; 155 + 156 + /* fallback to using design values for broken batteries */ 157 + if (battery->design_capacity == battery->capacity_now) 158 + return 1; 159 + 160 + /* we don't do any sort of metric based on percentages */ 161 + return 0; 162 + } 163 + 164 static int acpi_battery_get_property(struct power_supply *psy, 165 enum power_supply_property psp, 166 union power_supply_propval *val) ··· 155 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; 156 else if (battery->state & 0x02) 157 val->intval = POWER_SUPPLY_STATUS_CHARGING; 158 + else if (acpi_battery_is_charged(battery)) 159 val->intval = POWER_SUPPLY_STATUS_FULL; 160 else 161 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
+9
drivers/acpi/ec.c
··· 120 spinlock_t curr_lock; 121 } *boot_ec, *first_ec; 122 123 /* -------------------------------------------------------------------------- 124 Transaction Management 125 -------------------------------------------------------------------------- */ ··· 261 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 262 acpi_disable_gpe(NULL, ec->gpe); 263 } 264 /* start transaction */ 265 spin_lock_irqsave(&ec->curr_lock, tmp); 266 /* following two actions should be kept atomic */ ··· 971 /* 972 * Generate a boot ec context 973 */ 974 status = acpi_get_table(ACPI_SIG_ECDT, 1, 975 (struct acpi_table_header **)&ecdt_ptr); 976 if (ACPI_SUCCESS(status)) {
··· 120 spinlock_t curr_lock; 121 } *boot_ec, *first_ec; 122 123 + static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */ 124 + 125 /* -------------------------------------------------------------------------- 126 Transaction Management 127 -------------------------------------------------------------------------- */ ··· 259 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 260 acpi_disable_gpe(NULL, ec->gpe); 261 } 262 + if (EC_FLAGS_MSI) 263 + udelay(ACPI_EC_DELAY); 264 /* start transaction */ 265 spin_lock_irqsave(&ec->curr_lock, tmp); 266 /* following two actions should be kept atomic */ ··· 967 /* 968 * Generate a boot ec context 969 */ 970 + if (dmi_name_in_vendors("Micro-Star") || 971 + dmi_name_in_vendors("Notebook")) { 972 + pr_info(PREFIX "Enabling special treatment for EC from MSI.\n"); 973 + EC_FLAGS_MSI = 1; 974 + } 975 status = acpi_get_table(ACPI_SIG_ECDT, 1, 976 (struct acpi_table_header **)&ecdt_ptr); 977 if (ACPI_SUCCESS(status)) {
+18 -7
drivers/platform/x86/fujitsu-laptop.c
··· 166 struct platform_device *pf_device; 167 struct kfifo *fifo; 168 spinlock_t fifo_lock; 169 int rfkill_state; 170 int logolamp_registered; 171 int kblamps_registered; ··· 527 show_lid_state(struct device *dev, 528 struct device_attribute *attr, char *buf) 529 { 530 - if (fujitsu_hotkey->rfkill_state == UNSUPPORTED_CMD) 531 return sprintf(buf, "unknown\n"); 532 if (fujitsu_hotkey->rfkill_state & 0x100) 533 return sprintf(buf, "open\n"); ··· 539 show_dock_state(struct device *dev, 540 struct device_attribute *attr, char *buf) 541 { 542 - if (fujitsu_hotkey->rfkill_state == UNSUPPORTED_CMD) 543 return sprintf(buf, "unknown\n"); 544 if (fujitsu_hotkey->rfkill_state & 0x200) 545 return sprintf(buf, "docked\n"); ··· 551 show_radios_state(struct device *dev, 552 struct device_attribute *attr, char *buf) 553 { 554 - if (fujitsu_hotkey->rfkill_state == UNSUPPORTED_CMD) 555 return sprintf(buf, "unknown\n"); 556 if (fujitsu_hotkey->rfkill_state & 0x20) 557 return sprintf(buf, "on\n"); ··· 929 ; /* No action, result is discarded */ 930 vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i); 931 932 - fujitsu_hotkey->rfkill_state = 933 - call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); 934 935 /* Suspect this is a keymap of the application panel, print it */ 936 printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n", ··· 1015 1016 input = fujitsu_hotkey->input; 1017 1018 - fujitsu_hotkey->rfkill_state = 1019 - call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); 1020 1021 switch (event) { 1022 case ACPI_FUJITSU_NOTIFY_CODE1:
··· 166 struct platform_device *pf_device; 167 struct kfifo *fifo; 168 spinlock_t fifo_lock; 169 + int rfkill_supported; 170 int rfkill_state; 171 int logolamp_registered; 172 int kblamps_registered; ··· 526 show_lid_state(struct device *dev, 527 struct device_attribute *attr, char *buf) 528 { 529 + if (!(fujitsu_hotkey->rfkill_supported & 0x100)) 530 return sprintf(buf, "unknown\n"); 531 if (fujitsu_hotkey->rfkill_state & 0x100) 532 return sprintf(buf, "open\n"); ··· 538 show_dock_state(struct device *dev, 539 struct device_attribute *attr, char *buf) 540 { 541 + if (!(fujitsu_hotkey->rfkill_supported & 0x200)) 542 return sprintf(buf, "unknown\n"); 543 if (fujitsu_hotkey->rfkill_state & 0x200) 544 return sprintf(buf, "docked\n"); ··· 550 show_radios_state(struct device *dev, 551 struct device_attribute *attr, char *buf) 552 { 553 + if (!(fujitsu_hotkey->rfkill_supported & 0x20)) 554 return sprintf(buf, "unknown\n"); 555 if (fujitsu_hotkey->rfkill_state & 0x20) 556 return sprintf(buf, "on\n"); ··· 928 ; /* No action, result is discarded */ 929 vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i); 930 931 + fujitsu_hotkey->rfkill_supported = 932 + call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0); 933 + 934 + /* Make sure our bitmask of supported functions is cleared if the 935 + RFKILL function block is not implemented, like on the S7020. */ 936 + if (fujitsu_hotkey->rfkill_supported == UNSUPPORTED_CMD) 937 + fujitsu_hotkey->rfkill_supported = 0; 938 + 939 + if (fujitsu_hotkey->rfkill_supported) 940 + fujitsu_hotkey->rfkill_state = 941 + call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); 942 943 /* Suspect this is a keymap of the application panel, print it */ 944 printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n", ··· 1005 1006 input = fujitsu_hotkey->input; 1007 1008 + if (fujitsu_hotkey->rfkill_supported) 1009 + fujitsu_hotkey->rfkill_state = 1010 + call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); 1011 1012 switch (event) { 1013 case ACPI_FUJITSU_NOTIFY_CODE1: