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
Thomas Weißschuh
5592240380
platform/x86: think-lmi: 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-3-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:21 +02:00
Thomas Weißschuh
d03cfde56f
platform/x86: firmware_attributes_class: Simplify API
...
The module core already guarantees that a module can only be unloaded
after all other modules using its symbols have been unloaded.
As it's already the responsibility of the drivers using
firmware_attributes_class to clean up their devices before unloading,
the lifetime of the firmware_attributes_class can be bound to the
lifetime of the module.
This enables the direct usage of firmware_attributes_class from the
drivers, without having to go through the lifecycle functions,
leading to simplifications for both the subsystem and its users.
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-2-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:19 +02:00
Thomas Weißschuh
d0eee1be37
platform/x86: firmware_attributes_class: Move include linux/device/class.h
...
The header firmware_attributes_class.h uses 'struct class'. It should
also include the necessary dependency header.
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-1-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:17 +02:00
Nitin Joshi
053c409951
platform/x86: thinkpad-acpi: replace strcpy with strscpy
...
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors.[1]
[1]: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
Signed-off-by: Nitin Joshi <nitjoshi@gmail.com >
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca >
Link: https://lore.kernel.org/r/20250107021507.4786-1-nitjoshi@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:15 +02:00
Ilpo Järvinen
595c4b6724
Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into review-ilpo-next
2025-01-09 13:39:19 +02:00
Hridesh MG
98e45f0d7b
docs: platform/x86: wmi: mention tool for invoking WMI methods
...
Add a reference to WMIExplorer, a tool useful for inspecting and
invoking WMI methods on Windows. This can assist developers in testing
and understanding WMI device functionality when porting drivers to
Linux.
Signed-off-by: Hridesh MG <hridesh699@gmail.com >
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Link: https://lore.kernel.org/r/20250101092730.87160-1-hridesh699@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:38:39 +02:00
Shyam Sundar S K
cce179c655
platform/x86/amd/pmf: Get SRA sensor data from AMD SFH driver
...
The AMD SFH driver includes APIs to export SRA sensor data. This data is
utilized by the AMD PMF driver to transmit SRA data to the PMF TA,
enabling the AMD PMF driver to implement the output actions specified by
the PMF TA.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com >
Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com >
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Acked-by: Jiri Kosina <jkosina@suse.com >
Link: https://lore.kernel.org/r/20241217151627.757477-3-Shyam-sundar.S-k@amd.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:38:21 +02:00
Basavaraj Natikar
d1c444b471
HID: amd_sfh: Add support to export device operating states
...
Add support to export device operating states, such as laptop placement,
platform types and propagate this data to AMD PMF driver for use in
actions.
To retrieve the device operating states data, SRA sensor support need to
be enabled in AMD SFH driver. So add support to enable the SRA sensor.
Also, remove explicit assignments to sensor_index enum.
Co-developed-by: Akshata MukundShetty <akshata.mukundshetty@amd.com >
Signed-off-by: Akshata MukundShetty <akshata.mukundshetty@amd.com >
Signed-off-by: Basavaraj Natikar <basavaraj.natikar@amd.com >
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Acked-by: Jiri Kosina <jkosina@suse.com >
Link: https://lore.kernel.org/r/20241217151627.757477-2-Shyam-sundar.S-k@amd.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:38:04 +02:00
Srinivas Pandruvada
600c8f2431
tools/power/x86/intel-speed-select: v1.21 release
...
This version has one fix:
- Fix restoring TRL after SST-TF disable
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
2025-01-03 06:29:03 -08:00
Srinivas Pandruvada
991c8aacfb
tools/power/x86/intel-speed-select: Fix TRL restore after SST-TF disable
...
When SST-TF is disabled, the TRL (Turbo Ratio Limit) of config level 0
is getting restored. But the TRL of current level should be restored
which may not be config level 0.
This is caused by a bug in treating config level as TRL level. So
arguments needs to be swapped.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
2025-01-03 06:29:02 -08:00
Kurt Borja
6b228cfc52
alienware-wmi: Use devm_platform_profile_register()
...
Replace platform_profile_register() with it's device managed version.
Drop remove_thermal_profile() because it's no longer needed.
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Link: https://lore.kernel.org/r/20241224140131.30362-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 >
2024-12-30 20:22:55 +02:00
Ilpo Järvinen
c416a3fed7
Merge branch 'platform-drivers-x86-platform-profile' into for-next
2024-12-30 20:21:09 +02:00
Kurt Borja
b651ea8a44
ACPI: platform_profile: Add devm_platform_profile_register()
...
Platform profile's lifetime is usually tied to a device's lifetime,
therefore add a device managed version of platform_profile_register().
Signed-off-by: Kurt Borja <kuurtb@gmail.com >
Reviewed-by: Armin Wolf <W_Armin@gmx.de >
Link: https://lore.kernel.org/r/20241224140131.30362-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 >
2024-12-29 18:27:22 +02:00