]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: platform_profile: Pass the profile handler into platform_profile_notify()
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Dec 2024 03:19:01 +0000 (21:19 -0600)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Dec 2024 17:17:53 +0000 (19:17 +0200)
The profile handler will be used to notify the appropriate class
devices.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
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-6-mario.limonciello@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/acpi/platform_profile.c
drivers/platform/x86/acer-wmi.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/ideapad-laptop.c
drivers/platform/x86/thinkpad_acpi.c
include/linux/platform_profile.h

index c24744da209164adcae6cc801e62bfb57cd5d109..927a2f7456c9a49218028597efa21ff4c72cc047 100644 (file)
@@ -128,7 +128,7 @@ static const struct attribute_group platform_profile_group = {
        .attrs = platform_profile_attrs
 };
 
-void platform_profile_notify(void)
+void platform_profile_notify(struct platform_profile_handler *pprof)
 {
        if (!cur_profile)
                return;
index b12965d9fcdb791a8d797d5fb90bf52bb94cdc2a..00188182580703d85d59211bb1badd1da72d1ecf 100644 (file)
@@ -1988,7 +1988,7 @@ static int acer_thermal_profile_change(void)
                if (tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO_WMI)
                        last_non_turbo_profile = tp;
 
-               platform_profile_notify();
+               platform_profile_notify(&platform_profile_handler);
        }
 
        return 0;
index 805bce80beef20d654f6ce413654ee4552e106f5..fdeebab96fc008b287210ff23855129f1bdc171e 100644 (file)
@@ -3789,7 +3789,7 @@ static ssize_t throttle_thermal_policy_store(struct device *dev,
         * Ensure that platform_profile updates userspace with the change to ensure
         * that platform_profile and throttle_thermal_policy_mode are in sync.
         */
-       platform_profile_notify();
+       platform_profile_notify(&asus->platform_profile_handler);
 
        return count;
 }
index 95b66ac3ea1d6701616f9ddab592f7d90caec9a5..00b9c0c32239c7b789834b3f0dc3e2f18051bc79 100644 (file)
@@ -1041,7 +1041,7 @@ static void dytc_profile_refresh(struct ideapad_private *priv)
 
        if (profile != priv->dytc->current_profile) {
                priv->dytc->current_profile = profile;
-               platform_profile_notify();
+               platform_profile_notify(&priv->dytc->pprof);
        }
 }
 
index 298100d5c535c14c3dd0e3aa2dfd2f196e951f44..f516628617384179b54b6caeb3d1175c06306d31 100644 (file)
@@ -10538,6 +10538,12 @@ unlock:
        return err;
 }
 
+static struct platform_profile_handler dytc_profile = {
+       .name = "thinkpad-acpi",
+       .profile_get = dytc_profile_get,
+       .profile_set = dytc_profile_set,
+};
+
 static void dytc_profile_refresh(void)
 {
        enum platform_profile_option profile;
@@ -10566,16 +10572,10 @@ static void dytc_profile_refresh(void)
        err = convert_dytc_to_profile(funcmode, perfmode, &profile);
        if (!err && profile != dytc_current_profile) {
                dytc_current_profile = profile;
-               platform_profile_notify();
+               platform_profile_notify(&dytc_profile);
        }
 }
 
-static struct platform_profile_handler dytc_profile = {
-       .name = "thinkpad-acpi",
-       .profile_get = dytc_profile_get,
-       .profile_set = dytc_profile_set,
-};
-
 static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
 {
        int err, output;
index bcaf3aa39160fa33ce27bfc4f4f3278d82117c4e..8ec0b8da56db5a043c6bf279149080981f45b7a1 100644 (file)
@@ -39,6 +39,6 @@ struct platform_profile_handler {
 int platform_profile_register(struct platform_profile_handler *pprof);
 int platform_profile_remove(struct platform_profile_handler *pprof);
 int platform_profile_cycle(void);
-void platform_profile_notify(void);
+void platform_profile_notify(struct platform_profile_handler *pprof);
 
 #endif  /*_PLATFORM_PROFILE_H_*/