aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform
AgeCommit message (Collapse)AuthorFilesLines
2022-11-21platform/x86/intel/hid: Add module-params for 5 button array + ↵Hans de Goede1-5/+31
SW_TABLET_MODE reporting The driver has DMI-quirk tables for force-enabling 5 button array support and for 2 different ways of enabling SW_TABLET_MODE reporting. Add module parameters to allow user to enable the driver behavior currently only available through DMI quirks. This is useful for users to test this in bug-reports and for users to use as a workaround while new DMI quirks find their way upstream. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/822 Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86: ideapad-laptop: Make touchpad_ctrl_via_ec a module optionHans de Goede1-26/+7
Remove the ACPI-HID + DMI-id deny-lists for touchpad_ctrl_via_ec and instead make it a module option which defaults to false. The touchpad sysfs attribute allowing directly writing VPCCMD_W_TOUCHPAD from userspace has been leading to a lot of bug-reports / patches adding both ACPI HID + dmi-id based deny-lists for it which then need to be expanded all the time going forward leading to a high maintenance load. At the same time the touchpad sysfs attribute is not a standard Linux userspace API. So it is not used in standard desktop-enviroments, instead it is only used in the following 2 rare circumstances: 1. Ideapad specific control-panel like applets 2. Custom scripts written by users For 1. these applets need to already deal with the touchpad sysfs attr sometimes not being there because of the existing deny lists so hiding it be default should not cause an issue; and most desktop environments already have a touchpad-disable option in their native control-panel, so having an ideapad specific toggle for this is not necessary. For 2. since these users are already customizing their systems they can add the module option if they want to keep using the touchpad sysfs attribute. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Tested-by: Jiaxun Yang <[email protected]> Tested-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86: ideapad-laptop: Stop writing VPCCMD_W_TOUCHPAD at probe timeHans de Goede1-4/+0
Commit d69cd7eea93e ("platform/x86: ideapad-laptop: Disable touchpad_switch for ELAN0634") from Janary 2021 added a flag hiding the touchpad sysfs-attr and disabling ideapad_sync_touchpad_state() because some devices "do not use EC to switch touchpad". At the same time this added a write(VPCCMD_W_TOUCHPAD, 1) call at probe time on these same devices. This seems to be copied from the rfkill code which does something similar when hw rfkill support is disabled. But for the rfkill code this is known to be necessary on some models, where as for the touchpad control no motivation is given for doing this and prior to this patch there were no reports of needing to do this. So this seems unnecessary; and it is best to avoid poking the hardware unnecessary to avoid unwanted side effects, so remove this. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Tested-by: Jiaxun Yang <[email protected]> Tested-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86: ideapad-laptop: Send KEY_TOUCHPAD_TOGGLE on some modelsHans de Goede1-5/+19
On recent Ideapad models the EC does not control the touchpad at all, so instead of sending KEY_TOUCHPAD_ON/ _OFF on touchpad toggle hotkey events, ideapad-laptop should send KEY_TOUCHPAD_TOGGLE and let userspace handle the toggling. Check for this by checking if the value read from VPCCMD_R_TOUCHPAD actually changes when receiving a touchpad-toggle hotkey event; and if it does not change send KEY_TOUCHPAD_TOGGLE to userspace to let userspace enable/disable the touchpad in software. Note this also drops the priv->features.touchpad_ctrl_via_ec check from ideapad_sync_touchpad_state() so that KEY_TOUCHPAD_TOGGLE will be send on laptops where this is not set too. This can be safely dropped now because the i8042_command(I8042_CMD_AUX_ENABLE/_DISABLE) call is now guarded by its own feature flag. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Tested-by: Jiaxun Yang <[email protected]> Tested-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86: ideapad-laptop: Only toggle ps2 aux port on/off on select modelsHans de Goede1-1/+28
Recently there have been multiple patches to disable the ideapad-laptop's touchpad control code, because it is causing issues on various laptops: Commit d69cd7eea93e ("platform/x86: ideapad-laptop: Disable touchpad_switch for ELAN0634") Commit a231224a601c ("platform/x86: ideapad-laptop: Disable touchpad_switch") The turning on/off of the ps2 aux port was added specifically for the IdeaPad Z570, where the EC does toggle the touchpad on/off LED and toggles the value returned by reading VPCCMD_R_TOUCHPAD, but it does not actually turn on/off the touchpad. The ideapad-laptop code really should not be messing with the i8042 controller on all devices just for this special case. Add a new ctrl_ps2_aux_port flag set based on a DMI based allow-list for devices which need this workaround, populating it with just the Ideapad Z570 for now. This also adds a module parameter so that this behavior can easily be enabled on other models which may need it. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Tested-by: Jiaxun Yang <[email protected]> Tested-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86: ideapad-laptop: Do not send KEY_TOUCHPAD* events on probe / resumeHans de Goede1-6/+9
The sending of KEY_TOUCHPAD* events is causing spurious touchpad OSD showing on resume. Disable the sending of events on probe / resume to fix this. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Tested-by: Jiaxun Yang <[email protected]> Tested-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86: ideapad-laptop: Refactor ideapad_sync_touchpad_state()Hans de Goede1-12/+15
Add an error exit for read_ec_data() failing instead of putting the main body in an if (success) block. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Tested-by: Jiaxun Yang <[email protected]> Tested-by: Maxim Mikityanskiy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-21platform/x86/intel/sdsi: Add meter certificate supportDavid E. Box1-11/+38
Add support for reading the meter certificate from Intel On Demand hardware. The meter certificate [1] is used to access the utilization metrics of enabled features in support of the Intel On Demand consumption model. Similar to the state certificate, the meter certificate is read by mailbox command. While making similar changes also use the BIN_ATTR_ADMIN_RO helper to create the 'registers' sysfs file. Link: https://github.com/intel-sandbox/debox1.intel_sdsi/blob/gnr-review/meter-certificate.rst [1] Signed-off-by: David E. Box <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86/intel/sdsi: Support different GUIDsDavid E. Box1-3/+47
Newer versions of Intel On Demand hardware may have an expanded list of registers to support new features. The register layout is identified by a unique GUID that's read during driver probe. Add support for handling different GUIDs and add support for current GUIDs [1]. Link: https://github.com/intel/intel-sdsi/blob/master/os-interface.rst [1] Signed-off-by: David E. Box <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86/intel/sdsi: Hide attributes if hardware doesn't supportDavid E. Box1-11/+22
Provisioning capabilities are enabled by a bit set by BIOS. Read this bit and hide the provisioning attributes if the On Demand feature is not enabled. Also, remove the sdsi_enabled boolean from private and instead add a features register since this will be used for future features. Signed-off-by: David E. Box <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86/intel/sdsi: Add Intel On Demand textDavid E. Box2-6/+6
Intel Software Defined Silicon (SDSi) is now officially known as Intel On Demand. Add On Demand to the description in the kconfig, documentation, and driver source. Signed-off-by: David E. Box <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc/core: Add Meteor Lake support to pmc core driverGayatri Kammela4-2/+72
Add Meteor Lake client and mobile support to pmc core driver. This patch adds legacy support. Cc: David E Box <[email protected]> Suggested-by: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Sukumar Ghorai <[email protected]> Signed-off-by: Gayatri Kammela <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Relocate Alder Lake PCH supportGayatri Kammela4-316/+345
Create adl.c for Alder Lake PCH specific structures and init(). This file supports Alder Lake, Raptor Lake and Raptor Lake S platforms There are no functional changes involved. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Gayatri Kammela <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Relocate Tiger Lake PCH supportGayatri Kammela4-264/+285
Create tgl.c for Tiger Lake PCH specific structures and init(). This file supports Tiger Lake, Elkhart Lake, Rocket Lake, Alder Lake mobile, Alder Lake N and Raptor Lake P platforms. There are no functional changes involved. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Gayatri Kammela <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Relocate Ice Lake PCH supportXi Pardee4-46/+60
Create icl.c for Ice Lake PCH specific structures and init(). This file supports Ice Lake, Ice Lake NNPI and Jasper Lake platforms. There are no functional changes involved. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Xi Pardee <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Relocate Cannon Lake Point PCH supportXi Pardee4-200/+219
Create cnp.c for Cannon Lake Point PCH specific structures and init(). This file supports Cannon Lake and Comet Lake platforms. There are no functional changes involved. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Xi Pardee <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Relocate Sunrise Point PCH supportRajvi Jingar4-130/+148
Create spt.c for Sunrise Point PCH specific structures and init(). This file supports Sky Lake and Kaby Lake platforms. There are no functional changes involved. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Rajvi Jingar <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Move variable declarations and definitions to ↵Xi Pardee2-12/+16
header and core.c Move the msr_map variable declaration to core.h and move the pmc_lpm_modes definition to core.c. This is a prepartory patch for redesigning the pmc core driver as the variables will be used in multiple PCH specific files. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Xi Pardee <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-21platform/x86: intel/pmc: Replace all the reg_map with init functionsGayatri Kammela2-37/+90
The current implementation of pmc core driver has the reg_map assigned to the CPUID of each platform. Replace the reg_map with init functions that are defined for each platform. This is a preparatory patch for redesigning the pmc core driver. Cc: David E Box <[email protected]> Reviewed-by: "David E. Box" <[email protected]> Signed-off-by: Gayatri Kammela <[email protected]> Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-19Revert "platform/x86/intel/ifs: Mark as BROKEN"Jithu Joseph1-3/+0
Issues with user interface [1] to load scan test images have been addressed so remove the dependency on BROKEN. Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ [1] Link: https://lore.kernel.org/r/[email protected]
2022-11-19platform/x86/intel/ifs: Add current_batch sysfs entryJithu Joseph5-16/+74
Initial implementation assumed a single IFS test image file with a fixed name ff-mm-ss.scan. (where ff, mm, ss refers to family, model and stepping of the core). Subsequently, it became evident that supporting more than one test image file is needed to provide more comprehensive test coverage. (Test coverage in this scenario refers to testing more transistors in the core to identify faults). The other alternative of increasing the size of a single scan test image file would not work as the upper bound is limited by the size of memory area reserved by BIOS for loading IFS test image. Introduce "current_batch" file which accepts a number. Writing a number to the current_batch file would load the test image file by name ff-mm-ss-<xy>.scan, where <xy> is the number written to the "current_batch" file in hex. Range check of the input is done to verify it not greater than 0xff. For e.g if the scan test image comprises of 6 files, they would be named: 06-8f-06-01.scan 06-8f-06-02.scan 06-8f-06-03.scan 06-8f-06-04.scan 06-8f-06-05.scan 06-8f-06-06.scan And writing 3 to current_batch would result in loading 06-8f-06-03.scan above. The file can also be read to know the currently loaded file. And testing a system looks like: for each scan file do load the IFS test image file (write to the batch file) for each core do test the core with this set of tests done done Qualify few error messages with the test image file suffix to provide better context. [ bp: Massage commit message. Add link to the discussion. ] Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-19platform/x86/intel/ifs: Remove reload sysfs entryJithu Joseph1-29/+0
Reload sysfs entry will be replaced by current_batch, drop it. Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-19platform/x86/intel/ifs: Add metadata validationJithu Joseph2-1/+59
The data portion of a IFS test image file contains a metadata region containing possibly multiple metadata structures in addition to test data and hashes. IFS Metadata layout +----------------------+ 0 |META_TYPE_IFS (=1) | +----------------------+ |meta_size | +----------------------+ |test type | +----------------------+ |fusa info | +----------------------+ |total images | +----------------------+ |current image# | +----------------------+ |total chunks | +----------------------+ |starting chunk | +----------------------+ |size per chunk | +----------------------+ |chunks per stride | +----------------------+ |Reserved[54] | +----------------------+ 256 | | | Test Data/Chunks | | | +----------------------+ meta_size | META_TYPE_END (=0) | +----------------------+ meta_size + 4 | size of end (=8) | +----------------------+ meta_size + 8 Introduce the layout of this meta_data structure and validate the sanity of certain fields of the new image before loading. Tweak references to IFS test image chunks to reflect the updated layout of the test image. [ bp: Massage commit message. ] Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-19platform/x86/intel/ifs: Use generic microcode headers and functionsJithu Joseph1-84/+20
Existing implementation (broken) of IFS used a header format (for IFS test images) which was very similar to microcode format, but didn’t accommodate extended signatures. This meant same IFS test image had to be duplicated for different steppings and the validation code in the driver was only looking at the primary header parameters. Going forward, IFS test image headers have been tweaked to become fully compatible with the microcode format. Newer IFS test image headers will use header version 2 in order to distinguish it from microcode images and older IFS test images. In light of the above, reuse struct microcode_header_intel directly in the IFS driver and reuse microcode functions for validation and sanity checking. [ bp: Massage commit message. ] Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-19platform/x86/intel/ifs: Add metadata supportAshok Raj1-0/+32
One of the existing reserved fields in the microcode header has been allocated to indicate the size of metadata structures. The location of metadata section within microcode header is as shown below: Microcode Blob Format +----------------------+ Base |Header Version | +----------------------+ |Update revision | +----------------------+ |Date DDMMYYYY | +----------------------+ |Sig | +----------------------+ |Checksum | +----------------------+ |Loader Version | +----------------------+ |Processor Flags | +----------------------+ |Data Size | +----------------------+ |Total Size | +----------------------+ |Meta Size | +----------------------+ |Reserved | +----------------------+ |Reserved | +----------------------+ Base+48 | | | Microcode | | Data | | | +----------------------+ Base+48+data_size- | | meta_size | Meta Data | | structure(s) | | | +----------------------+ Base+48+data_size | | | Extended Signature | | Table | | | +----------------------+ Base+total_size Add an accessor function which will return a pointer to the start of a specific meta_type being queried. [ bp: Massage commit message. ] Signed-off-by: Ashok Raj <[email protected]> Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-19platform/chrome: cros_ec: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-18platform/x86/intel/ifs: Remove memory allocation from load pathJithu Joseph3-14/+22
IFS requires tests to be authenticated once for each CPU socket on a system. scan_chunks_sanity_check() was dynamically allocating memory to store the state of whether tests have been authenticated on each socket for every load operation. Move the memory allocation to init path and store the pointer in ifs_data struct. Also rearrange the adjacent error checking in init for a more simplified and natural flow. Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-18platform/x86/intel/ifs: Remove image loading during initJithu Joseph3-8/+2
IFS test image is unnecessarily loaded during driver initialization. Drop image loading during ifs_init() and improve module load time. With this change, user has to load one when starting the tests. As a consequence, make ifs_sem static as it is only used within sysfs.c Suggested-by: Hans de Goede <[email protected]> Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-18platform/x86/intel/ifs: Return a more appropriate error codeJithu Joseph1-1/+3
scan_chunks_sanity_check() returns -ENOMEM if it encounters an error while copying IFS test image from memory to Secure Memory. Return -EIO in this scenario, as it is more appropriate. Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-18platform/x86/intel/ifs: Remove unused selectionJithu Joseph1-1/+0
CONFIG_INTEL_IFS_DEVICE is not used anywhere. The selection in Kconfig is therefore pointless. Delete it. Signed-off-by: Jithu Joseph <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Sohil Mehta <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-11-17platform/x86/amd: pmc: Add a workaround for an s0i3 issue on CezanneMario Limonciello1-0/+6
Cezanne platforms under the right circumstances have a synchronization problem where attempting to enter s2idle may fail if the x86 cores are put into HLT before hardware resume from the previous attempt has completed. To avoid this issue add a 10-20ms delay before entering s2idle another time. This workaround will only be applied on interrupts that wake the hardware but don't break the s2idle loop. Cc: [email protected] # 6.1 Cc: "Mahapatra, Rajib" <[email protected]> Cc: "Raul Rangel" <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16Merge tag 'platform-drivers-x86-v6.1-4' of ↵Linus Torvalds9-8/+124
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: - Surface Pro 9 and Surface Laptop 5 kbd, battery, etc support (this is just a few hw-id additions) - A couple of other hw-id / DMI-quirk additions - A few small bug fixes + 1 build fix * tag 'platform-drivers-x86-v6.1-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tables platform/x86: ideapad-laptop: Fix interrupt storm on fn-lock toggle on some Yoga laptops platform/x86: hp-wmi: Ignore Smart Experience App event platform/surface: aggregator_registry: Add support for Surface Laptop 5 platform/surface: aggregator_registry: Add support for Surface Pro 9 platform/surface: aggregator: Do not check for repeated unsequenced packets platform/x86: acer-wmi: Enable SW_TABLET_MODE on Switch V 10 (SW5-017) platform/x86: asus-wmi: add missing pci_dev_put() in asus_wmi_set_xusb2pr() platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized platform/x86: thinkpad_acpi: Enable s2idle quirk for 21A1 machine type platform/x86/amd: pmc: Add new ACPI ID AMDI0009 platform/x86/amd: pmc: Remove more CONFIG_DEBUG_FS checks
2022-11-16platform/x86: ideapad-laptop: support for more special keys in WMIPhilipp Jungkamp1-59/+202
The event data of the WMI event 0xD0, which is assumed to be the fn_lock, is used to indicate several special keys on newer Yoga 7/9 laptops. The notify_id 0xD0 is non-unique in the DSDT of the Yoga 9 14IAP7, this causes wmi_get_event_data() to report wrong values. Port the ideapad-laptop WMI code to the wmi bus infrastructure which does not suffer from the shortcomings of wmi_get_event_data(). Signed-off-by: Philipp Jungkamp <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: ideapad-laptop: Add new _CFG bit numbers for future useEray Orçunus1-4/+29
Later IdeaPads report various things in last 8 bits of _CFG, at least 5 of them represent supported on-screen-displays. Add those bit numbers to the enum, and use CFG_OSD_ as prefix of their names. Also expose the values of these bits to debugfs, since they can be useful. Signed-off-by: Eray Orçunus <[email protected]> Acked-by: Ike Panhc <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: ideapad-laptop: Revert "check for touchpad support in _CFG"Eray Orçunus1-9/+5
Last 8 bit of _CFG started being used in later IdeaPads, thus 30th bit doesn't always show whether device supports touchpad or touchpad switch. Remove checking bit 30 of _CFG, so older IdeaPads like S10-3 can switch touchpad again via touchpad attribute. This reverts commit b3ed1b7fe378 ("platform/x86: ideapad-laptop: check for touchpad support in _CFG"). Signed-off-by: Eray Orçunus <[email protected]> Acked-by: Ike Panhc <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: dell-ddv: Warn if ePPID has a suspicious lengthArmin Wolf1-0/+9
On some systems (like the Dell Inspiron 3505), the acpi operation region holding the ePPID string is two bytes too short, causing acpi functions like ToString() to omit the last two bytes. This does not happen on Windows, supposedly due to their implementation of ToString() ignoring buffer boundaries. Inform users if the ePPID length differs from the Dell specification so they can complain to Dell to fix their BIOS. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: dell-ddv: Improve buffer handlingArmin Wolf1-5/+7
When the DDV interface returns a buffer, it actually returns a acpi buffer containing an integer (buffer size) and another acpi buffer (buffer content). The size of the buffer may be smaller than the size of the buffer content, which is perfectly valid and should not be treated as an error. Also use the buffer size instead of the buffer content size when accessing the buffer to prevent accessing bogus data. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: ISST: Fix typo in commentschen zhang1-1/+1
Fix spelling typo in comments. Reported-by: k2ci <[email protected]> Signed-off-by: chen zhang <[email protected]> Acked-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: thinkpad_acpi: use strstarts()Barnabás Pőcze1-31/+27
There is a function, `strstarts()`, in linux/string.h to check if a string is prefix of another. So remove the custom version from the driver. Signed-off-by: Barnabás Pőcze <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: Move existing HP drivers to a new hp subdirJorge Lopez7-46/+76
The purpose of this patch is to provide a central location where all HP related drivers are found. HP drivers will recide under drivers/platform/x86/hp directory. Introduce changes to Kconfig file to list all HP driver under "HP X86 Platform Specific Device Drivers" menu option. Additional changes include update MAINTAINERS file to indicate hp related drivers new path. Signed-off-by: Jorge Lopez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86/intel: pmc: Fix repeated word in commentJilin Yuan1-1/+1
Delete the redundant word 'to'. Signed-off-by: Jilin Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/mellanox: Add BlueField-3 support in the tmfifo driverLiming Sun2-22/+74
BlueField-3 uses the same control registers in tmfifo access but at different addresses. This commit replaces the offset reference with pointers, and set up these pointers in the probe functions accordingly. Signed-off-by: Liming Sun <[email protected]> Reviewed-by: David Thompson <[email protected]> Reviewed-by: Vadim Pasternak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: thinkpad_acpi: Fix max_brightness of thinklightHans de Goede1-0/+1
Thinklight has only two values, on/off so it's reasonable for max_brightness to be 0 and 1 as if you write anything between 0 and 255 it will be 255 anyway so there's no point for it to be 255. This may look like it is a userspace API change, but writes with a value larget then the new max_brightness will still be accepted, these will be silently clamped to the new max_brightness by led_set_brightness_nosleep(). So no userspace API problems are expected. Reported-by: Michał Szczepaniak <[email protected]> Link: https://lore.kernel.org/platform-driver-x86/[email protected]/ Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: huawei-wmi: remove unnecessary memberBarnabás Pőcze1-17/+12
The `huawei_wmi::idev` array is not actually used by the driver, so remove it. The piece of code that - I believe - was supposed to fill the array is flawed, it did not actually set any of the values inside the array. This was most likely masked by the fact that the input devices are devm managed and that the only function that needs a reference to the input devices is `huawei_wmi_input_notify()`, however, that does not access the appropriate input device via the `huawei_wmi` object. Signed-off-by: Barnabás Pőcze <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: huawei-wmi: fix return value calculationBarnabás Pőcze1-4/+16
Previously, `huawei_wmi_input_setup()` returned the result of logical or-ing the return values of two functions that return negative errno-style error codes and one that returns `acpi_status`. If this returned value was non-zero, then it was propagated from the platform driver's probe function. That function should return a negative errno-style error code, so the result of the logical or that `huawei_wmi_input_setup()` returned was not appropriate. Fix that by checking each function separately and returning the error code unmodified. Fixes: 1ac9abeb2e5b ("platform/x86: huawei-wmi: Move to platform driver") Signed-off-by: Barnabás Pőcze <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: huawei-wmi: do not hard-code sizesBarnabás Pőcze1-2/+2
Use `sizeof()` and `ARRAY_SIZE()` instead of hard-coding buffer sizes and indices. Signed-off-by: Barnabás Pőcze <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: dell: Add new dell-wmi-ddv driverArmin Wolf4-0/+379
The dell-wmi-ddv driver adds support for reading the current temperature and ePPID of ACPI batteries on supported Dell machines. Since the WMI interface used by this driver does not do any input validation and thus cannot be used for probing, the driver depends on the ACPI battery extension machanism to discover batteries. The driver also supports a debugfs interface for retrieving buffers containing fan and thermal sensor information. Since the meaing of the content of those buffers is currently unknown, the interface is meant for reverse-engineering and will likely be replaced with an hwmon interface once the meaning has been understood. The driver was tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16ACPI: battery: Pass battery hook pointer to hook callbacksArmin Wolf6-12/+12
Right now, is impossible for battery hook callbacks to access instance-specific data, forcing most drivers to provide some sort of global state. This however is difficult for drivers which can be instantiated multiple times and/or are hotplug-capable. Pass a pointer to the battery hook to those callbacks for usage with container_of(). Signed-off-by: Armin Wolf <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86/amd/pmf: pass the struct by referenceMuhammad Usama Anjum1-46/+46
The out structure should be passed by reference instead of passing by value. This saves the extra copy of the structure. Signed-off-by: Muhammad Usama Anjum <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
2022-11-16platform/x86: ideapad-laptop: Add module parameters to match DMI quirk tablesHans de Goede1-3/+19
Add module parameters to allow setting the hw_rfkill_switch and set_fn_lock_led feature flags for testing these on laptops which are not on the DMI-id based allow lists for these 2 flags. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]