Skip to contentSkip to conversation

thinkpad_acpi: Saving bluetooth state to NVRAM problem and fix

PATCH Vsevolod Kozlov 2 participants 2 messages Jun 10, 2012 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

Hello,

thinkpad_acpi normally fails to save Bluetooth state to NVRAM on my system (ThinkPad X120e). However, a small change in the code fixes the functionality:

drivers/platform/x86/thinkpad_acpi.c +1 -1
@@ -3999,7 +3999,7 @@ static const struct tpacpi_rfk_ops bluetooth_tprfk_ops = {
 static void bluetooth_shutdown(void)
 {
 	/* Order firmware to save current state to NVRAM */
-	if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd",
+	if (!acpi_evalf(NULL, NULL, "\\_SB.BLTH", "vd",
 			TP_ACPI_BLTH_SAVE_STATE))
 		pr_notice("failed to save bluetooth state to NVRAM\n");
 	else

I can't tell whether this breaks the functionality on other ThinkPad systems because I don't have any, though.

Please CC me any responses, as I am not subscribed to the list.

Regards,

Signature · 1 line
Zaba
#1 lore raw
Quoted 15 lines · Vsevolod Kozlov

thinkpad_acpi normally fails to save Bluetooth state to NVRAM on my system (ThinkPad X120e). However, a small change in the code fixes the functionality:

drivers/platform/x86/thinkpad_acpi.c +1 -1
@@ -3999,7 +3999,7 @@ static const struct tpacpi_rfk_ops bluetooth_tprfk_ops = {
 static void bluetooth_shutdown(void)
 {
 	/* Order firmware to save current state to NVRAM */
-	if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd",
+	if (!acpi_evalf(NULL, NULL, "\\_SB.BLTH", "vd",
 			TP_ACPI_BLTH_SAVE_STATE))
 		pr_notice("failed to save bluetooth state to NVRAM\n");
 	else
Quoted 2 lines

I can't tell whether this breaks the functionality on other ThinkPad systems because I don't have any, though.

Yes, it would break other systems. But I can write a fix that supports both systems with the data you supplied.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh