Commit Graph

4 Commits

Author SHA1 Message Date
David Arcari 3cdf58deeb ACPI: platform_profile: Add device pointer into platform profile handler
JIRA: https://issues.redhat.com/browse/RHEL-105420
Conflicts: RHEL is out of date with upstream.  Callers of
	   platform_profile_register() were updated as appropriate.

commit 6f5e63ddc333dae371be6f8a8f70a82043697a4c
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Thu Dec 5 21:18:59 2024 -0600

    ACPI: platform_profile: Add device pointer into platform profile handler

    In order to let platform profile handlers manage platform profile
    for their driver the core code will need a pointer to the device.

    Add this to the structure and use it in the trivial driver cases.

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

Signed-off-by: David Arcari <darcari@redhat.com>
2025-09-22 07:59:50 -04:00
David Arcari c8f8ceaa7c ACPI: platform-profile: Add a name member to handlers
JIRA: https://issues.redhat.com/browse/RHEL-105420
Conflicts: RHEL is out of date with upsteam.  Callers of
	   platform_profile_register() have been updated
	   as appropriate.

commit 549de562d794a42bb647952e965e588390e16fe0
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Thu Dec 5 21:18:57 2024 -0600

    ACPI: platform-profile: Add a name member to handlers

    In order to prepare for allowing multiple handlers, introduce
    a name field that can be used to distinguish between different
    handlers.

    Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
    Tested-by: Matthew Schwartz <matthew.schwartz@linux.dev>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
    Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Reviewed-by: Armin Wolf <W_Armin@gmx.de>
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Link: https://lore.kernel.org/r/20241206031918.1537-2-mario.limonciello@amd.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2025-09-22 07:59:50 -04:00
Maximilian Luz 03ee318391 platform/surface: aggregator: Make SSAM_DEFINE_SYNC_REQUEST_x define static functions
The SSAM_DEFINE_SYNC_REQUEST_x() macros are intended to reduce
boiler-plate code for SSAM request definitions by defining a wrapper
function for the specified request. The client device variants of those
macros, i.e. SSAM_DEFINE_SYNC_REQUEST_CL_x() in particular rely on the
multi-device (MD) variants, e.g.:

    #define SSAM_DEFINE_SYNC_REQUEST_CL_R(name, rtype, spec...)   \
        SSAM_DEFINE_SYNC_REQUEST_MD_R(__raw_##name, rtype, spec)  \
        int name(struct ssam_device *sdev, rtype *ret)            \
        {                                                         \
            return __raw_##name(sdev->ctrl, sdev->uid.target,     \
                                sdev->uid.instance, ret);         \
        }

This now creates the problem that it is not possible to declare the
generated functions static via

    static SSAM_DEFINE_SYNC_REQUEST_CL_R(...)

as this will only apply to the function defined by the multi-device
macro, i.e. SSAM_DEFINE_SYNC_REQUEST_MD_R(). Thus compiling with
`-Wmissing-prototypes' rightfully complains that there is a 'static'
keyword missing.

To solve this, make all SSAM_DEFINE_SYNC_REQUEST_x() macros define
static functions. Non-client-device macros are also changed for
consistency. In general, we expect those functions to be only used
locally in the respective drivers for the corresponding interfaces, so
having to define a wrapper function to be able to export this should be
the odd case out.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: b78b4982d7 ("platform/surface: Add platform profile driver")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210304190524.1172197-1-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-03-08 11:33:28 +01:00
Maximilian Luz b78b4982d7 platform/surface: Add platform profile driver
Add a driver to provide platform profile support on 5th- and later
generation Microsoft Surface devices with a Surface System Aggregator
Module. On those devices, the platform profile can be used to influence
cooling behavior and power consumption.

For example, the default 'quiet' profile limits fan noise and in turn
sacrifices performance of the discrete GPU found on Surface Books. Its
full performance can only be unlocked on the 'performance' profile.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210211201703.658240-5-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-03-06 10:23:26 +01:00