Skip to content

Commit f3b5020

Browse files
committed
Merge tag 'platform-drivers-x86-v4.18-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Darren Hart: "Several incremental improvements including new keycodes, new models, new quirks, and related documentation. Adds LED platform driver activation for Mellanox systems. Some minor optimizations and cleanups. Includes several bug fixes, message silencing, mostly minor Automated summary: acer-wmi: - add another KEY_POWER keycode apple-gmux: - fix gmux_get_client_id()'s return type asus-laptop: - Simplify getting .drvdata asus-wireless: - Fix format specifier dell-laptop: - Fix keyboard backlight timeout on XPS 13 9370 dell-smbios: - Match on www.dell.com in OEM strings too dell-wmi: - Ignore new rfkill and fn-lock events - Set correct keycode for Fn + left arrow fujitsu-laptop: - Simplify soft key handling ideapad-laptop: - Add E42-80 to no_hw_rfkill - Add fn-lock setting - Add MIIX 720-12IKB to no_hw_rfkill lib/string_helpers: - Add missed declaration of struct task_struct intel_scu_ipc: - Replace mdelay with usleep_range in intel_scu_ipc_i2c_cntrl mlx-platform: - Add LED platform driver activation platform/mellanox: - Add new ODM system types to mlx-platform - mlxreg-hotplug: add extra cycle for hotplug work queue - mlxreg-hotplug: Document fixes for hotplug private data platform_data/mlxreg: - Document fixes for hotplug device silead_dmi: - Add entry for Chuwi Hi8 tablet touchscreen - Add touchscreen info for the Onda V891w tablet - Add info for the PoV mobii TAB-P800W (v2.0) - Add touchscreen info for the Jumper EZpad 6 Pro thinkpad_acpi: - silence false-positive-prone pr_warn - do not report thermal sensor state for tablet mode switch - silence HKEY 0x6032, 0x60f0, 0x6030" * tag 'platform-drivers-x86-v4.18-1' of git://git.infradead.org/linux-platform-drivers-x86: (30 commits) platform/x86: silead_dmi: Add entry for Chuwi Hi8 tablet touchscreen platform/x86: dell-laptop: Fix keyboard backlight timeout on XPS 13 9370 platform/x86: dell-wmi: Ignore new rfkill and fn-lock events platform/x86: mlx-platform: Add LED platform driver activation platform/mellanox: Add new ODM system types to mlx-platform platform/mellanox: mlxreg-hotplug: add extra cycle for hotplug work queue platform/x86: ideapad-laptop: Add E42-80 to no_hw_rfkill platform/x86: silead_dmi: Add touchscreen info for the Onda V891w tablet platform/x86: silead_dmi: Add info for the PoV mobii TAB-P800W (v2.0) platform/x86: silead_dmi: Add touchscreen info for the Jumper EZpad 6 Pro platform/x86: asus-wireless: Fix format specifier platform/x86: asus-wmi: Fix NULL pointer dereference platform/x86: dell-wmi: Set correct keycode for Fn + left arrow platform/x86: acer-wmi: add another KEY_POWER keycode platform/x86: ideapad-laptop: Add fn-lock setting platform/x86: ideapad-laptop: Add MIIX 720-12IKB to no_hw_rfkill lib/string_helpers: Add missed declaration of struct task_struct platform/x86: DELL_WMI use depends on instead of select for DELL_SMBIOS platform/mellanox: mlxreg-hotplug: Document fixes for hotplug private data platform_data/mlxreg: Document fixes for hotplug device ...
2 parents 4b4bb99 + 26ed9d1 commit f3b5020

20 files changed

+585
-77
lines changed

Documentation/ABI/testing/sysfs-platform-ideapad-laptop

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,16 @@ Description:
2525
Control touchpad mode.
2626
* 1 -> Switched On
2727
* 0 -> Switched Off
28+
29+
What: /sys/bus/pci/devices/<bdf>/<device>/VPC2004:00/fn_lock
30+
Date: May 2018
31+
KernelVersion: 4.18
32+
Contact: "Oleg Keri <[email protected]>"
33+
Description:
34+
Control fn-lock mode.
35+
* 1 -> Switched On
36+
* 0 -> Switched Off
37+
38+
For example:
39+
# echo "0" > \
40+
/sys/bus/pci/devices/0000:00:1f.0/PNP0C09:00/VPC2004:00/fn_lock

Documentation/laptops/thinkpad-acpi.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,10 @@ Events that are propagated by the driver to userspace:
540540
0x6021 ALARM: a sensor is too hot
541541
0x6022 ALARM: a sensor is extremely hot
542542
0x6030 System thermal table changed
543+
0x6032 Thermal Control command set completion (DYTC, Windows)
543544
0x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED)
544545
0x60C0 X1 Yoga 2016, Tablet mode status changed
546+
0x60F0 Thermal Transformation changed (GMTS, Windows)
545547

546548
Battery nearly empty alarms are a last resort attempt to get the
547549
operating system to hibernate or shutdown cleanly (0x2313), or shutdown

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@
5555
#define MLXREG_HOTPLUG_RST_CNTR 3
5656

5757
#define MLXREG_HOTPLUG_ATTRS_MAX 24
58+
#define MLXREG_HOTPLUG_NOT_ASSERT 3
5859

5960
/**
6061
* struct mlxreg_hotplug_priv_data - platform private data:
6162
* @irq: platform device interrupt number;
63+
* @dev: basic device;
6264
* @pdev: platform device;
6365
* @plat: platform data;
64-
* @dwork: delayed work template;
66+
* @regmap: register map handle;
67+
* @dwork_irq: delayed work template;
6568
* @lock: spin lock;
6669
* @hwmon: hwmon device;
6770
* @mlxreg_hotplug_attr: sysfs attributes array;
@@ -71,6 +74,8 @@
7174
* @cell: location of top aggregation interrupt register;
7275
* @mask: top aggregation interrupt common mask;
7376
* @aggr_cache: last value of aggregation register status;
77+
* @after_probe: flag indication probing completion;
78+
* @not_asserted: number of entries in workqueue with no signal assertion;
7479
*/
7580
struct mlxreg_hotplug_priv_data {
7681
int irq;
@@ -79,7 +84,6 @@ struct mlxreg_hotplug_priv_data {
7984
struct mlxreg_hotplug_platform_data *plat;
8085
struct regmap *regmap;
8186
struct delayed_work dwork_irq;
82-
struct delayed_work dwork;
8387
spinlock_t lock; /* sync with interrupt */
8488
struct device *hwmon;
8589
struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_MAX + 1];
@@ -91,6 +95,7 @@ struct mlxreg_hotplug_priv_data {
9195
u32 mask;
9296
u32 aggr_cache;
9397
bool after_probe;
98+
u8 not_asserted;
9499
};
95100

96101
static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
@@ -409,6 +414,18 @@ static void mlxreg_hotplug_work_handler(struct work_struct *work)
409414
aggr_asserted = priv->aggr_cache ^ regval;
410415
priv->aggr_cache = regval;
411416

417+
/*
418+
* Handler is invoked, but no assertion is detected at top aggregation
419+
* status level. Set aggr_asserted to mask value to allow handler extra
420+
* run over all relevant signals to recover any missed signal.
421+
*/
422+
if (priv->not_asserted == MLXREG_HOTPLUG_NOT_ASSERT) {
423+
priv->not_asserted = 0;
424+
aggr_asserted = pdata->mask;
425+
}
426+
if (!aggr_asserted)
427+
goto unmask_event;
428+
412429
/* Handle topology and health configuration changes. */
413430
for (i = 0; i < pdata->counter; i++, item++) {
414431
if (aggr_asserted & item->aggr_mask) {
@@ -419,27 +436,26 @@ static void mlxreg_hotplug_work_handler(struct work_struct *work)
419436
}
420437
}
421438

422-
if (aggr_asserted) {
423-
spin_lock_irqsave(&priv->lock, flags);
439+
spin_lock_irqsave(&priv->lock, flags);
424440

425-
/*
426-
* It is possible, that some signals have been inserted, while
427-
* interrupt has been masked by mlxreg_hotplug_work_handler.
428-
* In this case such signals will be missed. In order to handle
429-
* these signals delayed work is canceled and work task
430-
* re-scheduled for immediate execution. It allows to handle
431-
* missed signals, if any. In other case work handler just
432-
* validates that no new signals have been received during
433-
* masking.
434-
*/
435-
cancel_delayed_work(&priv->dwork_irq);
436-
schedule_delayed_work(&priv->dwork_irq, 0);
441+
/*
442+
* It is possible, that some signals have been inserted, while
443+
* interrupt has been masked by mlxreg_hotplug_work_handler. In this
444+
* case such signals will be missed. In order to handle these signals
445+
* delayed work is canceled and work task re-scheduled for immediate
446+
* execution. It allows to handle missed signals, if any. In other case
447+
* work handler just validates that no new signals have been received
448+
* during masking.
449+
*/
450+
cancel_delayed_work(&priv->dwork_irq);
451+
schedule_delayed_work(&priv->dwork_irq, 0);
437452

438-
spin_unlock_irqrestore(&priv->lock, flags);
453+
spin_unlock_irqrestore(&priv->lock, flags);
439454

440-
return;
441-
}
455+
return;
442456

457+
unmask_event:
458+
priv->not_asserted++;
443459
/* Unmask aggregation event (no need acknowledge). */
444460
ret = regmap_write(priv->regmap, pdata->cell +
445461
MLXREG_HOTPLUG_AGGR_MASK_OFF, pdata->mask);

drivers/platform/x86/acer-wmi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = {
129129
{KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
130130
{KE_KEY, 0x85, {KEY_TOUCHPAD_TOGGLE} },
131131
{KE_KEY, 0x86, {KEY_WLAN} },
132+
{KE_KEY, 0x87, {KEY_POWER} },
132133
{KE_END, 0}
133134
};
134135

drivers/platform/x86/apple-gmux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ static int gmux_set_power_state(enum vga_switcheroo_client_id id,
495495
return gmux_set_discrete_state(apple_gmux_data, state);
496496
}
497497

498-
static int gmux_get_client_id(struct pci_dev *pdev)
498+
static enum vga_switcheroo_client_id gmux_get_client_id(struct pci_dev *pdev)
499499
{
500500
/*
501501
* Early Macbook Pros with switchable graphics use nvidia

drivers/platform/x86/asus-laptop.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,8 +1593,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
15931593
int idx)
15941594
{
15951595
struct device *dev = container_of(kobj, struct device, kobj);
1596-
struct platform_device *pdev = to_platform_device(dev);
1597-
struct asus_laptop *asus = platform_get_drvdata(pdev);
1596+
struct asus_laptop *asus = dev_get_drvdata(dev);
15981597
acpi_handle handle = asus->handle;
15991598
bool supported;
16001599

drivers/platform/x86/asus-wireless.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static u64 asus_wireless_method(acpi_handle handle, const char *method,
7272
acpi_handle_err(handle,
7373
"Failed to eval method %s, param %#x (%d)\n",
7474
method, param, s);
75-
acpi_handle_debug(handle, "%s returned %#x\n", method, (uint) ret);
75+
acpi_handle_debug(handle, "%s returned %#llx\n", method, ret);
7676
return ret;
7777
}
7878

drivers/platform/x86/asus-wmi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,8 +1875,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
18751875
struct attribute *attr, int idx)
18761876
{
18771877
struct device *dev = container_of(kobj, struct device, kobj);
1878-
struct platform_device *pdev = to_platform_device(dev);
1879-
struct asus_wmi *asus = platform_get_drvdata(pdev);
1878+
struct asus_wmi *asus = dev_get_drvdata(dev);
18801879
bool ok = true;
18811880
int devid = -1;
18821881

drivers/platform/x86/dell-laptop.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
struct quirk_entry {
3939
bool touchpad_led;
4040
bool kbd_led_levels_off_1;
41+
bool kbd_missing_ac_tag;
4142

4243
bool needs_kbd_timeouts;
4344
/*
@@ -68,6 +69,10 @@ static struct quirk_entry quirk_dell_xps13_9333 = {
6869
.kbd_timeouts = { 0, 5, 15, 60, 5 * 60, 15 * 60, -1 },
6970
};
7071

72+
static struct quirk_entry quirk_dell_xps13_9370 = {
73+
.kbd_missing_ac_tag = true,
74+
};
75+
7176
static struct quirk_entry quirk_dell_latitude_e6410 = {
7277
.kbd_led_levels_off_1 = true,
7378
};
@@ -291,6 +296,15 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
291296
},
292297
.driver_data = &quirk_dell_xps13_9333,
293298
},
299+
{
300+
.callback = dmi_matched,
301+
.ident = "Dell XPS 13 9370",
302+
.matches = {
303+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
304+
DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9370"),
305+
},
306+
.driver_data = &quirk_dell_xps13_9370,
307+
},
294308
{
295309
.callback = dmi_matched,
296310
.ident = "Dell Latitude E6410",
@@ -1401,7 +1415,8 @@ static inline int kbd_init_info(void)
14011415
* timeout value which is shared for both battery and AC power
14021416
* settings. So do not try to set AC values on old models.
14031417
*/
1404-
if (dell_smbios_find_token(KBD_LED_AC_TOKEN))
1418+
if ((quirks && quirks->kbd_missing_ac_tag) ||
1419+
dell_smbios_find_token(KBD_LED_AC_TOKEN))
14051420
kbd_timeout_ac_supported = true;
14061421

14071422
kbd_get_state(&state);

drivers/platform/x86/dell-smbios-base.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,10 @@ static void free_group(struct platform_device *pdev)
555555

556556
static int __init dell_smbios_init(void)
557557
{
558-
const struct dmi_device *valid;
559558
int ret, wmi, smm;
560559

561-
valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL);
562-
if (!valid) {
560+
if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) &&
561+
!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) {
563562
pr_err("Unable to run on non-Dell system\n");
564563
return -ENODEV;
565564
}

0 commit comments

Comments
 (0)