Commit bb971421 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v6.17-5' of...

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

Pull x86 platform driver fixes from Ilpo Järvinen:
 "Fixes and New HW Supoort

   - amd/pmc: Use 8042 quirk for Stellaris Slim Gen6 AMD

   - dell: Set USTT mode according to BIOS after reboot

   - dell-lis3lv02d: Add Latitude E6530

   - lg-laptop: Fix setting the fan mode"

* tag 'platform-drivers-x86-v6.17-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: lg-laptop: Fix WMAB call in fan_mode_store()
  platform/x86: dell-lis3lv02d: Add Latitude E6530
  platform/x86/dell: Set USTT mode according to BIOS after reboot
  platform/x86/amd/pmc: Add Stellaris Slim Gen6 AMD to spurious 8042 quirks list
parents df283701 3ed17349
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -48,8 +48,8 @@ This value is reset to 100 when the kernel boots.
Fan mode
--------

Writing 1/0 to /sys/devices/platform/lg-laptop/fan_mode disables/enables
the fan silent mode.
Writing 0/1/2 to /sys/devices/platform/lg-laptop/fan_mode sets fan mode to
Optimal/Silent/Performance respectively.


USB charge
+7 −0
Original line number Diff line number Diff line
@@ -256,6 +256,13 @@ static const struct dmi_system_id fwbug_list[] = {
			DMI_MATCH(DMI_PRODUCT_NAME, "Lafite Pro V 14M"),
		}
	},
	{
		.ident = "TUXEDO Stellaris Slim 15 AMD Gen6",
		.driver_data = &quirk_spurious_8042,
		.matches = {
			DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"),
		}
	},
	{
		.ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10",
		.driver_data = &quirk_spurious_8042,
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ static const struct dmi_system_id lis3lv02d_devices[] __initconst = {
	DELL_LIS3LV02D_DMI_ENTRY("Latitude 5500",      0x29),
	DELL_LIS3LV02D_DMI_ENTRY("Latitude E6330",     0x29),
	DELL_LIS3LV02D_DMI_ENTRY("Latitude E6430",     0x29),
	DELL_LIS3LV02D_DMI_ENTRY("Latitude E6530",     0x29),
	DELL_LIS3LV02D_DMI_ENTRY("Precision 3540",     0x29),
	DELL_LIS3LV02D_DMI_ENTRY("Precision 3551",     0x29),
	DELL_LIS3LV02D_DMI_ENTRY("Precision M6800",    0x29),
+9 −0
Original line number Diff line number Diff line
@@ -228,6 +228,8 @@ static int thermal_platform_profile_get(struct device *dev,

static int thermal_platform_profile_probe(void *drvdata, unsigned long *choices)
{
	int current_mode;

	if (supported_modes & DELL_QUIET)
		__set_bit(PLATFORM_PROFILE_QUIET, choices);
	if (supported_modes & DELL_COOL_BOTTOM)
@@ -237,6 +239,13 @@ static int thermal_platform_profile_probe(void *drvdata, unsigned long *choices)
	if (supported_modes & DELL_PERFORMANCE)
		__set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);

	/* Make sure that ACPI is in sync with the profile set by USTT */
	current_mode = thermal_get_mode();
	if (current_mode < 0)
		return current_mode;

	thermal_set_mode(current_mode);

	return 0;
}

+14 −20
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/acpi.h>
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/device.h>
#include <linux/dev_printk.h>
@@ -75,6 +76,9 @@ MODULE_PARM_DESC(fw_debug, "Enable printing of firmware debug messages");
#define WMBB_USB_CHARGE 0x10B
#define WMBB_BATT_LIMIT 0x10C

#define FAN_MODE_LOWER GENMASK(1, 0)
#define FAN_MODE_UPPER GENMASK(5, 4)

#define PLATFORM_NAME   "lg-laptop"

MODULE_ALIAS("wmi:" WMI_EVENT_GUID0);
@@ -274,29 +278,19 @@ static ssize_t fan_mode_store(struct device *dev,
			      struct device_attribute *attr,
			      const char *buffer, size_t count)
{
	bool value;
	unsigned long value;
	union acpi_object *r;
	u32 m;
	int ret;

	ret = kstrtobool(buffer, &value);
	ret = kstrtoul(buffer, 10, &value);
	if (ret)
		return ret;
	if (value >= 3)
		return -EINVAL;

	r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0);
	if (!r)
		return -EIO;

	if (r->type != ACPI_TYPE_INTEGER) {
		kfree(r);
		return -EIO;
	}

	m = r->integer.value;
	kfree(r);
	r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
	kfree(r);
	r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
	r = lg_wmab(dev, WM_FAN_MODE, WM_SET,
		FIELD_PREP(FAN_MODE_LOWER, value) |
		FIELD_PREP(FAN_MODE_UPPER, value));
	kfree(r);

	return count;
@@ -305,7 +299,7 @@ static ssize_t fan_mode_store(struct device *dev,
static ssize_t fan_mode_show(struct device *dev,
			     struct device_attribute *attr, char *buffer)
{
	unsigned int status;
	unsigned int mode;
	union acpi_object *r;

	r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0);
@@ -317,10 +311,10 @@ static ssize_t fan_mode_show(struct device *dev,
		return -EIO;
	}

	status = r->integer.value & 0x01;
	mode = FIELD_GET(FAN_MODE_LOWER, r->integer.value);
	kfree(r);

	return sysfs_emit(buffer, "%d\n", status);
	return sysfs_emit(buffer, "%d\n", mode);
}

static ssize_t usb_charge_store(struct device *dev,