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

Documentation: Add documentation about class interface for platform profiles

The class interface allows changing multiple platform profiles on a system
to different values. The semantics of it are similar to the legacy
interface.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20241206031918.1537-23-mario.limonciello@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Mario Limonciello and committed by
Ilpo Järvinen
0056b085 dd7ba84a

+43
+5
Documentation/ABI/testing/sysfs-platform_profile
··· 33 33 source such as e.g. a hotkey triggered profile change handled 34 34 either directly by the embedded-controller or fully handled 35 35 inside the kernel. 36 + 37 + This file may also emit the string 'custom' to indicate 38 + that multiple platform profiles drivers are in use but 39 + have different values. This string can not be written to 40 + this interface and is solely for informational purposes.
+38
Documentation/userspace-api/sysfs-platform_profile.rst
··· 40 40 1. Explain why the existing profile names cannot be used. 41 41 2. Add the new profile name, along with a clear description of the 42 42 expected behaviour, to the sysfs-platform_profile ABI documentation. 43 + 44 + "Custom" profile support 45 + ======================== 46 + The platform_profile class also supports profiles advertising a "custom" 47 + profile. This is intended to be set by drivers when the setttings in the 48 + driver have been modified in a way that a standard profile doesn't represent 49 + the current state. 50 + 51 + Multiple driver support 52 + ======================= 53 + When multiple drivers on a system advertise a platform profile handler, the 54 + platform profile handler core will only advertise the profiles that are 55 + common between all drivers to the ``/sys/firmware/acpi`` interfaces. 56 + 57 + This is to ensure there is no ambiguity on what the profile names mean when 58 + all handlers don't support a profile. 59 + 60 + Individual drivers will register a 'platform_profile' class device that has 61 + similar semantics as the ``/sys/firmware/acpi/platform_profile`` interface. 62 + 63 + To discover which driver is associated with a platform profile handler the 64 + user can read the ``name`` attribute of the class device. 65 + 66 + To discover available profiles from the class interface the user can read the 67 + ``choices`` attribute. 68 + 69 + If a user wants to select a profile for a specific driver, they can do so 70 + by writing to the ``profile`` attribute of the driver's class device. 71 + 72 + This will allow users to set different profiles for different drivers on the 73 + same system. If the selected profile by individual drivers differs the 74 + platform profile handler core will display the profile 'custom' to indicate 75 + that the profiles are not the same. 76 + 77 + While the ``platform_profile`` attribute has the value ``custom``, writing a 78 + common profile from ``platform_profile_choices`` to the platform_profile 79 + attribute of the platform profile handler core will set the profile for all 80 + drivers.