Skip to content

Commit e3d183c

Browse files
committed
Merge tag 'platform-drivers-x86-v4.9-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
Pull x86 platform driver fixes from Darren Hart: "Minor doc fix, a DMI match for ideapad and a fix to toshiba-wmi to avoid loading on non-toshiba systems. Documentation/ABI: - ibm_rtl: The "What:" fields are incomplete toshiba-wmi: - Fix loading the driver on non Toshiba laptops ideapad-laptop: - Add another DMI entry for Yoga 900" * tag 'platform-drivers-x86-v4.9-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: Documentation/ABI: ibm_rtl: The "What:" fields are incomplete toshiba-wmi: Fix loading the driver on non Toshiba laptops ideapad-laptop: Add another DMI entry for Yoga 900
2 parents 5f3a5cb + 8ec4b73 commit e3d183c

3 files changed

Lines changed: 28 additions & 9 deletions

File tree

Documentation/ABI/testing/sysfs-devices-system-ibm-rtl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
What: state
1+
What: /sys/devices/system/ibm_rtl/state
22
Date: Sep 2010
33
KernelVersion: 2.6.37
44
Contact: Vernon Mauery <vernux@us.ibm.com>
@@ -10,7 +10,7 @@ Description: The state file allows a means by which to change in and
1010
Users: The ibm-prtm userspace daemon uses this interface.
1111

1212

13-
What: version
13+
What: /sys/devices/system/ibm_rtl/version
1414
Date: Sep 2010
1515
KernelVersion: 2.6.37
1616
Contact: Vernon Mauery <vernux@us.ibm.com>

drivers/platform/x86/ideapad-laptop.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
933933
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 900"),
934934
},
935935
},
936+
{
937+
.ident = "Lenovo Yoga 900",
938+
.matches = {
939+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
940+
DMI_MATCH(DMI_BOARD_NAME, "VIUU4"),
941+
},
942+
},
936943
{
937944
.ident = "Lenovo YOGA 910-13IKB",
938945
.matches = {

drivers/platform/x86/toshiba-wmi.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
#include <linux/acpi.h>
2525
#include <linux/input.h>
2626
#include <linux/input/sparse-keymap.h>
27+
#include <linux/dmi.h>
2728

2829
MODULE_AUTHOR("Azael Avalos");
2930
MODULE_DESCRIPTION("Toshiba WMI Hotkey Driver");
3031
MODULE_LICENSE("GPL");
3132

32-
#define TOSHIBA_WMI_EVENT_GUID "59142400-C6A3-40FA-BADB-8A2652834100"
33+
#define WMI_EVENT_GUID "59142400-C6A3-40FA-BADB-8A2652834100"
3334

34-
MODULE_ALIAS("wmi:"TOSHIBA_WMI_EVENT_GUID);
35+
MODULE_ALIAS("wmi:"WMI_EVENT_GUID);
3536

3637
static struct input_dev *toshiba_wmi_input_dev;
3738

@@ -63,6 +64,16 @@ static void toshiba_wmi_notify(u32 value, void *context)
6364
kfree(response.pointer);
6465
}
6566

67+
static struct dmi_system_id toshiba_wmi_dmi_table[] __initdata = {
68+
{
69+
.ident = "Toshiba laptop",
70+
.matches = {
71+
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
72+
},
73+
},
74+
{}
75+
};
76+
6677
static int __init toshiba_wmi_input_setup(void)
6778
{
6879
acpi_status status;
@@ -81,7 +92,7 @@ static int __init toshiba_wmi_input_setup(void)
8192
if (err)
8293
goto err_free_dev;
8394

84-
status = wmi_install_notify_handler(TOSHIBA_WMI_EVENT_GUID,
95+
status = wmi_install_notify_handler(WMI_EVENT_GUID,
8596
toshiba_wmi_notify, NULL);
8697
if (ACPI_FAILURE(status)) {
8798
err = -EIO;
@@ -95,7 +106,7 @@ static int __init toshiba_wmi_input_setup(void)
95106
return 0;
96107

97108
err_remove_notifier:
98-
wmi_remove_notify_handler(TOSHIBA_WMI_EVENT_GUID);
109+
wmi_remove_notify_handler(WMI_EVENT_GUID);
99110
err_free_keymap:
100111
sparse_keymap_free(toshiba_wmi_input_dev);
101112
err_free_dev:
@@ -105,7 +116,7 @@ static int __init toshiba_wmi_input_setup(void)
105116

106117
static void toshiba_wmi_input_destroy(void)
107118
{
108-
wmi_remove_notify_handler(TOSHIBA_WMI_EVENT_GUID);
119+
wmi_remove_notify_handler(WMI_EVENT_GUID);
109120
sparse_keymap_free(toshiba_wmi_input_dev);
110121
input_unregister_device(toshiba_wmi_input_dev);
111122
}
@@ -114,7 +125,8 @@ static int __init toshiba_wmi_init(void)
114125
{
115126
int ret;
116127

117-
if (!wmi_has_guid(TOSHIBA_WMI_EVENT_GUID))
128+
if (!wmi_has_guid(WMI_EVENT_GUID) ||
129+
!dmi_check_system(toshiba_wmi_dmi_table))
118130
return -ENODEV;
119131

120132
ret = toshiba_wmi_input_setup();
@@ -130,7 +142,7 @@ static int __init toshiba_wmi_init(void)
130142

131143
static void __exit toshiba_wmi_exit(void)
132144
{
133-
if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID))
145+
if (wmi_has_guid(WMI_EVENT_GUID))
134146
toshiba_wmi_input_destroy();
135147
}
136148

0 commit comments

Comments
 (0)