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
Unified · Split
| @@ -48,8 +48,8 @@ This value is reset to 100 when the kernel boots. · 47 unmodified lines | |||
| 48 | Fan mode | 48 | Fan mode |
| 49 | -------- | 49 | -------- |
| 50 | 50 | ||
| 51 | Writing 1/0 to /sys/devices/platform/lg-laptop/fan_mode disables/enables | 51 | Writing 0/1/2 to /sys/devices/platform/lg-laptop/fan_mode sets fan mode to |
| 52 | the fan silent mode. | 52 | Optimal/Silent/Performance respectively. |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | USB charge | 55 | USB charge |
| @@ -256,6 +256,13 @@ static const struct dmi_system_id fwbug_list[] = { · 255 unmodified lines | |||
| 256 | DMI_MATCH(DMI_PRODUCT_NAME, "Lafite Pro V 14M"), | 256 | DMI_MATCH(DMI_PRODUCT_NAME, "Lafite Pro V 14M"), |
| 257 | } | 257 | } |
| 258 | }, | 258 | }, |
| 259 | { | ||
| 260 | .ident = "TUXEDO Stellaris Slim 15 AMD Gen6", | ||
| 261 | .driver_data = &quirk_spurious_8042, | ||
| 262 | .matches = { | ||
| 263 | DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"), | ||
| 264 | } | ||
| 265 | }, | ||
| 259 | { | 266 | { |
| 260 | .ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10", | 267 | .ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10", |
| 261 | .driver_data = &quirk_spurious_8042, | 268 | .driver_data = &quirk_spurious_8042, |
| @@ -48,6 +48,7 @@ static const struct dmi_system_id lis3lv02d_devices[] __initconst = { · 47 unmodified lines | |||
| 48 | DELL_LIS3LV02D_DMI_ENTRY("Latitude 5500", 0x29), | 48 | DELL_LIS3LV02D_DMI_ENTRY("Latitude 5500", 0x29), |
| 49 | DELL_LIS3LV02D_DMI_ENTRY("Latitude E6330", 0x29), | 49 | DELL_LIS3LV02D_DMI_ENTRY("Latitude E6330", 0x29), |
| 50 | DELL_LIS3LV02D_DMI_ENTRY("Latitude E6430", 0x29), | 50 | DELL_LIS3LV02D_DMI_ENTRY("Latitude E6430", 0x29), |
| 51 | DELL_LIS3LV02D_DMI_ENTRY("Latitude E6530", 0x29), | ||
| 51 | DELL_LIS3LV02D_DMI_ENTRY("Precision 3540", 0x29), | 52 | DELL_LIS3LV02D_DMI_ENTRY("Precision 3540", 0x29), |
| 52 | DELL_LIS3LV02D_DMI_ENTRY("Precision 3551", 0x29), | 53 | DELL_LIS3LV02D_DMI_ENTRY("Precision 3551", 0x29), |
| 53 | DELL_LIS3LV02D_DMI_ENTRY("Precision M6800", 0x29), | 54 | DELL_LIS3LV02D_DMI_ENTRY("Precision M6800", 0x29), |
| @@ -228,6 +228,8 @@ static int thermal_platform_profile_get(struct device *dev, · 227 unmodified lines | |||
| 228 | 228 | ||
| 229 | static int thermal_platform_profile_probe(void *drvdata, unsigned long *choices) | 229 | static int thermal_platform_profile_probe(void *drvdata, unsigned long *choices) |
| 230 | { | 230 | { |
| 231 | int current_mode; | ||
| 232 | |||
| 231 | if (supported_modes & DELL_QUIET) | 233 | if (supported_modes & DELL_QUIET) |
| 232 | __set_bit(PLATFORM_PROFILE_QUIET, choices); | 234 | __set_bit(PLATFORM_PROFILE_QUIET, choices); |
| 233 | if (supported_modes & DELL_COOL_BOTTOM) | 235 | if (supported_modes & DELL_COOL_BOTTOM) |
| @@ -237,6 +239,13 @@ static int thermal_platform_profile_probe(void *drvdata, unsigned long *choices) · 3 unmodified lines | |||
| 237 | if (supported_modes & DELL_PERFORMANCE) | 239 | if (supported_modes & DELL_PERFORMANCE) |
| 238 | __set_bit(PLATFORM_PROFILE_PERFORMANCE, choices); | 240 | __set_bit(PLATFORM_PROFILE_PERFORMANCE, choices); |
| 239 | 241 | ||
| 242 | /* Make sure that ACPI is in sync with the profile set by USTT */ | ||
| 243 | current_mode = thermal_get_mode(); | ||
| 244 | if (current_mode < 0) | ||
| 245 | return current_mode; | ||
| 246 | |||
| 247 | thermal_set_mode(current_mode); | ||
| 248 | |||
| 240 | return 0; | 249 | return 0; |
| 241 | } | 250 | } |
| 242 | 251 | ||
| @@ -8,6 +8,7 @@ · 7 unmodified lines | |||
| 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 9 | 9 | ||
| 10 | #include <linux/acpi.h> | 10 | #include <linux/acpi.h> |
| 11 | #include <linux/bitfield.h> | ||
| 11 | #include <linux/bits.h> | 12 | #include <linux/bits.h> |
| 12 | #include <linux/device.h> | 13 | #include <linux/device.h> |
| 13 | #include <linux/dev_printk.h> | 14 | #include <linux/dev_printk.h> |
| @@ -75,6 +76,9 @@ MODULE_PARM_DESC(fw_debug, "Enable printing of firmware debug messages"); · 61 unmodified lines | |||
| 75 | #define WMBB_USB_CHARGE 0x10B | 76 | #define WMBB_USB_CHARGE 0x10B |
| 76 | #define WMBB_BATT_LIMIT 0x10C | 77 | #define WMBB_BATT_LIMIT 0x10C |
| 77 | 78 | ||
| 79 | #define FAN_MODE_LOWER GENMASK(1, 0) | ||
| 80 | #define FAN_MODE_UPPER GENMASK(5, 4) | ||
| 81 | |||
| 78 | #define PLATFORM_NAME "lg-laptop" | 82 | #define PLATFORM_NAME "lg-laptop" |
| 79 | 83 | ||
| 80 | MODULE_ALIAS("wmi:" WMI_EVENT_GUID0); | 84 | MODULE_ALIAS("wmi:" WMI_EVENT_GUID0); |
| @@ -274,29 +278,19 @@ static ssize_t fan_mode_store(struct device *dev, · 193 unmodified lines | |||
| 274 | struct device_attribute *attr, | 278 | struct device_attribute *attr, |
| 275 | const char *buffer, size_t count) | 279 | const char *buffer, size_t count) |
| 276 | { | 280 | { |
| 277 | bool value; | 281 | unsigned long value; |
| 278 | union acpi_object *r; | 282 | union acpi_object *r; |
| 279 | u32 m; | ||
| 280 | int ret; | 283 | int ret; |
| 281 | 284 | ||
| 282 | ret = kstrtobool(buffer, &value); | 285 | ret = kstrtoul(buffer, 10, &value); |
| 283 | if (ret) | 286 | if (ret) |
| 284 | return ret; | 287 | return ret; |
| 288 | if (value >= 3) | ||
| 289 | return -EINVAL; | ||
| 285 | 290 | ||
| 286 | r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0); | 291 | r = lg_wmab(dev, WM_FAN_MODE, WM_SET, |
| 287 | if (!r) | 292 | FIELD_PREP(FAN_MODE_LOWER, value) | |
| 288 | return -EIO; | 293 | FIELD_PREP(FAN_MODE_UPPER, value)); |
| 289 | |||
| 290 | if (r->type != ACPI_TYPE_INTEGER) { | ||
| 291 | kfree(r); | ||
| 292 | return -EIO; | ||
| 293 | } | ||
| 294 | |||
| 295 | m = r->integer.value; | ||
| 296 | kfree(r); | ||
| 297 | r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4)); | ||
| 298 | kfree(r); | ||
| 299 | r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value); | ||
| 300 | kfree(r); | 294 | kfree(r); |
| 301 | 295 | ||
| 302 | return count; | 296 | return count; |
| @@ -305,7 +299,7 @@ static ssize_t fan_mode_store(struct device *dev, · 2 unmodified lines | |||
| 305 | static ssize_t fan_mode_show(struct device *dev, | 299 | static ssize_t fan_mode_show(struct device *dev, |
| 306 | struct device_attribute *attr, char *buffer) | 300 | struct device_attribute *attr, char *buffer) |
| 307 | { | 301 | { |
| 308 | unsigned int status; | 302 | unsigned int mode; |
| 309 | union acpi_object *r; | 303 | union acpi_object *r; |
| 310 | 304 | ||
| 311 | r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0); | 305 | r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0); |
| @@ -317,10 +311,10 @@ static ssize_t fan_mode_show(struct device *dev, · 5 unmodified lines | |||
| 317 | return -EIO; | 311 | return -EIO; |
| 318 | } | 312 | } |
| 319 | 313 | ||
| 320 | status = r->integer.value & 0x01; | 314 | mode = FIELD_GET(FAN_MODE_LOWER, r->integer.value); |
| 321 | kfree(r); | 315 | kfree(r); |
| 322 | 316 | ||
| 323 | return sysfs_emit(buffer, "%d\n", status); | 317 | return sysfs_emit(buffer, "%d\n", mode); |
| 324 | } | 318 | } |
| 325 | 319 | ||
| 326 | static ssize_t usb_charge_store(struct device *dev, | 320 | static ssize_t usb_charge_store(struct device *dev, |