summaryrefslogtreecommitdiff
path: root/drivers/platform
AgeCommit message (Collapse)Author
2025-05-08platform: mellanox: nvsw-sn2200: Add support for new system flavourVadim Pasternak
Add support for SN2201 system flavour, which is fitting OCP rack form-factor and feeded from external power source through the rack standard busbar interface. Validate system type through DMI decode. For new system flavour: - Skip internal power supply configuration. - Attach power hotswap device. Reviewed-by: Michael Shych <michaelsh@nvidia.com> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20250504165507.9003-2-vadimp@nvidia.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86: oxpec: Add a lower bounds check in oxp_psy_ext_set_prop()Dan Carpenter
The "val->intval" variable is an integer which comes from the user. This code has an upper bounds check but the lower bounds check was accidentally omitted. The write_to_ec() take a u8 value as a parameter so negative values would be truncated to positive values in the 0-255 range. Return -EINVAL if the user passes a negative value. Fixes: 202593d1e86b ("platform/x86: oxpec: Add charge threshold and behaviour to OneXPlayer") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/aBSE71VKfBlQg_fZ@stanley.mountain Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86:intel/pmc: Improve pmc_core_get_lpm_req()Xi Pardee
Minor improvements on pmc_core_get_lpm_req(). 1. Move the long comment to be above the function 2. Use %pe to print error pointer 3. Remove unneeded devm_kfree call These changes improves the code maintainability. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250425195237.493129-6-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86:intel/pmc: Move error handling to init functionXi Pardee
Move error handling code to generic_core_init() function. The previous implementation is that init function called for "full cleanup" function when error occurs which is error prone. The init function should handle the error path itself to improve code maintainability. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250425195237.493129-5-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86:intel/pmc: Use devm for mutex_initXi Pardee
Use devm_mutex_init() to avoid accidental resource leak in the future. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250425195237.493129-4-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86:intel/pmc: Create Intel PMC SSRAM Telemetry driverXi Pardee
Convert ssram device related functionalities to a new driver named Intel PMC SSRAM Telemetry driver. Modify PMC Core driver to use API exported by the driver to discover and achieve devid and PWRMBASE address information for each available PMC. PMC Core driver needs to get PCI device when reading from telemetry regions. The new SSRAM driver binds to the SSRAM device and provides the following functionalities: 1. Look for and register telemetry regions available in SSRAM device. 2. Provide devid and PWRMBASE address information for the corresponding PMCs. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250425195237.493129-3-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86:intel/vsec: Change return type of intel_vsec_registerXi Pardee
Change return type of intel_vsec_register() to int. The current implementation does not indicate if the register fail or not. Change to return error code if it fails or if INTEL_VSEC config is not set. This is a preparation step to introduce a new SSRAM Telemetry driver that will be using this API. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250425195237.493129-2-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-08platform/x86: Introduce dasharo-acpi platform driverMichał Kopeć
Introduce a driver for devices running Dasharo firmware. The driver supports thermal monitoring using a new ACPI interface in Dasharo. The initial version supports monitoring fan speeds, fan PWM duty cycles and system temperatures as well as determining which specific interfaces are implemented by firmware. It has been tested on a NovaCustom laptop running pre-release Dasharo firmware, which implements fan and thermal monitoring for the CPU and the discrete GPU, if present. Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com> Link: https://lore.kernel.org/all/20250507075214.36729-1-lukas.bulwahn@redhat.com Link: https://lore.kernel.org/r/20250425112147.69308-2-michal.kopec@3mdeb.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-07platform/x86: asus-wmi: Fix wlan_ctrl_by_user detectionHans de Goede
The wlan_ctrl_by_user detection was introduced by commit a50bd128f28c ("asus-wmi: record wlan status while controlled by userapp"). Quoting from that commit's commit message: """ When you call WMIMethod(DSTS, 0x00010011) to get WLAN status, it may return (1) 0x00050001 (On) (2) 0x00050000 (Off) (3) 0x00030001 (On) (4) 0x00030000 (Off) (5) 0x00000002 (Unknown) (1), (2) means that the model has hardware GPIO for WLAN, you can call WMIMethod(DEVS, 0x00010011, 1 or 0) to turn WLAN on/off. (3), (4) means that the model doesn’t have hardware GPIO, you need to use API or driver library to turn WLAN on/off, and call WMIMethod(DEVS, 0x00010012, 1 or 0) to set WLAN LED status. After you set WLAN LED status, you can see the WLAN status is changed with WMIMethod(DSTS, 0x00010011). Because the status is recorded lastly (ex: Windows), you can use it for synchronization. (5) means that the model doesn’t have WLAN device. WLAN is the ONLY special case with upper rule. """ The wlan_ctrl_by_user flag should be set on 0x0003000? ((3), (4) above) return values, but the flag mistakenly also gets set on laptops with 0x0005000? ((1), (2)) return values. This is causing rfkill problems on laptops where 0x0005000? is returned. Fix the check to only set the wlan_ctrl_by_user flag for 0x0003000? return values. Fixes: a50bd128f28c ("asus-wmi: record wlan status while controlled by userapp") Link: https://bugzilla.kernel.org/show_bug.cgi?id=219786 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20250501131702.103360-2-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-07platform/x86/amd/pmc: Declare quirk_spurious_8042 for MECHREVO Wujie 14XA ↵Runhua He
(GX4HRXL) MECHREVO Wujie 14XA (GX4HRXL) wakes up immediately after s2idle entry. This happens regardless of whether the laptop is plugged into AC power, or whether any peripheral is plugged into the laptop. Similar to commit a55bdad5dfd1 ("platform/x86/amd/pmc: Disable keyboard wakeup on AMD Framework 13"), the MECHREVO Wujie 14XA wakes up almost instantly after s2idle suspend entry (IRQ1 is the keyboard): 2025-04-18 17:23:57,588 DEBUG: PM: Triggering wakeup from IRQ 9 2025-04-18 17:23:57,588 DEBUG: PM: Triggering wakeup from IRQ 1 Add this model to the spurious_8042 quirk to workaround this. This patch does not affect the wake-up function of the built-in keyboard. Because the firmware of this machine adds an insurance for keyboard wake-up events, as it always triggers an additional IRQ 9 to wake up the system. Suggested-by: Mingcong Bai <jeffbai@aosc.io> Suggested-by: Xinhui Yang <cyan@cyano.uk> Suggested-by: Rong Zhang <i@rong.moe> Fixes: a55bdad5dfd1 ("platform/x86/amd/pmc: Disable keyboard wakeup on AMD Framework 13") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4166 Cc: Mario Limonciello <mario.limonciello@amd.com> Link: https://zhuanldan.zhihu.com/p/730538041 Tested-by: Yemu Lu <prcups@krgm.moe> Signed-off-by: Runhua He <hua@aosc.io> Link: https://lore.kernel.org/r/20250507100103.995395-1-hua@aosc.io Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-07platform/x86: thinkpad_acpi: Support also NEC Lavie X1475JASJohn Chau
Change get_thinkpad_model_data() to check for additional vendor name "NEC" in order to support NEC Lavie X1475JAS notebook (and perhaps more). The reason of this works with minimal changes is because NEC Lavie X1475JAS is a Thinkpad inside. ACPI dumps reveals its OEM ID to be "LENOVO", BIOS version "R2PET30W" matches typical Lenovo BIOS version, the existence of HKEY of LEN0268, with DMI fw string is "R2PHT24W". I compiled and tested with my own machine, attached the dmesg below as proof of work: [ 6.288932] thinkpad_acpi: ThinkPad ACPI Extras v0.26 [ 6.288937] thinkpad_acpi: http://ibm-acpi.sf.net/ [ 6.288938] thinkpad_acpi: ThinkPad BIOS R2PET30W (1.11 ), EC R2PHT24W [ 6.307000] thinkpad_acpi: radio switch found; radios are enabled [ 6.307030] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver [ 6.307033] thinkpad_acpi: Disabling thinkpad-acpi brightness events by default... [ 6.320322] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked [ 6.371963] thinkpad_acpi: secondary fan control detected & enabled [ 6.391922] thinkpad_acpi: battery 1 registered (start 0, stop 85, behaviours: 0x7) [ 6.398375] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input13 Signed-off-by: John Chau <johnchau@0atlas.com> Link: https://lore.kernel.org/r/20250504165513.295135-1-johnchau@0atlas.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-07platform/chrome: kunit: Avoid -Wflex-array-member-not-at-endGustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Move the conflicting declaration to the end of the structure. Notice that `struct cros_ec_command` is a flexible structure --a structure that contains a flexible-array member. Fix the following warning: drivers/platform/chrome/cros_ec_proto_test_util.h:16:32: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/aBp7mZ8kj9w4CKkl@kspp Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2025-05-06Merge tag 'v6.15-rc5' into x86/msr, to pick up fixes and to resolve conflictsIngo Molnar
Conflicts: drivers/cpufreq/intel_pstate.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-05-06Merge tag 'v6.15-rc5' into x86/cpu, to resolve conflictsIngo Molnar
Conflicts: tools/arch/x86/include/asm/cpufeatures.h Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-05-06BackMerge tag 'v6.15-rc5' into drm-nextDave Airlie
Linux 6.15-rc5, requested by tzimmerman for fixes required in drm-next. Signed-off-by: Dave Airlie <airlied@redhat.com>
2025-05-02x86/msr: Add explicit includes of <asm/msr.h>Xin Li (Intel)
For historic reasons there are some TSC-related functions in the <asm/msr.h> header, even though there's an <asm/tsc.h> header. To facilitate the relocation of rdtsc{,_ordered}() from <asm/msr.h> to <asm/tsc.h> and to eventually eliminate the inclusion of <asm/msr.h> in <asm/tsc.h>, add an explicit <asm/msr.h> dependency to the source files that reference definitions from <asm/msr.h>. [ mingo: Clarified the changelog. ] Signed-off-by: Xin Li (Intel) <xin@zytor.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Juergen Gross <jgross@suse.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Uros Bizjak <ubizjak@gmail.com> Link: https://lore.kernel.org/r/20250501054241.1245648-1-xin@zytor.com
2025-05-02Merge tag 'v6.15-rc4' into x86/msr, to pick up fixes and resolve conflictsIngo Molnar
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-04-30platform/mellanox: mlxbf-pmc: Support additional PMC blocksShravan Kumar Ramani
Add list of events and counters from the following blocks: APT (ARM Processor Tile), GGA (Global Generic Accelerator), MSN (Memory Stasher and Navigator), EMI (External Memory Interface) and PRNF (PCIe Request Node). If any of the fields populated from the ACPI table (like apt_num) cannot be read, assign the corresponding block count to be 0 instead of failing probe to maintain compatibility with older firmware. Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com> Reviewed-by: David Thompson <davthompson@nvidia.com> Link: https://lore.kernel.org/r/20250423083103.5240-1-shravankr@nvidia.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: alienware-wmi-wmax: Fix awcc_hwmon_fans_init() label logicKurt Borja
To avoid passing an uninitialized `temp_id` to awcc_get_fan_label(), pass the `fan_temps` bitmap instead, to work only on set bits. Additionally, awcc_get_fan_label() leaves `dev` unused, so remove it from it's signature and it does not fail, so remove error handling. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202504250521.HEkFK1Jy-lkp@intel.com/ Fixes: d69990783495 ("platform/x86: alienware-wmi-wmax: Add HWMON support") Signed-off-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250425-temp-id-fix-v1-2-372d71f732bf@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: alienware-wmi-wmax: Fix uninitialized bitmap in ↵Kurt Borja
awcc_hwmon_fans_init() Initialize fan_temps bitmap to zero before using it for the first time in each iteration. Fixes: d69990783495 ("platform/x86: alienware-wmi-wmax: Add HWMON support") Signed-off-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250425-temp-id-fix-v1-1-372d71f732bf@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform: mellanox: mlx-platform: Add support for new Nvidia systemVadim Pasternak
Add support for SN5640 and SN5610 Nvidia switches: - SN5610 is a 51.2Tbps switch based on Nvidia SPC-4 ASIC equipped with 64 OSFP ports supporting 2.5Gbps - 400Gbps speeds. - SN5640 is a 51.2Tbps switch based on Nvidia SPC-5 ASIC equipped with 64 OSFP ports supporting 10Gbps - 800Gbps speeds. Both equipped with: - Air-cooled with 4 + 1 redundant fan units. - 2 + 2 redundant 2000W PSUs. - System management board based on AMD CPU with secure-boot support. Reviewed-by: Oleksandr Shamray <oleksandrs@nvidia.com> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20250421092051.7687-5-vadimp@nvidia.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform: mellanox: Cosmetic changes to improve code styleVadim Pasternak
Replace in 'for' loop - /i >= 0 ; i--/i >= 0 ;i--/. Replace in 'while' loop - /(--i >= 0)/(--i)/. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250421092051.7687-4-vadimp@nvidia.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform: mellanox: Introduce support of Nvidia smart switchVadim Pasternak
Provide platform support for Nvidia Smart Switch SN4280. The Smart Switch equipped with: - Nvidia COME module based on AMD EPYC™ Embedded 3451 CPU. - Nvidia Spectrum-3 ASIC. - Four DPUs, each equipped with Nvidia BF3 ARM based processor and with Lattice LFD2NX-40 FPGA device. - 28xQSFP-DD external ports. - Two power supplies. - Four cooling drawers. Reviewed-by: Ciju Rajan K <crajank@nvidia.com> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250421092051.7687-3-vadimp@nvidia.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/mellanox: mlxreg-dpu: Add initial support for Nvidia DPUVadim Pasternak
Provide platform support for Nvidia (DPU) Data Processor Unit for the Smart Switch SN4280. The Smart Switch equipped with: - Nvidia COME module based on AMD EPYC™ Embedded 3451 CPU. - Nvidia Spectrum-3 ASIC. - Four DPUs, each equipped with Nvidia BF3 ARM based processor and with Lattice LFD2NX-40 FPGA device. - 28xQSFP-DD external ports. - Two power supplies. - Four cooling drawers. Driver provides support for the platform management and monitoring of DPU components. It includes support for: health events, resets and boot progress indications logic, implemented by FPGA device. Reviewed-by: Ciju Rajan K <crajank@nvidia.com> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> [ij: added depends on I2C] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250421092051.7687-2-vadimp@nvidia.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Convert defines to using tabsAntheas Kapenekakis
The defines used spaces previously. Convert all of them to use tabs. Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-17-lkml@antheas.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Rename rval to ret in tt_toggleAntheas Kapenekakis
Rename the variable `rval` to `ret` in the function for consistency. Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-16-lkml@antheas.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Add charge threshold and behaviour to OneXPlayerAntheas Kapenekakis
With the X1 (AMD), OneXPlayer added a charge limit and charge inhibit feature to their devices. Charge limit allows for choosing an arbitrary battery charge setpoint in percentages. Charge ihibit allows to instruct the device to stop charging either when it is awake or always. This feature was then extended for the F1Pro as well. OneXPlayer also released BIOS updates for the X1 Mini, X1 (Intel), and F1 devices that add support for this feature. Therefore, enable it for all F1 and X1 devices. Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-15-lkml@antheas.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Follow reverse xmas convention for tt_toggleAntheas Kapenekakis
Since the rest of the driver follows this convention, apply it to the tt_toggle attribute as well. Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-13-lkml@antheas.dev Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Adhere to sysfs-class-hwmon and enable pwm on 2Antheas Kapenekakis
Currently, the driver does not adhere to the sysfs-class-hwmon specification: 0 is used for auto fan control and 1 is used for manual control. However, it is expected that 0 sets the fan to full speed, 1 sets the fan to manual, and then 2 is used for automatic control. Therefore, change the sysfs API to reflect this and enable pwm on 2. As we are breaking the ABI for this driver, rename oxpec to oxp_ec, reflecting the naming convention used by other drivers, to allow for a smooth migration in current userspace programs. Closes: https://lore.kernel.org/linux-hwmon/20241027174836.8588-1-derekjohn.clark@gmail.com/ Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-12-lkml@antheas.dev Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Move fan speed read to separate functionAntheas Kapenekakis
While not necessary for fixing the ABI hwmon issue, fan speed will be the only remaining value without a function. Therefore, finish the refactor by moving it to a separate function. Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-11-lkml@antheas.dev Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Move pwm value read/write to separate functionsAntheas Kapenekakis
Currently, this driver breaks hwmon ABI by using auto as 0 and manual as 1. However, for pwm_enable, 0 is full speed, 1 is manual, and 2 is auto. For the correction to be possible, this means that the pwm_enable endpoint will need access to both pwm enable and value (as for the 0th value, the fan needs to be set to full power). Therefore, move the pwm value read/write to separate functions. Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-10-lkml@antheas.dev Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Move pwm_enable read to its own functionAntheas Kapenekakis
Currently, this driver breaks ABI by using auto as 0 and manual as 1. However, for pwm_enable, 0 is full speed, 1 is manual, and 2 is auto. For the correction to be possible, this means that the pwm_enable endpoint will need access to both pwm enable and value (as for the 0th value, the fan needs to be set to full power). Therefore, begin by moving the current pwm_enable read to its own function, oxp_pwm_enable. Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-9-lkml@antheas.dev Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Add turbo led support to X1 devicesAntheas Kapenekakis
The X1 and X1 mini lineups feature an LED nested within their turbo button. When turbo takeover is not enabled, the turbo button allows the device to switch from 18W to 25W TDP. When the device is in the 25W TDP mode, the LED is turned on. However, when we engage turbo takeover, the turbo led remains on its last state, which might be illuminated and cannot be currently controlled. Therefore, add the register that controls it under sysfs, to allow userspace to turn it off once engaging turbo takeover and then control it as they wish. 2024 OneXPlayer devices, other than the X1s, do not have a turbo LED. However, earlier models do, so this can be extended to them as well when the register for it is found. Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-8-lkml@antheas.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Rename ec group to tt_toggleAntheas Kapenekakis
Currently, the EC group is used for the turbo button. However, the next patch in the series adds support for the LED button in X1 devices, which is only applicable for X1 devices. Therefore, rename it to prepare for adding the second group. And make it const while at it. Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-7-lkml@antheas.dev Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-30platform/x86: oxpec: Move hwmon/oxp-sensors to platform/x86Antheas Kapenekakis
The EC of OneXPlayer devices used to only control the fan. This is no longer the case, with the EC of OneXPlayer gaining additional functionality (turbo button, turbo led, battery controls). As it will be beneficial from a complexity perspective to retain this driver as a single unit, move it out of hwmon, and into platform/x86. Also, remove the hwmon documentation to prepare moving it to Documentation/ABI/. While at it, add myself to the maintainer's file. Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev> Link: https://lore.kernel.org/r/20250425111821.88746-4-lkml@antheas.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-29platform/x86/amd/hsmp: Make amd_hsmp and hsmp_acpi as mutually exclusive driversSuma Hegde
amd_hsmp and hsmp_acpi are intended to be mutually exclusive drivers and amd_hsmp is for legacy platforms. To achieve this, it is essential to check for the presence of the ACPI device in plat.c. If the hsmp ACPI device entry is found, allow the hsmp_acpi driver to manage the hsmp and return an error from plat.c. Additionally, rename the driver from amd_hsmp to hsmp_acpi to prevent "Driver 'amd_hsmp' is already registered, aborting..." error in case both drivers are loaded simultaneously. Also, support both platform device based and ACPI based probing for family 0x1A models 0x00 to 0x0F, implement only ACPI based probing for family 0x1A, models 0x10 to 0x1F. Return false from legacy_hsmp_support() for this platform. This aligns with the condition check in is_f1a_m0h(). Link: https://lore.kernel.org/platform-driver-x86/aALZxvHWmphNL1wa@gourry-fedora-PF4VCD3F/ Fixes: 7d3135d16356 ("platform/x86/amd/hsmp: Create separate ACPI, plat and common drivers") Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Co-developed-by: Gregory Price <gourry@gourry.net> Signed-off-by: Gregory Price <gourry@gourry.net> Signed-off-by: Suma Hegde <suma.hegde@amd.com> Link: https://lore.kernel.org/r/20250425102357.266790-1-suma.hegde@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-29drivers/platform/x86/amd: pmf: Check for invalid Smart PC PoliciesMario Limonciello
commit 376a8c2a14439 ("platform/x86/amd/pmf: Update PMF Driver for Compatibility with new PMF-TA") added support for platforms that support an updated TA, however it also exposed a number of platforms that although they have support for the updated TA don't actually populate a policy binary. Add an explicit check that the policy binary isn't empty before initializing the TA. Reported-by: Christian Heusel <christian@heusel.eu> Closes: https://lore.kernel.org/platform-driver-x86/ae644428-5bf2-4b30-81ba-0b259ed3449b@heusel.eu/ Fixes: 376a8c2a14439 ("platform/x86/amd/pmf: Update PMF Driver for Compatibility with new PMF-TA") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Christian Heusel <christian@heusel.eu> Link: https://lore.kernel.org/r/20250423132002.3984997-3-superm1@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-29drivers/platform/x86/amd: pmf: Check for invalid sideloaded Smart PC PoliciesMario Limonciello
If a policy is passed into amd_pmf_get_pb_data() that causes the engine to fail to start there is a memory leak. Free the memory in this failure path. Fixes: 10817f28e5337 ("platform/x86/amd/pmf: Add capability to sideload of policy binary") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20250423132002.3984997-2-superm1@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-29platform: arm64: acer-aspire1-ec: convert to devm_drm_bridge_alloc() APILuca Ceresoli
This is the new API for allocating DRM bridges. Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250424-drm-bridge-convert-to-alloc-api-v2-2-8f91a404d86b@bootlin.com Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
2025-04-29platform/chrome: cros_ec_typec: Set Pin Assignment E in DP PORT VDOBenson Leung
Pin C and D are used on C-to-C cable applications including docks, and for USB-C adapters that convert from DP over USB-C to other video standards. Pin Assignment E is intended to be used with adapter from USB-C to DP plugs or receptacles. All Chromebook USB-C DFPs support DisplayPort Alternate Mode as the DP Source with support for all 3 pin assignments. Pin Assignment E is required in order to support if the user attaches a Pin E C-to-DP cable. Without this, the displayport.c alt mode driver will error out of dp_altmode_probe with an -ENODEV, as it cannot find a compatible matching pin assignment between the DFP_D and UFP_D. Fixes: dbb3fc0ffa95 ("platform/chrome: cros_ec_typec: Displayport support") Signed-off-by: Benson Leung <bleung@chromium.org> Reviewed-by: Jameson Thies <jthies@google.com> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Link: https://lore.kernel.org/r/20250428174828.13939-1-bleung@chromium.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2025-04-26platform/x86/amd/pmc: Use FCH_PM_BASE definitionMario Limonciello
The s2idle MMIO quirk uses a scratch register in the FCH. Adjust the code to clarify that. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Cc: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Cc: Yazen Ghannam <yazen.ghannam@amd.com> Cc: platform-driver-x86@vger.kernel.org Link: https://lore.kernel.org/r/20250422234830.2840784-5-superm1@kernel.org
2025-04-25platform/chrome: of_hw_prober: Support touchscreen probing on SquirtleChen-Yu Tsai
The MT8186 Squirtle Chromebook is built with one of two possible touchscreens. Let the prober probe for them. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20250421101248.426929-9-wenst@chromium.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2025-04-25platform/chrome: of_hw_prober: Support trackpad probing on Corsola familyChen-Yu Tsai
Various MT8186 Corsola Chromebooks (squirtle, steelix and voltorb families) have second source trackpads that need to be probed. The power supply for these are always on and their reset/enable lines are not exposed. Add them to the probing list. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20250421101248.426929-8-wenst@chromium.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
2025-04-24platform/x86: int3472: Debug log when remapping pinsHans de Goede
Debug log when remapping a pin/function because of a int3472_gpio_map[] match. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-10-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-24platform/x86: int3472: Add handshake pin supportHans de Goede
New Intel Meteor Lake based laptops with IPU6 cameras have a new type 0x12 pin defined in the INT3472 sensor companion device which describes the sensor's GPIOs. This pin is primarily used on designs with a Lattice FPGA chip which is capable of running the sensor independently of the main CPU for features like presence detection. This pin needs to be driven high to make the FPGA run the power-on sequence of the sensor. After driving the pin high, the FPGA "firmware" needs 25ms to complete the power-on sequence. Add support for this modelling the handshake pin as a GPIO driven "dvdd" regulator with a 25 ms enable time. This model was chosen because: 1. Sensor chips don't have a handshake pin, so we need to abstract this in some way which does not require modification to the sensor drivers, sensor drivers using the bulk-regulator API to get avdd + vddio + dvdd is normal. So this will work to get the right value set to the handshake pin without requiring sensor driver modifications. 2. Sensors typically wait only a small time for the sensor to power-on after de-asserting reset. Not the 25ms the Lattice chip requires. Using the regulator framework's enable_time allows hiding the need for this delay from the sensor drivers. Link: https://lore.kernel.org/platform-driver-x86/59f672c3-6d87-4ec7-9b7f-f44fe2cce934@redhat.com/ Link: https://bugzilla.redhat.com/show_bug.cgi?id=2341731 Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-9-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-24platform/x86: int3472: Prepare for registering more than 1 GPIO regulatorHans de Goede
Prepare the discrete code for registering more than 1 GPIO regulator. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-8-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-24platform/x86: int3472: Avoid GPIO regulator spikesHans de Goede
Avoid the GPIO controlling the avdd regulator being driven low or high for a very short time leading to spikes by adding an enable delay of 2 ms and a minimum off to on delay of also 2 ms. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-7-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-24platform/x86: int3472: Make regulator supply name configurableHans de Goede
This is a preparation patch for registering multiple regulators, which requires a different supply-name for each regulator. Make supply-name a parameter to skl_int3472_register_regulator() and use con-id to set it so that the existing int3472_gpio_map remapping can be used with it. Since supply-name is a parameter now, drop the fixed skl_int3472_regulator_map_supplies[] array and instead add lower- and upper-case mappings of the passed-in supply-name to the regulator. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-6-hdegoede@redhat.com [ij: GPIO_SUPPPLY_NAME_LENGTH -> GPIO_SUPPLY_NAME_LENGTH] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-24platform/x86: int3472: Rework AVDD second sensor quirk handlingHans de Goede
Rework the discrete quirk handling to use a quirks struct which is pointed to by a dmi_system_id table, rather then having a dmi_system_id table per type of quirk. This is a preparation patch for adding support for multiple regulators, where not all regulators might be shared between sensors. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-5-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-04-24platform/x86: int3472: Drop unused gpio field from struct int3472_gpio_regulatorHans de Goede
The gpio field in struct int3472_gpio_regulator is only briefly used to store the GPIO in skl_int3472_register_regulator(). Instead just store the GPIO directly into cfg.ena_gpiod an drop the gpio field. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-4-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>