Armin Wolf
3ef4ea516c
platform/x86: acer-wmi: Fix initialization of last_non_turbo_profile
...
On machines that do not support the balanced profile the value of
last_non_turbo_profile is invalid after initialization which might
cause the driver to switch to an unsupported platform profile later.
Fix this by only setting last_non_turbo_profile to supported platform
profile values.
Fixes: 191e21f1a4 ("platform/x86: acer-wmi: use an ACPI bitmap to set the platform profile choices")
Signed-off-by: Armin Wolf <W_Armin@gmx.de >
Tested-by: Hridesh MG <hridesh699@gmail.com >
Reviewed-by: Hridesh MG <hridesh699@gmail.com >
Link: https://lore.kernel.org/r/20250119201723.11102-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-20 14:16:59 +02:00
Armin Wolf
f6bfa25c66
platform/x86: acer-wmi: Ignore AC events
...
On the Acer Swift SFG14-41, the events 8 - 1 and 8 - 0 are printed on
AC connect/disconnect. Ignore those events to avoid spamming the
kernel log with error messages.
Reported-by: Farhan Anwar <farhan.anwar8@gmail.com >
Closes: https://lore.kernel.org/platform-driver-x86/2ffb529d-e7c8-4026-a3b8-120c8e7afec8@gmail.com
Tested-by: Rayan Margham <rayanmargham4@gmail.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Armin Wolf <W_Armin@gmx.de >
Link: https://lore.kernel.org/r/20250119201723.11102-2-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-20 14:16:57 +02:00
Ai Chao
ff44b1ca88
platform/mellanox: mlxreg-io: use sysfs_emit() instead of sprintf()
...
Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.
Signed-off-by: Ai Chao <aichao@kylinos.cn >
Acked-by: Vadim Pasternak <vadimp@nvidia.com >
Link: https://lore.kernel.org/r/20250116081129.2902274-1-aichao@kylinos.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-20 14:13:22 +02:00
Ai Chao
fcf1b6f8d8
platform/mellanox: mlxreg-hotplug: use sysfs_emit() instead of sprintf()
...
Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.
Signed-off-by: Ai Chao <aichao@kylinos.cn >
Acked-by: Vadim Pasternak <vadimp@nvidia.com >
Link: https://lore.kernel.org/r/20250116081000.2900435-1-aichao@kylinos.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-20 14:13:20 +02:00
Ai Chao
9886f575de
platform/mellanox: mlxbf-bootctl: use sysfs_emit() instead of sprintf()
...
Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.
Signed-off-by: Ai Chao <aichao@kylinos.cn >
Acked-by: Vadim Pasternak <vadimp@nvidia.com >
Link: https://lore.kernel.org/r/20250116080836.2890442-1-aichao@kylinos.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-20 14:13:18 +02:00
Julien ROBIN
6e4ab59b83
platform/x86: hp-wmi: Add fan and thermal profile support for Victus 16-s1000
...
The following patch adds support for HP Victus 16-s1000 laptop series,
by adding and fixing the following functionalities, which can be
accessed through hwmon and platform_profile sysfs:
- Functional measured fan speed reading
- Ability to enable and disable maximum fan speed
- Platform profiles full setting ability for CPU and GPU
It sets appropriates CPU and GPU power settings both on AC and battery
power sources, for low-power, balanced and performance modes.
It has been thoroughly tested on a 16-s1034nf laptop based on a 8C9C DMI
board name, and behavior of the driver on previous boards is left
untouched thanks to the separated lists of DMI board names.
Signed-off-by: Julien ROBIN <julien.robin28@free.fr >
Link: https://lore.kernel.org/r/1c00f906-8500-41d5-be80-f9092b6a49f1@free.fr
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-20 14:13:14 +02:00
Kurt Borja
0025d83a3c
ACPI: platform_profile: Add a prefix to log messages
...
Declare a pr_fmt prefix.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-20-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 19:16:59 +02:00
Kurt Borja
ee7f3e2b49
ACPI: platform_profile: Add documentation
...
Add kerneldoc and sysfs class documentation.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-19-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 19:16:53 +02:00
Kurt Borja
c4f7d255be
ACPI: platform_profile: Clean platform_profile_handler
...
Remove parent device *dev from platform_profile_handler, as it's no
longer accessed directly. Rename class_dev -> dev.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-18-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 19:16:44 +02:00
Kurt Borja
6ef3389550
ACPI: platform_profile: Move platform_profile_handler
...
platform_profile_handler is now an internal structure. Move it to
platform_profile.c.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-17-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 19:16:20 +02:00
Kurt Borja
07f531b395
ACPI: platform_profile: Remove platform_profile_handler from exported symbols
...
In order to protect the platform_profile_handler from API consumers,
allocate it in platform_profile_register() and modify it's signature
accordingly.
Remove the platform_profile_handler from all consumer drivers and
replace them with a pointer to the class device, which is
now returned from platform_profile_register().
Replace *pprof with a pointer to the class device in the rest of
exported symbols.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-16-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 19:15:59 +02:00
Kurt Borja
31658c916f
platform/x86: thinkpad_acpi: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-15-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 18:16:49 +02:00
Kurt Borja
c72ca29e7f
platform/x86: inspur_platform_profile: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
While at it, pass inspur_wmi_priv to the class device as drvdata and
replace uses of container_of() with dev_get_drvdata().
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-14-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 18:16:45 +02:00
Kurt Borja
db0c8eb72b
platform/x86: hp-wmi: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-13-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-17 18:16:31 +02:00
Kurt Borja
0d882fae33
platform/x86: ideapad-laptop: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-12-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:40 +02:00
Kurt Borja
1ab20816ab
platform/x86: dell-pc: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-11-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:38 +02:00
Kurt Borja
8f18685267
platform/x86: asus-wmi: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Also replace pr_err with dev_err in case of error and make the error
message more user-friendly.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-10-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:36 +02:00
Kurt Borja
3e6d0bf3b9
platform/x86: amd: pmf: sps: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-9-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:35 +02:00
Kurt Borja
9523ea90cb
platform/x86: acer-wmi: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-8-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:33 +02:00
Kurt Borja
24c54b19b4
platform/surface: surface_platform_profile: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-7-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:31 +02:00
Kurt Borja
58d5629dc8
ACPI: platform_profile: Add probe to platform_profile_ops
...
Add a `probe` callback to platform_profile_ops, which lets drivers
initialize the choices member manually. This is a step towards
unexposing the struct platform_profile_handler from the consumer
drivers.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-6-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:30 +02:00
Kurt Borja
b5ca1a4488
ACPI: platform_profile: Add ops member to handlers
...
Replace *profile_get and *profile_set members with a general *ops
member.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-5-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:28 +02:00
Kurt Borja
cf3ea098dd
ACPI: platform_profile: Remove platform_profile_handler from callbacks
...
Devices can now set drvdata to the class device, thus passing the
platform_profile_handler to callbacks is unnecessary. Instead pass the
class device.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-4-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:26 +02:00
Kurt Borja
249c576f0f
ACPI: platform_profile: Let drivers set drvdata to the class device
...
Add *drvdata to platform_profile_register() signature and assign it to
the class device.
While at it, pass specific driver state as drvdata to replace uses of
container_of() with dev_get_drvdata().
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-3-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:25 +02:00
Kurt Borja
d960f14800
ACPI: platform_profile: Replace *class_dev member with class_dev
...
Instead of holding a reference to the class device, embed it the
platform_profile_handler. This involves manually creating and
registering the device and replacing dev_get_drvdata() with the newly
created to_pprof_handler() macro.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250116002721.75592-2-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-16 17:26:22 +02:00
Ai Chao
d98bf6a6ed
platform/x86: lenovo-wmi-camera: Use SW_CAMERA_LENS_COVER instead of KEY_CAMERA_ACESS
...
Use SW_CAMERA_LENS_COVER instead of KEY_CAMERA_ACESS_ENABLE and
KEY_CAMERA_ACESS_DISABLE. When the camera toggle switch was hit,
the lenovo-wmi-camera driver would report an event code.
Signed-off-by: Ai Chao <aichao@kylinos.cn >
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Link: https://lore.kernel.org/r/20250115022825.101986-1-aichao@kylinos.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:38:37 +02:00
Hridesh MG
549fcf58cf
platform/x86: acer-wmi: add support for Acer Nitro AN515-58
...
Add predator_v4 quirk for the Acer Nitro AN515-58 to enable fan speed
monitoring and platform_profile handling.
Signed-off-by: Hridesh MG <hridesh699@gmail.com >
Reviewed-by: Kurt Borja <kuurtb@gmail.com >
Link: https://lore.kernel.org/r/20250113-platform_profile-v4-5-23be0dff19f1@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:27:37 +02:00
Hridesh MG
191e21f1a4
platform/x86: acer-wmi: use an ACPI bitmap to set the platform profile choices
...
Currently the choices for the platform profile are hardcoded. There is
an ACPI bitmap accessible via WMI that specifies the supported profiles,
use this bitmap to dynamically set the choices for the platform profile.
Link: https://lore.kernel.org/platform-driver-x86/ecb60ee5-3df7-4d7e-8ebf-8c162b339ade@gmx.de/
Signed-off-by: Hridesh MG <hridesh699@gmail.com >
Reviewed-by: Kurt Borja <kuurtb@gmail.com >
Link: https://lore.kernel.org/r/20250113-platform_profile-v4-4-23be0dff19f1@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:27:35 +02:00
Hridesh MG
61c461a90f
platform/x86: acer-wmi: simplify platform profile cycling
...
Make use of platform_profile_cycle() to simplify the logic used for
cycling through the different platform profiles. Also remove the
unnecessary handling for AC power, as the hardware accepts different
profiles regardless of whether AC is plugged in.
Link: https://lore.kernel.org/platform-driver-x86/20e3ac66-b040-49a9-ab00-0adcfdaed2ff@gmx.de/
Signed-off-by: Hridesh MG <hridesh699@gmail.com >
Reviewed-by: Kurt Borja <kuurtb@gmail.com >
Link: https://lore.kernel.org/r/20250113-platform_profile-v4-3-23be0dff19f1@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:27:34 +02:00
Hridesh MG
cd44e09bb8
platform/x86: acer-wmi: use new helper function for setting overclocks
...
Migrate the OC handling in acer_toggle_turbo() to the new helper
function for issuing the SetGamingMiscSetting WMI call.
Reviewed-by: Kurt Borja <kuurtb@gmail.com >
Signed-off-by: Hridesh MG <hridesh699@gmail.com >
Link: https://lore.kernel.org/r/20250113-platform_profile-v4-2-23be0dff19f1@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:27:32 +02:00
Hridesh MG
2d76708c22
platform/x86: acer-wmi: use WMI calls for platform profile handling
...
Improve the platform profile handling by using WMI calls to fetch the
current platform profile instead of directly accessing it from the EC.
This is beneficial because the EC address differs for certain laptops.
Link: https://lore.kernel.org/platform-driver-x86/d7be714c-3103-42ee-ad15-223a3fe67f80@gmx.de/
Co-developed-by: Armin Wolf <W_Armin@gmx.de >
Signed-off-by: Armin Wolf <W_Armin@gmx.de >
Reviewed-by: Kurt Borja <kuurtb@gmail.com >
Signed-off-by: Hridesh MG <hridesh699@gmail.com >
Link: https://lore.kernel.org/r/20250113-platform_profile-v4-1-23be0dff19f1@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:27:31 +02:00
Illia Ostapyshyn
7ba618e893
platform/x86: thinkpad_acpi: Add support for new phone link hotkey
...
The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s
Gen 5 laptops includes a symbol showing a smartphone and a laptop
chained together. According to the user manual, it starts the Microsoft
Phone Link software used to connect to Android/iOS devices and relay
messages/calls or sync data.
These laptops send the 0x1320 hkey event when the key is pressed. Map
this event to the new KEY_LINK_PHONE keycode.
Signed-off-by: Illia Ostapyshyn <illia@yshyn.com >
Link: https://lore.kernel.org/r/20241114173930.44983-3-illia@yshyn.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:26:43 +02:00
Illia Ostapyshyn
1bebc7869c
Input: allocate keycode for phone linking
...
The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s
Gen 5 laptops includes a symbol showing a smartphone and a laptop
chained together. According to the user manual, it starts the Microsoft
Phone Link software used to connect to Android/iOS devices and relay
messages/calls or sync data.
As there are no suitable keycodes for this action, introduce a new one.
Signed-off-by: Illia Ostapyshyn <illia@yshyn.com >
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
Link: https://lore.kernel.org/r/20241114173930.44983-2-illia@yshyn.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:26:41 +02:00
Armin Wolf
cec8c359f8
Input: i8042 - Add support for platform filter contexts
...
Currently the platform filter cannot access any driver-specific state
which forces drivers installing a i8042 filter to have at least some
kind of global pointer for their filter.
Allow callers of i8042_install_filter() to submit a context pointer
which is then passed to the i8042 filter. This frees drivers from the
responsibility of having to manage this global pointer themself.
Also introduce a separate type for the i8042 filter (i8042_filter_t)
so that the function definitions can stay compact.
Tested on a Dell Inspiron 3505.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
Signed-off-by: Armin Wolf <W_Armin@gmx.de >
Link: https://lore.kernel.org/r/20250113221314.435812-1-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:26:39 +02:00
Hans de Goede
1e4e3dff9e
platform/x86: dell-smo8800: Add support for probing for the accelerometer i2c address
...
Unfortunately the SMOxxxx ACPI device does not contain the i2c-address
of the accelerometer. So a DMI product-name to address mapping table
is used.
Add support to have the kernel probe for the i2c-address for models
which are not on the list.
The new probing code sits behind a new probe_i2c_addr module parameter,
which is disabled by default because probing might be dangerous.
Link: https://lore.kernel.org/linux-i2c/4820e280-9ca4-4d97-9d21-059626161bfc@molgen.mpg.de/
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Link: https://lore.kernel.org/r/20250106123259.45970-1-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-01-15 16:26:38 +02:00
Shravan Kumar Ramani
913240e47b
Documentation/ABI: Add new sysfs field to sysfs-platform-mellanox-pmc
...
Document newly added "count_clock" sysfs entry for the Mellanox
BlueField PMC driver.
Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com >
Reviewed-by: David Thompson <davthompson@nvidia.com >
Link: https://lore.kernel.org/r/367301238efff01fc200c67bca461c0424baf95d.1736413033.git.shravankr@nvidia.com
[ij: corrected KernelVersion & Date]
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:26:36 +02:00
Shravan Kumar Ramani
8e3b3e1695
platform/mellanox: mlxbf-pmc: Add support for clock_measure performance block
...
The HW clock_measure counter info is passed to the driver from ACPI.
Create a new sub-directory for clock_measure events and provide
read access to the user. Writes are blocked since the fields are RO.
Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com >
Reviewed-by: David Thompson <davthompson@nvidia.com >
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com >
Link: https://lore.kernel.org/r/6ea0699497479dfde0a52fcb28aef55aee1bbc0b.1736413033.git.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-01-15 16:26:35 +02:00
Shravan Kumar Ramani
5efc800975
platform/mellanox: mlxbf-pmc: Add support for monitoring cycle count
...
Add support for programming any counter to monitor the cycle count.
This will allow the user to repurpose and dedicate any of the counters
in the block to counting cycles.
Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com >
Reviewed-by: David Thompson <davthompson@nvidia.com >
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com >
Link: https://lore.kernel.org/r/bd7747897cf1ce77e2e39e271cac21684830f7e7.1736413033.git.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-01-15 16:26:33 +02:00
Shravan Kumar Ramani
1b32401b52
Documentation/ABI: Add document for Mellanox PMC driver
...
Document the sysfs interface for programming and monitoring the
performance counters in various HW blocks of Mellanox BlueField-1,
BlueField-2 and BlueField-3.
Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com >
Reviewed-by: David Thompson <davthompson@nvidia.com >
Link: https://lore.kernel.org/r/9a9e69bd99cad3ad8d1847a6e4e10aff80c6df50.1736413033.git.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-01-15 16:26:31 +02:00
Dr. David Alan Gilbert
761bea182a
platform/x86: intel: punit_ipc: Remove unused function
...
intel_punit_ipc_simple_command() was added in 2015 by
commit fdca4f16f5 ("platform:x86: add Intel P-Unit mailbox IPC driver")
but never used.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org >
Link: https://lore.kernel.org/r/20241221234807.160473-1-linux@treblig.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:26:30 +02:00
Kurt Borja
a5ddea4f9c
platform/x86: alienware_wmi: General cleanup of WMAX methods
...
Reorder variable declaration from longest to shortest. Standarize
show/store method names of WMAX's sysfs groups.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Link: https://lore.kernel.org/r/20250105153019.19206-8-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:26:24 +02:00
Kurt Borja
61493f9472
platform/x86: alienware-wmi: Improve rgb-zones group creation
...
Define zone_attrs statically and initialize zone_attribute_group with
platform driver's .dev_groups.
Drop match_zone() and instead pass a `location` argument to previous
show/store methods to access the correct `zone` LED state. On top of
that rename zone_set() -> zone_store() to be more consistent with sysfs
conventions.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Link: https://lore.kernel.org/r/20250105153019.19206-7-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-15 16:25:31 +02:00
Kurt Borja
1d334211aa
platform/x86: alienware-wmi: Improve hdmi_mux, amplifier and deepslp group creation
...
Devices with hdmi_mux, amplifier or deepslp quirks create a sysfs group
for each available feature. To accomplish this, helper create/remove
functions were called on module init, but they had the following
problems:
- Create helpers called remove helpers on failure, which in turn tried
to remove the sysfs group that failed to be created
- If group creation failed mid way, previous successfully created groups
were not cleaned up
- Module exit only removed hdmi_mux group
To improve this, drop all helpers and let the platform driver manage these
sysfs groups, while controlling visibility with their respective quirks.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Link: https://lore.kernel.org/r/20250105153019.19206-6-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:35 +02:00
Kurt Borja
f3f6728766
platform/x86: alienware-wmi: Modify parse_rgb() signature
...
parse_rgb() now takes struct color_platform instead of struct
platform_zone to support upcoming refactor.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Link: https://lore.kernel.org/r/20250105153019.19206-5-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:33 +02:00
Kurt Borja
99675d25dc
platform/x86: alienware-wmi: Move Lighting Control State
...
Place Lighting Control State logic next to other attributes of the same
sysfs group.
While at it, rename:
store_control_state() -> lighting_control_state_store()
show_control_state() -> lighting_control_state_show()
Replace DEVICE_ATTR() with DEVICE_ATTR_RW() and do a general style
cleanup.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Link: https://lore.kernel.org/r/20250105153019.19206-4-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:32 +02:00
Kurt Borja
2d0a368c34
platform/x86: alienware-wmi: Remove unnecessary check at module exit
...
Module initialization fails if platform device fails to register so it's
always not NULL at exit.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Link: https://lore.kernel.org/r/20250105153019.19206-3-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:30 +02:00
Armin Wolf
c85b516b44
platform/x86: acer-wmi: Add support for Acer Predator PH16-72
...
Add the Acer Predator PT16-72 to acer_quirks to provide support
for the turbo button and predator_v4 interfaces.
Tested-by: Eric Johnsten <ejohnsten@gmail.com >
Signed-off-by: Armin Wolf <W_Armin@gmx.de >
Link: https://lore.kernel.org/r/20250107175652.3171-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:29 +02:00
Thomas Weißschuh
6af39604c7
platform/x86: firmware_attributes_class: Drop lifecycle functions
...
There are no users left.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net >
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250104-firmware-attributes-simplify-v1-6-949f9709e405@weissschuh.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:27 +02:00
Thomas Weißschuh
501d2f0e78
platform/x86: dell-sysman: Directly use firmware_attributes_class
...
The usage of the lifecycle functions is not necessary anymore.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net >
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250104-firmware-attributes-simplify-v1-5-949f9709e405@weissschuh.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:26 +02:00
Thomas Weißschuh
63f8c05803
platform/x86: hp-bioscfg: Directly use firmware_attributes_class
...
The usage of the lifecycle functions is not necessary anymore.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net >
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250104-firmware-attributes-simplify-v1-4-949f9709e405@weissschuh.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
2025-01-09 13:40:24 +02:00