Skip to content

Commit a7726f6

Browse files
committed
Merge tag 'platform-drivers-x86-v4.17-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Andy Shevchenko: - Dell SMBIOS driver fixed against memory leaks. - The fujitsu-laptop driver is cleaned up and now supports hotkeys for Lifebook U7x7 models. Besides that the typo introduced by one of previous clean up series has been fixed. - Specific to x86-based laptops HID device now supports KEY_ROTATE_LOCK_TOGGLE event which is emitted, for example, by Wacom MobileStudio Pro 13. - Turbo MAX 3 technology is enabled for the rest of platforms that support Hardware-P-States feature which have core priority described by ACPI CPPC table. - Mellanox on x86 gets better support of I2C bus in use including support of hotpluggable ones. - Silead touchscreen is enabled on two tablet models, i.e Yours Y8W81 and I.T.Works TW701. - From now on the second fan on Thinkpad P50 is supported. - The topstar-laptop driver is reworked to support new models, in particular Topstar U931. * tag 'platform-drivers-x86-v4.17-1' of git://git.infradead.org/linux-platform-drivers-x86: (41 commits) platform/x86: thinkpad_acpi: Add 2nd Fan Support for Thinkpad P50 platform/x86: dell-smbios: Fix memory leaks in build_tokens_sysfs() intel-hid: support KEY_ROTATE_LOCK_TOGGLE intel-hid: clean up and sort header files platform/x86: silead_dmi: Add entry for the Yours Y8W81 tablet platform/x86: fujitsu-laptop: Support Lifebook U7x7 hotkeys platform/x86: mlx-platform: Add physical bus number auto detection platform/mellanox: mlxreg-hotplug: Change input for device create routine platform/x86: mlx-platform: Add deffered bus functionality platform/x86: mlx-platform: Use define for the channel numbers platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an int platform/x86: Fix dell driver init order platform/x86: dell-smbios: Resolve dependency error on ACPI_WMI platform/x86: dell-smbios: Resolve dependency error on DCDBAS platform/x86: Allow for SMBIOS backend defaults platform/x86: dell-smbios: Link all dell-smbios-* modules together platform/x86: dell-smbios: Rename dell-smbios source to dell-smbios-base platform/x86: dell-smbios: Correct some style warnings platform/x86: wmi: Fix misuse of vsprintf extension %pULL platform/x86: intel-hid: Reset wakeup capable flag on removal ...
2 parents 1b02dcb + a986c75 commit a7726f6

File tree

13 files changed

+529
-212
lines changed

13 files changed

+529
-212
lines changed

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,33 @@ struct mlxreg_hotplug_priv_data {
9393
bool after_probe;
9494
};
9595

96-
static int mlxreg_hotplug_device_create(struct device *dev,
96+
static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
9797
struct mlxreg_core_data *data)
9898
{
99+
struct mlxreg_core_hotplug_platform_data *pdata;
100+
99101
/*
100102
* Return if adapter number is negative. It could be in case hotplug
101103
* event is not associated with hotplug device.
102104
*/
103105
if (data->hpdev.nr < 0)
104106
return 0;
105107

106-
data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
108+
pdata = dev_get_platdata(&priv->pdev->dev);
109+
data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr +
110+
pdata->shift_nr);
107111
if (!data->hpdev.adapter) {
108-
dev_err(dev, "Failed to get adapter for bus %d\n",
109-
data->hpdev.nr);
112+
dev_err(priv->dev, "Failed to get adapter for bus %d\n",
113+
data->hpdev.nr + pdata->shift_nr);
110114
return -EFAULT;
111115
}
112116

113117
data->hpdev.client = i2c_new_device(data->hpdev.adapter,
114118
data->hpdev.brdinfo);
115119
if (!data->hpdev.client) {
116-
dev_err(dev, "Failed to create client %s at bus %d at addr 0x%02x\n",
117-
data->hpdev.brdinfo->type, data->hpdev.nr,
118-
data->hpdev.brdinfo->addr);
120+
dev_err(priv->dev, "Failed to create client %s at bus %d at addr 0x%02x\n",
121+
data->hpdev.brdinfo->type, data->hpdev.nr +
122+
pdata->shift_nr, data->hpdev.brdinfo->addr);
119123

120124
i2c_put_adapter(data->hpdev.adapter);
121125
data->hpdev.adapter = NULL;
@@ -270,10 +274,10 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
270274
if (item->inversed)
271275
mlxreg_hotplug_device_destroy(data);
272276
else
273-
mlxreg_hotplug_device_create(priv->dev, data);
277+
mlxreg_hotplug_device_create(priv, data);
274278
} else {
275279
if (item->inversed)
276-
mlxreg_hotplug_device_create(priv->dev, data);
280+
mlxreg_hotplug_device_create(priv, data);
277281
else
278282
mlxreg_hotplug_device_destroy(data);
279283
}
@@ -319,7 +323,7 @@ mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv,
319323
if (regval == MLXREG_HOTPLUG_HEALTH_MASK) {
320324
if ((data->health_cntr++ == MLXREG_HOTPLUG_RST_CNTR) ||
321325
!priv->after_probe) {
322-
mlxreg_hotplug_device_create(priv->dev, data);
326+
mlxreg_hotplug_device_create(priv, data);
323327
data->attached = true;
324328
}
325329
} else {
@@ -550,6 +554,7 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
550554
{
551555
struct mlxreg_core_hotplug_platform_data *pdata;
552556
struct mlxreg_hotplug_priv_data *priv;
557+
struct i2c_adapter *deferred_adap;
553558
int err;
554559

555560
pdata = dev_get_platdata(&pdev->dev);
@@ -558,6 +563,12 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
558563
return -EINVAL;
559564
}
560565

566+
/* Defer probing if the necessary adapter is not configured yet. */
567+
deferred_adap = i2c_get_adapter(pdata->deferred_nr);
568+
if (!deferred_adap)
569+
return -EPROBE_DEFER;
570+
i2c_put_adapter(deferred_adap);
571+
561572
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
562573
if (!priv)
563574
return -ENOMEM;

drivers/platform/x86/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@ config TOPSTAR_LAPTOP
757757
depends on ACPI
758758
depends on INPUT
759759
select INPUT_SPARSEKMAP
760+
select LEDS_CLASS
761+
select NEW_LEDS
760762
---help---
761763
This driver adds support for hotkeys found on Topstar laptops.
762764

@@ -1174,6 +1176,7 @@ config INTEL_TELEMETRY
11741176

11751177
config MLX_PLATFORM
11761178
tristate "Mellanox Technologies platform support"
1179+
depends on I2C && REGMAP
11771180
---help---
11781181
This option enables system support for the Mellanox Technologies
11791182
platform. The Mellanox systems provide data center networking

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static int build_tokens_sysfs(struct platform_device *dev)
514514
continue;
515515

516516
loop_fail_create_value:
517-
kfree(value_name);
517+
kfree(location_name);
518518
goto out_unwind_strings;
519519
}
520520
smbios_attribute_group.attrs = token_attrs;
@@ -525,7 +525,7 @@ static int build_tokens_sysfs(struct platform_device *dev)
525525
return 0;
526526

527527
out_unwind_strings:
528-
for (i = i-1; i > 0; i--) {
528+
while (i--) {
529529
kfree(token_location_attrs[i].attr.name);
530530
kfree(token_value_attrs[i].attr.name);
531531
}

0 commit comments

Comments
 (0)