mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
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>
This commit is contained in:
parent
c08db55fe1
commit
85093f79f5
@ -36,6 +36,7 @@
|
|||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
#include <linux/i8042.h>
|
#include <linux/i8042.h>
|
||||||
|
#include <linux/dmi.h>
|
||||||
|
|
||||||
#define IDEAPAD_RFKILL_DEV_NUM (3)
|
#define IDEAPAD_RFKILL_DEV_NUM (3)
|
||||||
|
|
||||||
@ -819,6 +820,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Blacklist for devices where the ideapad rfkill interface does not work */
|
||||||
|
static struct dmi_system_id rfkill_blacklist[] = {
|
||||||
|
/* The Lenovo Yoga 2 11 always reports everything as blocked */
|
||||||
|
{
|
||||||
|
.ident = "Lenovo Yoga 2 11",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
static int ideapad_acpi_add(struct platform_device *pdev)
|
static int ideapad_acpi_add(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
@ -854,11 +868,10 @@ static int ideapad_acpi_add(struct platform_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto input_failed;
|
goto input_failed;
|
||||||
|
|
||||||
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) {
|
if (!dmi_check_system(rfkill_blacklist)) {
|
||||||
if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
|
for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
|
||||||
ideapad_register_rfkill(priv, i);
|
if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
|
||||||
else
|
ideapad_register_rfkill(priv, i);
|
||||||
priv->rfk[i] = NULL;
|
|
||||||
}
|
}
|
||||||
ideapad_sync_rfk_state(priv);
|
ideapad_sync_rfk_state(priv);
|
||||||
ideapad_sync_touchpad_state(priv);
|
ideapad_sync_touchpad_state(priv);
|
||||||
|
Loading…
Reference in New Issue
Block a user