diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-06-15 13:38:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-06-15 13:38:54 -0400 |
commit | e01e060fe00dca46959bbf055b75d9f57ba6e7be (patch) | |
tree | 6251229d73e897adf04b0135982d8e7f77b254b1 | |
parent | ff39074b1d4e727c299ccfd1588f9cca17a59c86 (diff) | |
parent | 8c2eb7b6468ad4aa5600aed01aa0715f921a3f8b (diff) |
Merge tag 'platform-drivers-x86-v5.2-3' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver fixes from Andy Shevchenko:
- fix a couple of Mellanox driver enumeration issues
- fix ASUS laptop regression with backlight
- fix Dell computers that got a wrong mode (tablet versus laptop) after
resume
* tag 'platform-drivers-x86-v5.2-3' of git://git.infradead.org/linux-platform-drivers-x86:
platform/mellanox: mlxreg-hotplug: Add devm_free_irq call to remove flow
platform/x86: mlx-platform: Fix parent device in i2c-mux-reg device registration
platform/x86: intel-vbtn: Report switch events when event wakes device
platform/x86: asus-wmi: Only Tell EC the OS will handle display hotkeys from asus_nb_wmi
-rw-r--r-- | drivers/platform/mellanox/mlxreg-hotplug.c | 1 | ||||
-rw-r--r-- | drivers/platform/x86/asus-nb-wmi.c | 8 | ||||
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/asus-wmi.h | 1 | ||||
-rw-r--r-- | drivers/platform/x86/intel-vbtn.c | 16 | ||||
-rw-r--r-- | drivers/platform/x86/mlx-platform.c | 2 |
6 files changed, 26 insertions, 4 deletions
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 687ce6817d0d..f85a1b9d129b 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c | |||
@@ -694,6 +694,7 @@ static int mlxreg_hotplug_remove(struct platform_device *pdev) | |||
694 | 694 | ||
695 | /* Clean interrupts setup. */ | 695 | /* Clean interrupts setup. */ |
696 | mlxreg_hotplug_unset_irq(priv); | 696 | mlxreg_hotplug_unset_irq(priv); |
697 | devm_free_irq(&pdev->dev, priv->irq, priv); | ||
697 | 698 | ||
698 | return 0; | 699 | return 0; |
699 | } | 700 | } |
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c index 81642102bf65..8d9e30dbb5af 100644 --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c | |||
@@ -65,10 +65,12 @@ static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str, | |||
65 | 65 | ||
66 | static struct quirk_entry quirk_asus_unknown = { | 66 | static struct quirk_entry quirk_asus_unknown = { |
67 | .wapf = 0, | 67 | .wapf = 0, |
68 | .wmi_backlight_set_devstate = true, | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | static struct quirk_entry quirk_asus_q500a = { | 71 | static struct quirk_entry quirk_asus_q500a = { |
71 | .i8042_filter = asus_q500a_i8042_filter, | 72 | .i8042_filter = asus_q500a_i8042_filter, |
73 | .wmi_backlight_set_devstate = true, | ||
72 | }; | 74 | }; |
73 | 75 | ||
74 | /* | 76 | /* |
@@ -79,26 +81,32 @@ static struct quirk_entry quirk_asus_q500a = { | |||
79 | static struct quirk_entry quirk_asus_x55u = { | 81 | static struct quirk_entry quirk_asus_x55u = { |
80 | .wapf = 4, | 82 | .wapf = 4, |
81 | .wmi_backlight_power = true, | 83 | .wmi_backlight_power = true, |
84 | .wmi_backlight_set_devstate = true, | ||
82 | .no_display_toggle = true, | 85 | .no_display_toggle = true, |
83 | }; | 86 | }; |
84 | 87 | ||
85 | static struct quirk_entry quirk_asus_wapf4 = { | 88 | static struct quirk_entry quirk_asus_wapf4 = { |
86 | .wapf = 4, | 89 | .wapf = 4, |
90 | .wmi_backlight_set_devstate = true, | ||
87 | }; | 91 | }; |
88 | 92 | ||
89 | static struct quirk_entry quirk_asus_x200ca = { | 93 | static struct quirk_entry quirk_asus_x200ca = { |
90 | .wapf = 2, | 94 | .wapf = 2, |
95 | .wmi_backlight_set_devstate = true, | ||
91 | }; | 96 | }; |
92 | 97 | ||
93 | static struct quirk_entry quirk_asus_ux303ub = { | 98 | static struct quirk_entry quirk_asus_ux303ub = { |
94 | .wmi_backlight_native = true, | 99 | .wmi_backlight_native = true, |
100 | .wmi_backlight_set_devstate = true, | ||
95 | }; | 101 | }; |
96 | 102 | ||
97 | static struct quirk_entry quirk_asus_x550lb = { | 103 | static struct quirk_entry quirk_asus_x550lb = { |
104 | .wmi_backlight_set_devstate = true, | ||
98 | .xusb2pr = 0x01D9, | 105 | .xusb2pr = 0x01D9, |
99 | }; | 106 | }; |
100 | 107 | ||
101 | static struct quirk_entry quirk_asus_forceals = { | 108 | static struct quirk_entry quirk_asus_forceals = { |
109 | .wmi_backlight_set_devstate = true, | ||
102 | .wmi_force_als_set = true, | 110 | .wmi_force_als_set = true, |
103 | }; | 111 | }; |
104 | 112 | ||
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 3e4336025e8f..9b18a184e0aa 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -2146,7 +2146,7 @@ static int asus_wmi_add(struct platform_device *pdev) | |||
2146 | err = asus_wmi_backlight_init(asus); | 2146 | err = asus_wmi_backlight_init(asus); |
2147 | if (err && err != -ENODEV) | 2147 | if (err && err != -ENODEV) |
2148 | goto fail_backlight; | 2148 | goto fail_backlight; |
2149 | } else | 2149 | } else if (asus->driver->quirks->wmi_backlight_set_devstate) |
2150 | err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL); | 2150 | err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL); |
2151 | 2151 | ||
2152 | if (asus_wmi_has_fnlock_key(asus)) { | 2152 | if (asus_wmi_has_fnlock_key(asus)) { |
diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h index 0930be770688..4f31b68642a0 100644 --- a/drivers/platform/x86/asus-wmi.h +++ b/drivers/platform/x86/asus-wmi.h | |||
@@ -31,6 +31,7 @@ struct quirk_entry { | |||
31 | bool store_backlight_power; | 31 | bool store_backlight_power; |
32 | bool wmi_backlight_power; | 32 | bool wmi_backlight_power; |
33 | bool wmi_backlight_native; | 33 | bool wmi_backlight_native; |
34 | bool wmi_backlight_set_devstate; | ||
34 | bool wmi_force_als_set; | 35 | bool wmi_force_als_set; |
35 | int wapf; | 36 | int wapf; |
36 | /* | 37 | /* |
diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 06cd7e818ed5..a0d0cecff55f 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c | |||
@@ -76,12 +76,24 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) | |||
76 | struct platform_device *device = context; | 76 | struct platform_device *device = context; |
77 | struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); | 77 | struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev); |
78 | unsigned int val = !(event & 1); /* Even=press, Odd=release */ | 78 | unsigned int val = !(event & 1); /* Even=press, Odd=release */ |
79 | const struct key_entry *ke_rel; | 79 | const struct key_entry *ke, *ke_rel; |
80 | bool autorelease; | 80 | bool autorelease; |
81 | 81 | ||
82 | if (priv->wakeup_mode) { | 82 | if (priv->wakeup_mode) { |
83 | if (sparse_keymap_entry_from_scancode(priv->input_dev, event)) { | 83 | ke = sparse_keymap_entry_from_scancode(priv->input_dev, event); |
84 | if (ke) { | ||
84 | pm_wakeup_hard_event(&device->dev); | 85 | pm_wakeup_hard_event(&device->dev); |
86 | |||
87 | /* | ||
88 | * Switch events like tablet mode will wake the device | ||
89 | * and report the new switch position to the input | ||
90 | * subsystem. | ||
91 | */ | ||
92 | if (ke->type == KE_SW) | ||
93 | sparse_keymap_report_event(priv->input_dev, | ||
94 | event, | ||
95 | val, | ||
96 | 0); | ||
85 | return; | 97 | return; |
86 | } | 98 | } |
87 | goto out_unknown; | 99 | goto out_unknown; |
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index cee039f57499..983f02b5b106 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c | |||
@@ -2032,7 +2032,7 @@ static int __init mlxplat_init(void) | |||
2032 | 2032 | ||
2033 | for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) { | 2033 | for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) { |
2034 | priv->pdev_mux[i] = platform_device_register_resndata( | 2034 | priv->pdev_mux[i] = platform_device_register_resndata( |
2035 | &mlxplat_dev->dev, | 2035 | &priv->pdev_i2c->dev, |
2036 | "i2c-mux-reg", i, NULL, | 2036 | "i2c-mux-reg", i, NULL, |
2037 | 0, &mlxplat_mux_data[i], | 2037 | 0, &mlxplat_mux_data[i], |
2038 | sizeof(mlxplat_mux_data[i])); | 2038 | sizeof(mlxplat_mux_data[i])); |