ideapad: fix software rfkill setting
PATCH 1/2 ideapad: fix software rfkill setting
This fixes a several year old regression that I found while trying to get the Yoga 3 11 to work. The ideapad_rfk_set function is meant to send a command to the embedded controller through ACPI, but as of c1f73658ed, it sends the index of the rfkill device instead of the command, and ignores the opcode field.
This changes it back to the original behavior, which indeed flips the rfkill state as seen in the debugfs interface.
drivers/platform/x86/ideapad-laptop.c +2 -1
@@ -464,8 +464,9 @@ static const struct ideapad_rfk_data ideapad_rfk_data[] = {static int ideapad_rfk_set (void *data,bool blocked) {struct ideapad_rfk_priv *priv = data; +int opcode = ideapad_rfk_data[priv->dev].opcode; -return write_ec_cmd (priv->priv->adev->handle, priv->dev, !blocked); +return write_ec_cmd (priv->priv->adev->handle, opcode, !blocked); }static struct rfkill_ops ideapad_rfk_ops = {
PATCH 1/1 ideapad: add rfkill whitelist entry for Yoga 3 1170
This adds one more entry to the whitelist of machines that do not have a physical rfkill switch. Unfortunately, the Yoga 3 generation seems to use upper-case letters for the YOGA 3 Pro-1370, while it uses normal capitalization for its Yoga 3 1170 sibling.
In order to catch all variants of the Yoga 3, I'm now using both strings as wildcards here, which should also cover the 1470 model, and possible changes in the string that could happen in firmware updates.
drivers/platform/x86/ideapad-laptop.c +8 -1
@@ -855,7 +855,14 @@ static const struct dmi_system_id no_hw_rfkill_list[] = { .ident = "Lenovo Yoga 3 Pro 1370", .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3 Pro-1370"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"), + }, + }, + { + .ident ="Lenovo Yoga 3 1170 / 1470" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3"), }, }, {}
Re: [PATCH] ideapad: add rfkill whitelist entry for Yoga 3 1170
Quoted 16 lines · Arnd Bergmann
This adds one more entry to the whitelist of machines that do not have a physical rfkill switch. Unfortunately, the Yoga 3 generation seems to use upper-case letters for the YOGA 3 Pro-1370, while it uses normal capitalization for its Yoga 3 1170 sibling.
In order to catch all variants of the Yoga 3, I'm now using both strings as wildcards here, which should also cover the 1470 model, and possible changes in the string that could happen in firmware updates.
Signed-off-by Arnd Bergmann <[email protected]>drivers/platform/x86/ideapad-laptop.c +0
-0
drivers/platform/x86/ideapad-laptop.c static const struct dmi_system_id no_hw_rfkill_list[] = { · line 855
Quoted 1 line
drivers/platform/x86/ideapad-laptop.c +0
-0@@ -855,7 +855,14 @@ static const struct dmi_system_id no_hw_rfkill_list[] = { .ident = "Lenovo Yoga 3 Pro 1370",
I believe we should also update the ident to indicate the inclusion of the 1470 model since you dropped the 1370 specifier from the product version.
(Also, please use my infradead ID specified in MAINTAINERS for platform-drivers-x86)
Thanks,
Quoted 20 lines
drivers/platform/x86/ideapad-laptop.c +8
-2.matches = {DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), - DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3 Pro-1370"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"), + }, + }, + { + .ident ="Lenovo Yoga 3 1170 / 1470" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3"), }, }, {} --To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Darren Hart Intel Open Source Technology Center
Darren Hart
AppliedQuoted 6 lines · Arnd Bergmann
This fixes a several year old regression that I found while trying to get the Yoga 3 11 to work. The
ideapad_rfk_setfunction is meant to send a command to the embedded controller through ACPI, but as ofc1f73658ed, it sends the index of the rfkill device instead of the command, and ignores the opcode field.
Quoted 6 lines
This changes it back to the original behavior, which indeed flips the rfkill state as seen in the debugfs interface.
Signed-off-by Arnd Bergmann <[email protected]>Fixes c1f73658ed ("ideapad: pass ideapad_priv as argument (part 2)")Cc [email protected] # v2.6.38+
Queued for 4.2. Thanks!
Signature · 2 lines
Darren Hart Intel Open Source Technology Center