aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-14 00:47:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-14 00:47:06 -0500
commit4bfc89d26a0d177a79574fc1b54fc728e3bb8b4e (patch)
tree41b6f35511c79b7c2fce2576bff4079cbe00f8b4 /drivers/platform
parenta30b7ca2894994e4e2f2e06811ee67fa637bca2e (diff)
parentb82983401684ba06fcf3fbafa63edf371c0d4775 (diff)
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
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/Kconfig1
-rw-r--r--drivers/platform/x86/asus-wmi.c2
-rw-r--r--drivers/platform/x86/ideapad-laptop.c49
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c3
4 files changed, 47 insertions, 8 deletions
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 02bbc70c332d..1089eaa02b00 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -345,6 +345,7 @@ config IDEAPAD_LAPTOP
345 depends on SERIO_I8042 345 depends on SERIO_I8042
346 depends on BACKLIGHT_CLASS_DEVICE 346 depends on BACKLIGHT_CLASS_DEVICE
347 depends on ACPI_VIDEO || ACPI_VIDEO = n 347 depends on ACPI_VIDEO || ACPI_VIDEO = n
348 depends on ACPI_WMI || ACPI_WMI = n
348 select INPUT_SPARSEKMAP 349 select INPUT_SPARSEKMAP
349 help 350 help
350 This is a driver for Lenovo IdeaPad netbooks contains drivers for 351 This is a driver for Lenovo IdeaPad netbooks contains drivers for
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e3a750224ae2..f96f7b865267 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1682,7 +1682,7 @@ static ssize_t store_sys_wmi(struct asus_wmi *asus, int devid,
1682 int rv, err, value; 1682 int rv, err, value;
1683 1683
1684 value = asus_wmi_get_devstate_simple(asus, devid); 1684 value = asus_wmi_get_devstate_simple(asus, devid);
1685 if (value == -ENODEV) /* Check device presence */ 1685 if (value < 0)
1686 return value; 1686 return value;
1687 1687
1688 rv = parse_arg(buf, count, &value); 1688 rv = parse_arg(buf, count, &value);
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index fce49f3c6ed6..a313dfc0245f 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -47,6 +47,10 @@
47#define CFG_WIFI_BIT (18) 47#define CFG_WIFI_BIT (18)
48#define CFG_CAMERA_BIT (19) 48#define CFG_CAMERA_BIT (19)
49 49
50#if IS_ENABLED(CONFIG_ACPI_WMI)
51static const char ideapad_wmi_fnesc_event[] = "26CAB2E5-5CF1-46AE-AAC3-4A12B6BA50E6";
52#endif
53
50enum { 54enum {
51 VPCCMD_R_VPC1 = 0x10, 55 VPCCMD_R_VPC1 = 0x10,
52 VPCCMD_R_BL_MAX, 56 VPCCMD_R_BL_MAX,
@@ -567,6 +571,8 @@ static const struct key_entry ideapad_keymap[] = {
567 { KE_KEY, 65, { KEY_PROG4 } }, 571 { KE_KEY, 65, { KEY_PROG4 } },
568 { KE_KEY, 66, { KEY_TOUCHPAD_OFF } }, 572 { KE_KEY, 66, { KEY_TOUCHPAD_OFF } },
569 { KE_KEY, 67, { KEY_TOUCHPAD_ON } }, 573 { KE_KEY, 67, { KEY_TOUCHPAD_ON } },
574 { KE_KEY, 128, { KEY_ESC } },
575
570 { KE_END, 0 }, 576 { KE_END, 0 },
571}; 577};
572 578
@@ -825,6 +831,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
825 } 831 }
826} 832}
827 833
834#if IS_ENABLED(CONFIG_ACPI_WMI)
835static 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
828/* 847/*
829 * Some ideapads don't have a hardware rfkill switch, reading VPCCMD_R_RF 848 * Some ideapads don't have a hardware rfkill switch, reading VPCCMD_R_RF
830 * always results in 0 on these models, causing ideapad_laptop to wrongly 849 * 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[] = {
853 }, 872 },
854 }, 873 },
855 { 874 {
856 .ident = "Lenovo Yoga 3 14", 875 .ident = "Lenovo Yoga 2 11 / 13 / Pro",
857 .matches = { 876 .matches = {
858 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 877 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
859 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3 14"), 878 DMI_MATCH(DMI_BOARD_NAME, "Yoga2"),
860 }, 879 },
861 }, 880 },
862 { 881 {
863 .ident = "Lenovo Yoga 2 11 / 13 / Pro", 882 .ident = "Lenovo Yoga 3 1170 / 1470",
864 .matches = { 883 .matches = {
865 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 884 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
866 DMI_MATCH(DMI_BOARD_NAME, "Yoga2"), 885 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3"),
867 }, 886 },
868 }, 887 },
869 { 888 {
870 .ident = "Lenovo Yoga 3 Pro 1370", 889 .ident = "Lenovo Yoga 3 Pro 1370",
871 .matches = { 890 .matches = {
872 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 891 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"),
874 }, 900 },
875 }, 901 },
876 {} 902 {}
@@ -935,8 +961,18 @@ static int ideapad_acpi_add(struct platform_device *pdev)
935 ACPI_DEVICE_NOTIFY, ideapad_acpi_notify, priv); 961 ACPI_DEVICE_NOTIFY, ideapad_acpi_notify, priv);
936 if (ret) 962 if (ret)
937 goto notification_failed; 963 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
938 969
939 return 0; 970 return 0;
971#if IS_ENABLED(CONFIG_ACPI_WMI)
972notification_failed_wmi:
973 acpi_remove_notify_handler(priv->adev->handle,
974 ACPI_DEVICE_NOTIFY, ideapad_acpi_notify);
975#endif
940notification_failed: 976notification_failed:
941 ideapad_backlight_exit(priv); 977 ideapad_backlight_exit(priv);
942backlight_failed: 978backlight_failed:
@@ -955,6 +991,9 @@ static int ideapad_acpi_remove(struct platform_device *pdev)
955 struct ideapad_private *priv = dev_get_drvdata(&pdev->dev); 991 struct ideapad_private *priv = dev_get_drvdata(&pdev->dev);
956 int i; 992 int i;
957 993
994#if IS_ENABLED(CONFIG_ACPI_WMI)
995 wmi_remove_notify_handler(ideapad_wmi_fnesc_event);
996#endif
958 acpi_remove_notify_handler(priv->adev->handle, 997 acpi_remove_notify_handler(priv->adev->handle,
959 ACPI_DEVICE_NOTIFY, ideapad_acpi_notify); 998 ACPI_DEVICE_NOTIFY, ideapad_acpi_notify);
960 ideapad_backlight_exit(priv); 999 ideapad_backlight_exit(priv);
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 131dd7464183..0bed4733c4f0 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6459,8 +6459,7 @@ static void __init tpacpi_detect_brightness_capabilities(void)
6459 pr_info("detected a 8-level brightness capable ThinkPad\n"); 6459 pr_info("detected a 8-level brightness capable ThinkPad\n");
6460 break; 6460 break;
6461 default: 6461 default:
6462 pr_err("Unsupported brightness interface, " 6462 pr_info("Unsupported brightness interface\n");
6463 "please contact %s\n", TPACPI_MAIL);
6464 tp_features.bright_unkfw = 1; 6463 tp_features.bright_unkfw = 1;
6465 bright_maxlvl = b - 1; 6464 bright_maxlvl = b - 1;
6466 } 6465 }