Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ideapad-laptop: Blacklist rfkill control on the Lenovo Yoga 2 11

The Lenovo Yoga 2 11 always reports everything as blocked, causing userspace
to not even try to use the wlan / bluetooth even though they work fine.

Note this patch also removes the "else priv->rfk[i] = NULL;" bit of the
rfkill initialization, it is not necessary as the priv struct is allocated
with kzalloc.

Reported-and-tested-by: Vincent Gerris <vgerris@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>

authored by

Hans de Goede and committed by
Matthew Garrett
85093f79 c08db55f

+18 -5
+18 -5
drivers/platform/x86/ideapad-laptop.c
··· 36 36 #include <linux/debugfs.h> 37 37 #include <linux/seq_file.h> 38 38 #include <linux/i8042.h> 39 + #include <linux/dmi.h> 39 40 40 41 #define IDEAPAD_RFKILL_DEV_NUM (3) 41 42 ··· 820 819 } 821 820 } 822 821 822 + /* Blacklist for devices where the ideapad rfkill interface does not work */ 823 + static struct dmi_system_id rfkill_blacklist[] = { 824 + /* The Lenovo Yoga 2 11 always reports everything as blocked */ 825 + { 826 + .ident = "Lenovo Yoga 2 11", 827 + .matches = { 828 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 829 + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"), 830 + }, 831 + }, 832 + {} 833 + }; 834 + 823 835 static int ideapad_acpi_add(struct platform_device *pdev) 824 836 { 825 837 int ret, i; ··· 868 854 if (ret) 869 855 goto input_failed; 870 856 871 - for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { 872 - if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) 873 - ideapad_register_rfkill(priv, i); 874 - else 875 - priv->rfk[i] = NULL; 857 + if (!dmi_check_system(rfkill_blacklist)) { 858 + for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) 859 + if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) 860 + ideapad_register_rfkill(priv, i); 876 861 } 877 862 ideapad_sync_rfk_state(priv); 878 863 ideapad_sync_touchpad_state(priv);