Skip to content

Commit 4bfc89d

Browse files
committed
Merge tag 'platform-drivers-x86-v4.4-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
Pull another x86 platform driver update from Darren Hart: "Support for the unfortunately rather unique ESC key on the Ideapad Yoga 3 and two DMI matches for rfkill support. Solitary fix for potential missed errors for asus-wmi. Downgrade a thinkpad_acpi message to info. asus-wmi: - fix error handling in store_sys_wmi() ideapad-laptop: - Add Lenovo Yoga 900 to no_hw_rfkill dmi list - include Yoga 3 1170 in add rfkill whitelist - add support for Yoga 3 ESC key thinkpad_acpi: - Don't yell on unsupported brightness interfaces" * tag 'platform-drivers-x86-v4.4-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: asus-wmi: fix error handling in store_sys_wmi() ideapad-laptop: Add Lenovo Yoga 900 to no_hw_rfkill dmi list ideapad-laptop: include Yoga 3 1170 in add rfkill whitelist ideapad-laptop: add support for Yoga 3 ESC key thinkpad_acpi: Don't yell on unsupported brightness interfaces
2 parents a30b7ca + b829834 commit 4bfc89d

File tree

4 files changed

+47
-8
lines changed

4 files changed

+47
-8
lines changed

drivers/platform/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ config IDEAPAD_LAPTOP
345345
depends on SERIO_I8042
346346
depends on BACKLIGHT_CLASS_DEVICE
347347
depends on ACPI_VIDEO || ACPI_VIDEO = n
348+
depends on ACPI_WMI || ACPI_WMI = n
348349
select INPUT_SPARSEKMAP
349350
help
350351
This is a driver for Lenovo IdeaPad netbooks contains drivers for

drivers/platform/x86/asus-wmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ static ssize_t store_sys_wmi(struct asus_wmi *asus, int devid,
16821682
int rv, err, value;
16831683

16841684
value = asus_wmi_get_devstate_simple(asus, devid);
1685-
if (value == -ENODEV) /* Check device presence */
1685+
if (value < 0)
16861686
return value;
16871687

16881688
rv = parse_arg(buf, count, &value);

drivers/platform/x86/ideapad-laptop.c

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
#define CFG_WIFI_BIT (18)
4848
#define CFG_CAMERA_BIT (19)
4949

50+
#if IS_ENABLED(CONFIG_ACPI_WMI)
51+
static const char ideapad_wmi_fnesc_event[] = "26CAB2E5-5CF1-46AE-AAC3-4A12B6BA50E6";
52+
#endif
53+
5054
enum {
5155
VPCCMD_R_VPC1 = 0x10,
5256
VPCCMD_R_BL_MAX,
@@ -567,6 +571,8 @@ static const struct key_entry ideapad_keymap[] = {
567571
{ KE_KEY, 65, { KEY_PROG4 } },
568572
{ KE_KEY, 66, { KEY_TOUCHPAD_OFF } },
569573
{ KE_KEY, 67, { KEY_TOUCHPAD_ON } },
574+
{ KE_KEY, 128, { KEY_ESC } },
575+
570576
{ KE_END, 0 },
571577
};
572578

@@ -825,6 +831,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
825831
}
826832
}
827833

834+
#if IS_ENABLED(CONFIG_ACPI_WMI)
835+
static void ideapad_wmi_notify(u32 value, void *context)
836+
{
837+
switch (value) {
838+
case 128:
839+
ideapad_input_report(context, value);
840+
break;
841+
default:
842+
pr_info("Unknown WMI event %u\n", value);
843+
}
844+
}
845+
#endif
846+
828847
/*
829848
* Some ideapads don't have a hardware rfkill switch, reading VPCCMD_R_RF
830849
* always results in 0 on these models, causing ideapad_laptop to wrongly
@@ -853,24 +872,31 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
853872
},
854873
},
855874
{
856-
.ident = "Lenovo Yoga 3 14",
875+
.ident = "Lenovo Yoga 2 11 / 13 / Pro",
857876
.matches = {
858877
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
859-
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3 14"),
878+
DMI_MATCH(DMI_BOARD_NAME, "Yoga2"),
860879
},
861880
},
862881
{
863-
.ident = "Lenovo Yoga 2 11 / 13 / Pro",
882+
.ident = "Lenovo Yoga 3 1170 / 1470",
864883
.matches = {
865884
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
866-
DMI_MATCH(DMI_BOARD_NAME, "Yoga2"),
885+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3"),
867886
},
868887
},
869888
{
870889
.ident = "Lenovo Yoga 3 Pro 1370",
871890
.matches = {
872891
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
873-
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3 Pro-1370"),
892+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"),
893+
},
894+
},
895+
{
896+
.ident = "Lenovo Yoga 900",
897+
.matches = {
898+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
899+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 900"),
874900
},
875901
},
876902
{}
@@ -935,8 +961,18 @@ static int ideapad_acpi_add(struct platform_device *pdev)
935961
ACPI_DEVICE_NOTIFY, ideapad_acpi_notify, priv);
936962
if (ret)
937963
goto notification_failed;
964+
#if IS_ENABLED(CONFIG_ACPI_WMI)
965+
ret = wmi_install_notify_handler(ideapad_wmi_fnesc_event, ideapad_wmi_notify, priv);
966+
if (ret != AE_OK && ret != AE_NOT_EXIST)
967+
goto notification_failed_wmi;
968+
#endif
938969

939970
return 0;
971+
#if IS_ENABLED(CONFIG_ACPI_WMI)
972+
notification_failed_wmi:
973+
acpi_remove_notify_handler(priv->adev->handle,
974+
ACPI_DEVICE_NOTIFY, ideapad_acpi_notify);
975+
#endif
940976
notification_failed:
941977
ideapad_backlight_exit(priv);
942978
backlight_failed:
@@ -955,6 +991,9 @@ static int ideapad_acpi_remove(struct platform_device *pdev)
955991
struct ideapad_private *priv = dev_get_drvdata(&pdev->dev);
956992
int i;
957993

994+
#if IS_ENABLED(CONFIG_ACPI_WMI)
995+
wmi_remove_notify_handler(ideapad_wmi_fnesc_event);
996+
#endif
958997
acpi_remove_notify_handler(priv->adev->handle,
959998
ACPI_DEVICE_NOTIFY, ideapad_acpi_notify);
960999
ideapad_backlight_exit(priv);

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6459,8 +6459,7 @@ static void __init tpacpi_detect_brightness_capabilities(void)
64596459
pr_info("detected a 8-level brightness capable ThinkPad\n");
64606460
break;
64616461
default:
6462-
pr_err("Unsupported brightness interface, "
6463-
"please contact %s\n", TPACPI_MAIL);
6462+
pr_info("Unsupported brightness interface\n");
64646463
tp_features.bright_unkfw = 1;
64656464
bright_maxlvl = b - 1;
64666465
}

0 commit comments

Comments
 (0)