Commit 55ee6646 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v6.3-2' of...

Merge tag 'platform-drivers-x86-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:
 "A small set of assorted bug and build/warning fixes"

* tag 'platform-drivers-x86-v6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform: mellanox: mlx-platform: Initialize shift variable to 0
  platform/x86: int3472: Add GPIOs to Surface Go 3 Board data
  platform/x86: ISST: Fix kernel documentation warnings
  platform: x86: MLX_PLATFORM: select REGMAP instead of depending on it
  platform: mellanox: select REGMAP instead of depending on it
  platform/x86/intel/tpmi: Fix double free reported by Smatch
  platform/x86: ISST: Increase range of valid mail box commands
  platform/x86: dell-ddv: Fix temperature scaling
  platform/x86: dell-ddv: Fix cache invalidation on resume
  platform/x86/amd: pmc: remove CONFIG_SUSPEND checks
parents 7fef0997 1a0009ab
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -16,17 +16,17 @@ if MELLANOX_PLATFORM

config MLXREG_HOTPLUG
	tristate "Mellanox platform hotplug driver support"
	depends on REGMAP
	depends on HWMON
	depends on I2C
	select REGMAP
	help
	  This driver handles hot-plug events for the power suppliers, power
	  cables and fans on the wide range Mellanox IB and Ethernet systems.

config MLXREG_IO
	tristate "Mellanox platform register access driver support"
	depends on REGMAP
	depends on HWMON
	select REGMAP
	help
	  This driver allows access to Mellanox programmable device register
	  space through sysfs interface. The sets of registers for sysfs access
@@ -36,9 +36,9 @@ config MLXREG_IO

config MLXREG_LC
	tristate "Mellanox line card platform driver support"
	depends on REGMAP
	depends on HWMON
	depends on I2C
	select REGMAP
	help
	  This driver provides support for the Mellanox MSN4800-XX line cards,
	  which are the part of MSN4800 Ethernet modular switch systems
@@ -80,10 +80,9 @@ config MLXBF_PMC

config NVSW_SN2201
	tristate "Nvidia SN2201 platform driver support"
	depends on REGMAP
	depends on HWMON
	depends on I2C
	depends on REGMAP_I2C
	select REGMAP_I2C
	help
	  This driver provides support for the Nvidia SN2201 platform.
	  The SN2201 is a highly integrated for one rack unit system with
+2 −1
Original line number Diff line number Diff line
@@ -955,7 +955,8 @@ config SERIAL_MULTI_INSTANTIATE

config MLX_PLATFORM
	tristate "Mellanox Technologies platform support"
	depends on I2C && REGMAP
	depends on I2C
	select REGMAP
	help
	  This option enables system support for the Mellanox Technologies
	  platform. The Mellanox systems provide data center networking
+9 −21
Original line number Diff line number Diff line
@@ -171,9 +171,7 @@ MODULE_PARM_DESC(disable_workarounds, "Disable workarounds for platform bugs");
static struct amd_pmc_dev pmc;
static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret);
static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf);
#ifdef CONFIG_SUSPEND
static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data);
#endif

static inline u32 amd_pmc_reg_read(struct amd_pmc_dev *dev, int reg_offset)
{
@@ -386,7 +384,6 @@ static int get_metrics_table(struct amd_pmc_dev *pdev, struct smu_metrics *table
	return 0;
}

#ifdef CONFIG_SUSPEND
static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev)
{
	struct smu_metrics table;
@@ -400,7 +397,6 @@ static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev)
		dev_dbg(pdev->dev, "Last suspend in deepest state for %lluus\n",
			 table.timein_s0i3_lastcapture);
}
#endif

static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
{
@@ -673,7 +669,6 @@ static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg,
	return rc;
}

#ifdef CONFIG_SUSPEND
static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
{
	switch (dev->cpu_id) {
@@ -861,9 +856,7 @@ static int __maybe_unused amd_pmc_suspend_handler(struct device *dev)
	return 0;
}

static SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL);

#endif
static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL);

static const struct pci_device_id pmc_pci_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PS) },
@@ -905,7 +898,6 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
	return 0;
}

#ifdef CONFIG_SUSPEND
static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data)
{
	int err;
@@ -926,7 +918,6 @@ static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data)

	return 0;
}
#endif

static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf)
{
@@ -1017,11 +1008,11 @@ static int amd_pmc_probe(struct platform_device *pdev)
	}

	platform_set_drvdata(pdev, dev);
#ifdef CONFIG_SUSPEND
	if (IS_ENABLED(CONFIG_SUSPEND)) {
		err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops);
		if (err)
			dev_warn(dev->dev, "failed to register LPS0 sleep handler, expect increased power consumption\n");
#endif
	}

	amd_pmc_dbgfs_register(dev);
	return 0;
@@ -1035,9 +1026,8 @@ static int amd_pmc_remove(struct platform_device *pdev)
{
	struct amd_pmc_dev *dev = platform_get_drvdata(pdev);

#ifdef CONFIG_SUSPEND
	if (IS_ENABLED(CONFIG_SUSPEND))
		acpi_unregister_lps0_dev(&amd_pmc_s2idle_dev_ops);
#endif
	amd_pmc_dbgfs_unregister(dev);
	pci_dev_put(dev->rdev);
	mutex_destroy(&dev->lock);
@@ -1061,9 +1051,7 @@ static struct platform_driver amd_pmc_driver = {
		.name = "amd_pmc",
		.acpi_match_table = amd_pmc_acpi_ids,
		.dev_groups = pmc_groups,
#ifdef CONFIG_SUSPEND
		.pm = &amd_pmc_pm,
#endif
		.pm = pm_sleep_ptr(&amd_pmc_pm),
	},
	.probe = amd_pmc_probe,
	.remove = amd_pmc_remove,
+9 −3
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
#include <linux/kernel.h>
#include <linux/hwmon.h>
#include <linux/kstrtox.h>
#include <linux/math.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h>
@@ -96,6 +95,7 @@ struct combined_chip_info {
};

struct dell_wmi_ddv_sensors {
	bool active;
	struct mutex lock;	/* protect caching */
	unsigned long timestamp;
	union acpi_object *obj;
@@ -520,6 +520,9 @@ static struct hwmon_channel_info *dell_wmi_ddv_channel_create(struct device *dev

static void dell_wmi_ddv_hwmon_cache_invalidate(struct dell_wmi_ddv_sensors *sensors)
{
	if (!sensors->active)
		return;

	mutex_lock(&sensors->lock);
	kfree(sensors->obj);
	sensors->obj = NULL;
@@ -530,6 +533,7 @@ static void dell_wmi_ddv_hwmon_cache_destroy(void *data)
{
	struct dell_wmi_ddv_sensors *sensors = data;

	sensors->active = false;
	mutex_destroy(&sensors->lock);
	kfree(sensors->obj);
}
@@ -549,6 +553,7 @@ static struct hwmon_channel_info *dell_wmi_ddv_channel_init(struct wmi_device *w
		return ERR_PTR(ret);

	mutex_init(&sensors->lock);
	sensors->active = true;

	ret = devm_add_action_or_reset(&wdev->dev, dell_wmi_ddv_hwmon_cache_destroy, sensors);
	if (ret < 0)
@@ -659,7 +664,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char
	if (ret < 0)
		return ret;

	return sysfs_emit(buf, "%d\n", DIV_ROUND_CLOSEST(value, 10));
	/* Use 2731 instead of 2731.5 to avoid unnecessary rounding */
	return sysfs_emit(buf, "%d\n", value - 2731);
}

static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -852,7 +858,7 @@ static int dell_wmi_ddv_resume(struct device *dev)
{
	struct dell_wmi_ddv_data *data = dev_get_drvdata(dev);

	/* Force re-reading of all sensors */
	/* Force re-reading of all active sensors */
	dell_wmi_ddv_hwmon_cache_invalidate(&data->fans);
	dell_wmi_ddv_hwmon_cache_invalidate(&data->temps);

+3 −2
Original line number Diff line number Diff line
@@ -159,9 +159,10 @@ static const struct int3472_tps68470_board_data surface_go_tps68470_board_data =
static const struct int3472_tps68470_board_data surface_go3_tps68470_board_data = {
	.dev_name = "i2c-INT3472:01",
	.tps68470_regulator_pdata = &surface_go_tps68470_pdata,
	.n_gpiod_lookups = 1,
	.n_gpiod_lookups = 2,
	.tps68470_gpio_lookup_tables = {
		&surface_go_int347a_gpios
		&surface_go_int347a_gpios,
		&surface_go_int347e_gpios,
	},
};

Loading