Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull x86 platform driver fixes from Hans de Goede:
"The most important fixes here are a set of fixes for the ACPI
backlight detection refactor which landed in 6.1.

These fix regressions reported on some laptop models by making
acpi_video_backlight_use_native() always return true for now, which in
essence undoes some of the changes.

I plan to take another shot at having only 1 /sys/class/backlight
class device per panel with 6.2, with modified detection heuristics to
avoid the (known) regressions.

Highlights:

- ACPI: video: Fix regressions from 6.1 backlight refactor by making
acpi_video_backlight_use_native() always return true for now

- Misc other bugfixes and HW id additions"

* tag 'platform-drivers-x86-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86: p2sb: Don't fail if unknown CPU is found
platform/x86/intel/hid: Add some ACPI device IDs
platform/x86/intel/pmt: Sapphire Rapids PMT errata fix
platform/x86: hp_wmi: Fix rfkill causing soft blocked wifi
platform/x86: touchscreen_dmi: Add info for the RCA Cambio W101 v2 2-in-1
platform/x86: ideapad-laptop: Disable touchpad_switch
ACPI: video: Add backlight=native DMI quirk for Dell G15 5515
ACPI: video: Make acpi_video_backlight_use_native() always return true
ACPI: video: Improve Chromebook checks

+130 -22
+32 -9
drivers/acpi/video_detect.c
··· 646 646 }, 647 647 648 648 /* 649 + * Models which have nvidia-ec-wmi support, but should not use it. 650 + * Note this indicates a likely firmware bug on these models and should 651 + * be revisited if/when Linux gets support for dynamic mux mode. 652 + */ 653 + { 654 + .callback = video_detect_force_native, 655 + /* Dell G15 5515 */ 656 + .matches = { 657 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 658 + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"), 659 + }, 660 + }, 661 + 662 + /* 649 663 * Desktops which falsely report a backlight and which our heuristics 650 664 * for this do not catch. 651 665 */ ··· 684 670 685 671 static bool google_cros_ec_present(void) 686 672 { 687 - return acpi_dev_found("GOOG0004"); 673 + return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C"); 688 674 } 689 675 690 676 /* ··· 732 718 if (apple_gmux_present()) 733 719 return acpi_backlight_apple_gmux; 734 720 721 + /* Chromebooks should always prefer native backlight control. */ 722 + if (google_cros_ec_present() && native_available) 723 + return acpi_backlight_native; 724 + 735 725 /* On systems with ACPI video use either native or ACPI video. */ 736 726 if (video_caps & ACPI_VIDEO_BACKLIGHT) { 737 727 /* ··· 753 735 return acpi_backlight_video; 754 736 } 755 737 756 - /* 757 - * Chromebooks that don't have backlight handle in ACPI table 758 - * are supposed to use native backlight if it's available. 759 - */ 760 - if (google_cros_ec_present() && native_available) 761 - return acpi_backlight_native; 762 - 763 738 /* No ACPI video (old hw), use vendor specific fw methods. */ 764 739 return acpi_backlight_vendor; 765 740 } ··· 765 754 766 755 bool acpi_video_backlight_use_native(void) 767 756 { 768 - return __acpi_video_get_backlight_type(true) == acpi_backlight_native; 757 + /* 758 + * Call __acpi_video_get_backlight_type() to let it know that 759 + * a native backlight is available. 760 + */ 761 + __acpi_video_get_backlight_type(true); 762 + 763 + /* 764 + * For now just always return true. There is a whole bunch of laptop 765 + * models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing 766 + * __acpi_video_get_backlight_type() to return vendor, while these 767 + * models only have a native backlight control. 768 + */ 769 + return true; 769 770 } 770 771 EXPORT_SYMBOL(acpi_video_backlight_use_native);
+10 -2
drivers/platform/x86/hp-wmi.c
··· 1300 1300 wwan_rfkill = NULL; 1301 1301 rfkill2_count = 0; 1302 1302 1303 - if (hp_wmi_rfkill_setup(device)) 1304 - hp_wmi_rfkill2_setup(device); 1303 + /* 1304 + * In pre-2009 BIOS, command 1Bh return 0x4 to indicate that 1305 + * BIOS no longer controls the power for the wireless 1306 + * devices. All features supported by this command will no 1307 + * longer be supported. 1308 + */ 1309 + if (!hp_wmi_bios_2009_later()) { 1310 + if (hp_wmi_rfkill_setup(device)) 1311 + hp_wmi_rfkill2_setup(device); 1312 + } 1305 1313 1306 1314 err = hp_wmi_hwmon_init(); 1307 1315
+24 -1
drivers/platform/x86/ideapad-laptop.c
··· 1533 1533 {} 1534 1534 }; 1535 1535 1536 + static const struct dmi_system_id no_touchpad_switch_list[] = { 1537 + { 1538 + .ident = "Lenovo Yoga 3 Pro 1370", 1539 + .matches = { 1540 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1541 + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"), 1542 + }, 1543 + }, 1544 + { 1545 + .ident = "ZhaoYang K4e-IML", 1546 + .matches = { 1547 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1548 + DMI_MATCH(DMI_PRODUCT_VERSION, "ZhaoYang K4e-IML"), 1549 + }, 1550 + }, 1551 + {} 1552 + }; 1553 + 1536 1554 static void ideapad_check_features(struct ideapad_private *priv) 1537 1555 { 1538 1556 acpi_handle handle = priv->adev->handle; ··· 1559 1541 priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list); 1560 1542 1561 1543 /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */ 1562 - priv->features.touchpad_ctrl_via_ec = !acpi_dev_present("ELAN0634", NULL, -1); 1544 + if (acpi_dev_present("ELAN0634", NULL, -1)) 1545 + priv->features.touchpad_ctrl_via_ec = 0; 1546 + else if (dmi_check_system(no_touchpad_switch_list)) 1547 + priv->features.touchpad_ctrl_via_ec = 0; 1548 + else 1549 + priv->features.touchpad_ctrl_via_ec = 1; 1563 1550 1564 1551 if (!read_ec_data(handle, VPCCMD_R_FAN, &val)) 1565 1552 priv->features.fan_mode = true;
+3
drivers/platform/x86/intel/hid.c
··· 27 27 {"INTC1051", 0}, 28 28 {"INTC1054", 0}, 29 29 {"INTC1070", 0}, 30 + {"INTC1076", 0}, 31 + {"INTC1077", 0}, 32 + {"INTC1078", 0}, 30 33 {"", 0}, 31 34 }; 32 35 MODULE_DEVICE_TABLE(acpi, intel_hid_ids);
+30 -1
drivers/platform/x86/intel/pmt/class.c
··· 9 9 */ 10 10 11 11 #include <linux/kernel.h> 12 + #include <linux/io-64-nonatomic-lo-hi.h> 12 13 #include <linux/module.h> 13 14 #include <linux/mm.h> 14 15 #include <linux/pci.h> ··· 20 19 #define PMT_XA_START 0 21 20 #define PMT_XA_MAX INT_MAX 22 21 #define PMT_XA_LIMIT XA_LIMIT(PMT_XA_START, PMT_XA_MAX) 22 + #define GUID_SPR_PUNIT 0x9956f43f 23 23 24 24 bool intel_pmt_is_early_client_hw(struct device *dev) 25 25 { ··· 34 32 return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW); 35 33 } 36 34 EXPORT_SYMBOL_GPL(intel_pmt_is_early_client_hw); 35 + 36 + static inline int 37 + pmt_memcpy64_fromio(void *to, const u64 __iomem *from, size_t count) 38 + { 39 + int i, remain; 40 + u64 *buf = to; 41 + 42 + if (!IS_ALIGNED((unsigned long)from, 8)) 43 + return -EFAULT; 44 + 45 + for (i = 0; i < count/8; i++) 46 + buf[i] = readq(&from[i]); 47 + 48 + /* Copy any remaining bytes */ 49 + remain = count % 8; 50 + if (remain) { 51 + u64 tmp = readq(&from[i]); 52 + 53 + memcpy(&buf[i], &tmp, remain); 54 + } 55 + 56 + return count; 57 + } 37 58 38 59 /* 39 60 * sysfs ··· 79 54 if (count > entry->size - off) 80 55 count = entry->size - off; 81 56 82 - memcpy_fromio(buf, entry->base + off, count); 57 + if (entry->guid == GUID_SPR_PUNIT) 58 + /* PUNIT on SPR only supports aligned 64-bit read */ 59 + count = pmt_memcpy64_fromio(buf, entry->base + off, count); 60 + else 61 + memcpy_fromio(buf, entry->base + off, count); 83 62 84 63 return count; 85 64 }
+6 -9
drivers/platform/x86/p2sb.c
··· 19 19 #define P2SBC 0xe0 20 20 #define P2SBC_HIDE BIT(8) 21 21 22 + #define P2SB_DEVFN_DEFAULT PCI_DEVFN(31, 1) 23 + 22 24 static const struct x86_cpu_id p2sb_cpu_ids[] = { 23 25 X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, PCI_DEVFN(13, 0)), 24 - X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_D, PCI_DEVFN(31, 1)), 25 - X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_D, PCI_DEVFN(31, 1)), 26 - X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE, PCI_DEVFN(31, 1)), 27 - X86_MATCH_INTEL_FAM6_MODEL(KABYLAKE_L, PCI_DEVFN(31, 1)), 28 - X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE, PCI_DEVFN(31, 1)), 29 - X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, PCI_DEVFN(31, 1)), 30 26 {} 31 27 }; 32 28 33 29 static int p2sb_get_devfn(unsigned int *devfn) 34 30 { 31 + unsigned int fn = P2SB_DEVFN_DEFAULT; 35 32 const struct x86_cpu_id *id; 36 33 37 34 id = x86_match_cpu(p2sb_cpu_ids); 38 - if (!id) 39 - return -ENODEV; 35 + if (id) 36 + fn = (unsigned int)id->driver_data; 40 37 41 - *devfn = (unsigned int)id->driver_data; 38 + *devfn = fn; 42 39 return 0; 43 40 } 44 41
+25
drivers/platform/x86/touchscreen_dmi.c
··· 770 770 .properties = predia_basic_props, 771 771 }; 772 772 773 + static const struct property_entry rca_cambio_w101_v2_props[] = { 774 + PROPERTY_ENTRY_U32("touchscreen-min-x", 4), 775 + PROPERTY_ENTRY_U32("touchscreen-min-y", 20), 776 + PROPERTY_ENTRY_U32("touchscreen-size-x", 1644), 777 + PROPERTY_ENTRY_U32("touchscreen-size-y", 874), 778 + PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"), 779 + PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-rca-cambio-w101-v2.fw"), 780 + PROPERTY_ENTRY_U32("silead,max-fingers", 10), 781 + { } 782 + }; 783 + 784 + static const struct ts_dmi_data rca_cambio_w101_v2_data = { 785 + .acpi_name = "MSSL1680:00", 786 + .properties = rca_cambio_w101_v2_props, 787 + }; 788 + 773 789 static const struct property_entry rwc_nanote_p8_props[] = { 774 790 PROPERTY_ENTRY_U32("touchscreen-min-y", 46), 775 791 PROPERTY_ENTRY_U32("touchscreen-size-x", 1728), ··· 1423 1407 /* Note 105b is Foxcon's USB/PCI vendor id */ 1424 1408 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"), 1425 1409 DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"), 1410 + }, 1411 + }, 1412 + { 1413 + /* RCA Cambio W101 v2 */ 1414 + /* https://github.com/onitake/gsl-firmware/discussions/193 */ 1415 + .driver_data = (void *)&rca_cambio_w101_v2_data, 1416 + .matches = { 1417 + DMI_MATCH(DMI_SYS_VENDOR, "RCA"), 1418 + DMI_MATCH(DMI_PRODUCT_NAME, "W101SA23T1"), 1426 1419 }, 1427 1420 }, 1428 1421 {