Skip to content

Commit e01e060

Browse files
committed
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
2 parents ff39074 + 8c2eb7b commit e01e060

File tree

6 files changed

+26
-4
lines changed

6 files changed

+26
-4
lines changed

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ static int mlxreg_hotplug_remove(struct platform_device *pdev)
694694

695695
/* Clean interrupts setup. */
696696
mlxreg_hotplug_unset_irq(priv);
697+
devm_free_irq(&pdev->dev, priv->irq, priv);
697698

698699
return 0;
699700
}

drivers/platform/x86/asus-nb-wmi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
6565

6666
static struct quirk_entry quirk_asus_unknown = {
6767
.wapf = 0,
68+
.wmi_backlight_set_devstate = true,
6869
};
6970

7071
static struct quirk_entry quirk_asus_q500a = {
7172
.i8042_filter = asus_q500a_i8042_filter,
73+
.wmi_backlight_set_devstate = true,
7274
};
7375

7476
/*
@@ -79,26 +81,32 @@ static struct quirk_entry quirk_asus_q500a = {
7981
static struct quirk_entry quirk_asus_x55u = {
8082
.wapf = 4,
8183
.wmi_backlight_power = true,
84+
.wmi_backlight_set_devstate = true,
8285
.no_display_toggle = true,
8386
};
8487

8588
static struct quirk_entry quirk_asus_wapf4 = {
8689
.wapf = 4,
90+
.wmi_backlight_set_devstate = true,
8791
};
8892

8993
static struct quirk_entry quirk_asus_x200ca = {
9094
.wapf = 2,
95+
.wmi_backlight_set_devstate = true,
9196
};
9297

9398
static struct quirk_entry quirk_asus_ux303ub = {
9499
.wmi_backlight_native = true,
100+
.wmi_backlight_set_devstate = true,
95101
};
96102

97103
static struct quirk_entry quirk_asus_x550lb = {
104+
.wmi_backlight_set_devstate = true,
98105
.xusb2pr = 0x01D9,
99106
};
100107

101108
static struct quirk_entry quirk_asus_forceals = {
109+
.wmi_backlight_set_devstate = true,
102110
.wmi_force_als_set = true,
103111
};
104112

drivers/platform/x86/asus-wmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,7 @@ static int asus_wmi_add(struct platform_device *pdev)
21462146
err = asus_wmi_backlight_init(asus);
21472147
if (err && err != -ENODEV)
21482148
goto fail_backlight;
2149-
} else
2149+
} else if (asus->driver->quirks->wmi_backlight_set_devstate)
21502150
err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL);
21512151

21522152
if (asus_wmi_has_fnlock_key(asus)) {

drivers/platform/x86/asus-wmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct quirk_entry {
3131
bool store_backlight_power;
3232
bool wmi_backlight_power;
3333
bool wmi_backlight_native;
34+
bool wmi_backlight_set_devstate;
3435
bool wmi_force_als_set;
3536
int wapf;
3637
/*

drivers/platform/x86/intel-vbtn.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,24 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
7676
struct platform_device *device = context;
7777
struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev);
7878
unsigned int val = !(event & 1); /* Even=press, Odd=release */
79-
const struct key_entry *ke_rel;
79+
const struct key_entry *ke, *ke_rel;
8080
bool autorelease;
8181

8282
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) {
8485
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);
8597
return;
8698
}
8799
goto out_unknown;

drivers/platform/x86/mlx-platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ static int __init mlxplat_init(void)
20322032

20332033
for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) {
20342034
priv->pdev_mux[i] = platform_device_register_resndata(
2035-
&mlxplat_dev->dev,
2035+
&priv->pdev_i2c->dev,
20362036
"i2c-mux-reg", i, NULL,
20372037
0, &mlxplat_mux_data[i],
20382038
sizeof(mlxplat_mux_data[i]));

0 commit comments

Comments
 (0)