Skip to content

Commit

Permalink
Merge tag 'platform-drivers-x86-v4.17-1' of git://git.infradead.org/l…
Browse files Browse the repository at this point in the history
…inux-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
  ...
  • Loading branch information
Linus Torvalds committed Apr 10, 2018
2 parents 1b02dcb + a986c75 commit a7726f6
Show file tree
Hide file tree
Showing 13 changed files with 529 additions and 212 deletions.
31 changes: 21 additions & 10 deletions drivers/platform/mellanox/mlxreg-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,33 @@ struct mlxreg_hotplug_priv_data {
bool after_probe;
};

static int mlxreg_hotplug_device_create(struct device *dev,
static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
struct mlxreg_core_data *data)
{
struct mlxreg_core_hotplug_platform_data *pdata;

/*
* Return if adapter number is negative. It could be in case hotplug
* event is not associated with hotplug device.
*/
if (data->hpdev.nr < 0)
return 0;

data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
pdata = dev_get_platdata(&priv->pdev->dev);
data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr +
pdata->shift_nr);
if (!data->hpdev.adapter) {
dev_err(dev, "Failed to get adapter for bus %d\n",
data->hpdev.nr);
dev_err(priv->dev, "Failed to get adapter for bus %d\n",
data->hpdev.nr + pdata->shift_nr);
return -EFAULT;
}

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

i2c_put_adapter(data->hpdev.adapter);
data->hpdev.adapter = NULL;
Expand Down Expand Up @@ -270,10 +274,10 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
if (item->inversed)
mlxreg_hotplug_device_destroy(data);
else
mlxreg_hotplug_device_create(priv->dev, data);
mlxreg_hotplug_device_create(priv, data);
} else {
if (item->inversed)
mlxreg_hotplug_device_create(priv->dev, data);
mlxreg_hotplug_device_create(priv, data);
else
mlxreg_hotplug_device_destroy(data);
}
Expand Down Expand Up @@ -319,7 +323,7 @@ mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv,
if (regval == MLXREG_HOTPLUG_HEALTH_MASK) {
if ((data->health_cntr++ == MLXREG_HOTPLUG_RST_CNTR) ||
!priv->after_probe) {
mlxreg_hotplug_device_create(priv->dev, data);
mlxreg_hotplug_device_create(priv, data);
data->attached = true;
}
} else {
Expand Down Expand Up @@ -550,6 +554,7 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
{
struct mlxreg_core_hotplug_platform_data *pdata;
struct mlxreg_hotplug_priv_data *priv;
struct i2c_adapter *deferred_adap;
int err;

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

/* Defer probing if the necessary adapter is not configured yet. */
deferred_adap = i2c_get_adapter(pdata->deferred_nr);
if (!deferred_adap)
return -EPROBE_DEFER;
i2c_put_adapter(deferred_adap);

priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
Expand Down
3 changes: 3 additions & 0 deletions drivers/platform/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ config TOPSTAR_LAPTOP
depends on ACPI
depends on INPUT
select INPUT_SPARSEKMAP
select LEDS_CLASS
select NEW_LEDS
---help---
This driver adds support for hotkeys found on Topstar laptops.

Expand Down Expand Up @@ -1174,6 +1176,7 @@ config INTEL_TELEMETRY

config MLX_PLATFORM
tristate "Mellanox Technologies platform support"
depends on I2C && REGMAP
---help---
This option enables system support for the Mellanox Technologies
platform. The Mellanox systems provide data center networking
Expand Down
4 changes: 2 additions & 2 deletions drivers/platform/x86/dell-smbios-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ static int build_tokens_sysfs(struct platform_device *dev)
continue;

loop_fail_create_value:
kfree(value_name);
kfree(location_name);
goto out_unwind_strings;
}
smbios_attribute_group.attrs = token_attrs;
Expand All @@ -525,7 +525,7 @@ static int build_tokens_sysfs(struct platform_device *dev)
return 0;

out_unwind_strings:
for (i = i-1; i > 0; i--) {
while (i--) {
kfree(token_location_attrs[i].attr.name);
kfree(token_value_attrs[i].attr.name);
}
Expand Down
Loading

0 comments on commit a7726f6

Please sign in to comment.