aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-05-13 10:00:28 -0400
committerMatthew Garrett <matthew.garrett@nebula.com>2014-06-10 19:11:06 -0400
commit85093f79f586176f8bbf90e56e22a3dfa526e334 (patch)
tree0f260540279688d635ab018c4e4fbce431da59ed
parentc08db55fe1455202e4bcda416e88bbbc20700dc4 (diff)
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>
-rw-r--r--drivers/platform/x86/ideapad-laptop.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 6dd060a0bb65..219eb289a909 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -36,6 +36,7 @@
36#include <linux/debugfs.h> 36#include <linux/debugfs.h>
37#include <linux/seq_file.h> 37#include <linux/seq_file.h>
38#include <linux/i8042.h> 38#include <linux/i8042.h>
39#include <linux/dmi.h>
39 40
40#define IDEAPAD_RFKILL_DEV_NUM (3) 41#define IDEAPAD_RFKILL_DEV_NUM (3)
41 42
@@ -819,6 +820,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
819 } 820 }
820} 821}
821 822
823/* Blacklist for devices where the ideapad rfkill interface does not work */
824static struct dmi_system_id rfkill_blacklist[] = {
825 /* The Lenovo Yoga 2 11 always reports everything as blocked */
826 {
827 .ident = "Lenovo Yoga 2 11",
828 .matches = {
829 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
830 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"),
831 },
832 },
833 {}
834};
835
822static int ideapad_acpi_add(struct platform_device *pdev) 836static int ideapad_acpi_add(struct platform_device *pdev)
823{ 837{
824 int ret, i; 838 int ret, i;
@@ -854,11 +868,10 @@ static int ideapad_acpi_add(struct platform_device *pdev)
854 if (ret) 868 if (ret)
855 goto input_failed; 869 goto input_failed;
856 870
857 for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { 871 if (!dmi_check_system(rfkill_blacklist)) {
858 if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) 872 for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
859 ideapad_register_rfkill(priv, i); 873 if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
860 else 874 ideapad_register_rfkill(priv, i);
861 priv->rfk[i] = NULL;
862 } 875 }
863 ideapad_sync_rfk_state(priv); 876 ideapad_sync_rfk_state(priv);
864 ideapad_sync_touchpad_state(priv); 877 ideapad_sync_touchpad_state(priv);