ACPI: platform_profile: Pass the profile handler into platform_profile_notify()

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>
This commit is contained in:
Mario Limonciello 2024-12-05 21:19:01 -06:00 committed by Ilpo Järvinen
parent 9b3bb37b44
commit 4d5c027bf5
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
6 changed files with 12 additions and 12 deletions

View 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;

View 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;

View 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;
}

View 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);
}
}

View File

@ -10538,6 +10538,12 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
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;

View 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_*/