thinkpad-acpi: fix bluetooth/wwan resume
commit9418685271aeddf927ec13b79fa6e1fa17d62774
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Wed, 7 Jul 2010 02:07:11 +0000 (6 23:07 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Wed, 7 Jul 2010 02:07:11 +0000 (6 23:07 -0300)
tree17e3f6e49af986b21abf0c0b6fa3b9f519bdee3f
parent8e89f0e4f2d78278807f621b3c03f63281fd8bc2
thinkpad-acpi: fix bluetooth/wwan resume

Studying the DSDTs of various thinkpads, it looks like bit 3 of the
argument to SBDC and SWAN is not "set radio to last state on resume".
Rather, it seems to be "if this bit is set, enable radio on resume,
otherwise disable it on resume".

So, the proper way to prepare the radios for S3 suspend is: disable
radio and clear bit 3 on the SBDC/SWAN call to to resume with radio
disabled, and enable radio and set bit 3 on the SBDC/SWAN call to
resume with the radio enabled.

Also, for persistent devices, the rfkill core does not restore state,
so we really need to get the firmware to do the right thing.

We don't sync the radio state on suspend, instead we trust the BIOS to
not do anything weird if we never touched the radio state since boot.
Time will tell if that's a wise way of doing things...

This might even fix:
http://bugzilla.kernel.org/show_bug.cgi?id=14545

But I am not holding my breath, as the current code really should not
resume with bluetooth enabled... and that's exactly what the report
#14545 claims to happen.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
drivers/platform/x86/thinkpad_acpi.c