aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS4
-rw-r--r--drivers/platform/x86/ideapad-laptop.c31
-rw-r--r--drivers/platform/x86/toshiba_acpi.c27
3 files changed, 24 insertions, 38 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index cf24bb56bab9..5e7866a486b0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10070,9 +10070,9 @@ F: Documentation/x86/
10070F: arch/x86/ 10070F: arch/x86/
10071 10071
10072X86 PLATFORM DRIVERS 10072X86 PLATFORM DRIVERS
10073M: Matthew Garrett <matthew.garrett@nebula.com> 10073M: Darren Hart <dvhart@infradead.org>
10074L: platform-driver-x86@vger.kernel.org 10074L: platform-driver-x86@vger.kernel.org
10075T: git git://cavan.codon.org.uk/platform-drivers-x86.git 10075T: git git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git
10076S: Maintained 10076S: Maintained
10077F: drivers/platform/x86/ 10077F: drivers/platform/x86/
10078 10078
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index fc468a3d95ce..02152de135b5 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -88,7 +88,6 @@ struct ideapad_private {
88 struct dentry *debug; 88 struct dentry *debug;
89 unsigned long cfg; 89 unsigned long cfg;
90 bool has_hw_rfkill_switch; 90 bool has_hw_rfkill_switch;
91 bool has_touchpad_control;
92}; 91};
93 92
94static bool no_bt_rfkill; 93static bool no_bt_rfkill;
@@ -456,7 +455,7 @@ struct ideapad_rfk_data {
456 int type; 455 int type;
457}; 456};
458 457
459const const struct ideapad_rfk_data ideapad_rfk_data[] = { 458static const struct ideapad_rfk_data ideapad_rfk_data[] = {
460 { "ideapad_wlan", CFG_WIFI_BIT, VPCCMD_W_WIFI, RFKILL_TYPE_WLAN }, 459 { "ideapad_wlan", CFG_WIFI_BIT, VPCCMD_W_WIFI, RFKILL_TYPE_WLAN },
461 { "ideapad_bluetooth", CFG_BT_BIT, VPCCMD_W_BT, RFKILL_TYPE_BLUETOOTH }, 460 { "ideapad_bluetooth", CFG_BT_BIT, VPCCMD_W_BT, RFKILL_TYPE_BLUETOOTH },
462 { "ideapad_3g", CFG_3G_BIT, VPCCMD_W_3G, RFKILL_TYPE_WWAN }, 461 { "ideapad_3g", CFG_3G_BIT, VPCCMD_W_3G, RFKILL_TYPE_WWAN },
@@ -767,9 +766,6 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv)
767{ 766{
768 unsigned long value; 767 unsigned long value;
769 768
770 if (!priv->has_touchpad_control)
771 return;
772
773 /* Without reading from EC touchpad LED doesn't switch state */ 769 /* Without reading from EC touchpad LED doesn't switch state */
774 if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) { 770 if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) {
775 /* Some IdeaPads don't really turn off touchpad - they only 771 /* Some IdeaPads don't really turn off touchpad - they only
@@ -833,29 +829,7 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data)
833 * always results in 0 on these models, causing ideapad_laptop to wrongly 829 * always results in 0 on these models, causing ideapad_laptop to wrongly
834 * report all radios as hardware-blocked. 830 * report all radios as hardware-blocked.
835 */ 831 */
836static struct dmi_system_id no_hw_rfkill_list[] = { 832static const struct dmi_system_id no_hw_rfkill_list[] = {
837 {
838 .ident = "Lenovo Yoga 2 11 / 13 / Pro",
839 .matches = {
840 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
841 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2"),
842 },
843 },
844 {}
845};
846
847/*
848 * Some models don't offer touchpad ctrl through the ideapad interface, causing
849 * ideapad_sync_touchpad_state to send wrong touchpad enable/disable events.
850 */
851static struct dmi_system_id no_touchpad_ctrl_list[] = {
852 {
853 .ident = "Lenovo Yoga 1 series",
854 .matches = {
855 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
856 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga"),
857 },
858 },
859 { 833 {
860 .ident = "Lenovo Yoga 2 11 / 13 / Pro", 834 .ident = "Lenovo Yoga 2 11 / 13 / Pro",
861 .matches = { 835 .matches = {
@@ -889,7 +863,6 @@ static int ideapad_acpi_add(struct platform_device *pdev)
889 priv->adev = adev; 863 priv->adev = adev;
890 priv->platform_device = pdev; 864 priv->platform_device = pdev;
891 priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list); 865 priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list);
892 priv->has_touchpad_control = !dmi_check_system(no_touchpad_ctrl_list);
893 866
894 ret = ideapad_sysfs_init(priv); 867 ret = ideapad_sysfs_init(priv);
895 if (ret) 868 if (ret)
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index b062d3d7b373..d0dce734b2ed 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -1255,10 +1255,15 @@ static ssize_t toshiba_kbd_bl_mode_store(struct device *dev,
1255 const char *buf, size_t count) 1255 const char *buf, size_t count)
1256{ 1256{
1257 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev); 1257 struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
1258 int mode = -1; 1258 int mode;
1259 int time = -1; 1259 int time;
1260 int ret;
1260 1261
1261 if (sscanf(buf, "%i", &mode) != 1 && (mode != 2 || mode != 1)) 1262
1263 ret = kstrtoint(buf, 0, &mode);
1264 if (ret)
1265 return ret;
1266 if (mode != SCI_KBD_MODE_FNZ && mode != SCI_KBD_MODE_AUTO)
1262 return -EINVAL; 1267 return -EINVAL;
1263 1268
1264 /* Set the Keyboard Backlight Mode where: 1269 /* Set the Keyboard Backlight Mode where:
@@ -1266,11 +1271,12 @@ static ssize_t toshiba_kbd_bl_mode_store(struct device *dev,
1266 * Auto - KBD backlight turns off automatically in given time 1271 * Auto - KBD backlight turns off automatically in given time
1267 * FN-Z - KBD backlight "toggles" when hotkey pressed 1272 * FN-Z - KBD backlight "toggles" when hotkey pressed
1268 */ 1273 */
1269 if (mode != -1 && toshiba->kbd_mode != mode) { 1274 if (toshiba->kbd_mode != mode) {
1270 time = toshiba->kbd_time << HCI_MISC_SHIFT; 1275 time = toshiba->kbd_time << HCI_MISC_SHIFT;
1271 time = time + toshiba->kbd_mode; 1276 time = time + toshiba->kbd_mode;
1272 if (toshiba_kbd_illum_status_set(toshiba, time) < 0) 1277 ret = toshiba_kbd_illum_status_set(toshiba, time);
1273 return -EIO; 1278 if (ret)
1279 return ret;
1274 toshiba->kbd_mode = mode; 1280 toshiba->kbd_mode = mode;
1275 } 1281 }
1276 1282
@@ -1857,9 +1863,16 @@ static int toshiba_acpi_resume(struct device *device)
1857{ 1863{
1858 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device)); 1864 struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
1859 u32 result; 1865 u32 result;
1866 acpi_status status;
1867
1868 if (dev->hotkey_dev) {
1869 status = acpi_evaluate_object(dev->acpi_dev->handle, "ENAB",
1870 NULL, NULL);
1871 if (ACPI_FAILURE(status))
1872 pr_info("Unable to re-enable hotkeys\n");
1860 1873
1861 if (dev->hotkey_dev)
1862 hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE, &result); 1874 hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE, &result);
1875 }
1863 1876
1864 return 0; 1877 return 0;
1865} 1878}