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