mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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>
This commit is contained in:
parent
40384c840e
commit
549de562d7
|
|
@ -211,6 +211,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
|
|||
|
||||
tpd->sdev = sdev;
|
||||
|
||||
tpd->handler.name = "Surface Platform Profile";
|
||||
tpd->handler.profile_get = ssam_platform_profile_get;
|
||||
tpd->handler.profile_set = ssam_platform_profile_set;
|
||||
|
||||
|
|
|
|||
|
|
@ -1878,6 +1878,7 @@ static int acer_platform_profile_setup(void)
|
|||
if (quirks->predator_v4) {
|
||||
int err;
|
||||
|
||||
platform_profile_handler.name = "acer-wmi";
|
||||
platform_profile_handler.profile_get =
|
||||
acer_predator_v4_platform_profile_get;
|
||||
platform_profile_handler.profile_set =
|
||||
|
|
|
|||
|
|
@ -405,6 +405,7 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev)
|
|||
amd_pmf_set_sps_power_limits(dev);
|
||||
}
|
||||
|
||||
dev->pprof.name = "amd-pmf";
|
||||
dev->pprof.profile_get = amd_pmf_profile_get;
|
||||
dev->pprof.profile_set = amd_pmf_profile_set;
|
||||
|
||||
|
|
|
|||
|
|
@ -3876,6 +3876,7 @@ static int platform_profile_setup(struct asus_wmi *asus)
|
|||
|
||||
dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n");
|
||||
|
||||
asus->platform_profile_handler.name = "asus-wmi";
|
||||
asus->platform_profile_handler.profile_get = asus_wmi_platform_profile_get;
|
||||
asus->platform_profile_handler.profile_set = asus_wmi_platform_profile_set;
|
||||
|
||||
|
|
|
|||
|
|
@ -1156,6 +1156,7 @@ static int create_thermal_profile(void)
|
|||
|
||||
pp_handler.profile_get = thermal_profile_get;
|
||||
pp_handler.profile_set = thermal_profile_set;
|
||||
pp_handler.name = "alienware-wmi";
|
||||
|
||||
return platform_profile_register(&pp_handler);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ static int thermal_init(void)
|
|||
thermal_handler = kzalloc(sizeof(*thermal_handler), GFP_KERNEL);
|
||||
if (!thermal_handler)
|
||||
return -ENOMEM;
|
||||
thermal_handler->name = "dell-pc";
|
||||
thermal_handler->profile_get = thermal_platform_profile_get;
|
||||
thermal_handler->profile_set = thermal_platform_profile_set;
|
||||
|
||||
|
|
|
|||
|
|
@ -1624,6 +1624,7 @@ static int thermal_profile_setup(void)
|
|||
set_bit(PLATFORM_PROFILE_COOL, platform_profile_handler.choices);
|
||||
}
|
||||
|
||||
platform_profile_handler.name = "hp-wmi";
|
||||
set_bit(PLATFORM_PROFILE_BALANCED, platform_profile_handler.choices);
|
||||
set_bit(PLATFORM_PROFILE_PERFORMANCE, platform_profile_handler.choices);
|
||||
|
||||
|
|
|
|||
|
|
@ -1102,6 +1102,7 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv)
|
|||
|
||||
mutex_init(&priv->dytc->mutex);
|
||||
|
||||
priv->dytc->pprof.name = "ideapad-laptop";
|
||||
priv->dytc->priv = priv;
|
||||
priv->dytc->pprof.profile_get = dytc_profile_get;
|
||||
priv->dytc->pprof.profile_set = dytc_profile_set;
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ static int inspur_wmi_probe(struct wmi_device *wdev, const void *context)
|
|||
priv->wdev = wdev;
|
||||
dev_set_drvdata(&wdev->dev, priv);
|
||||
|
||||
priv->handler.name = "inspur-wmi";
|
||||
priv->handler.profile_get = inspur_platform_profile_get;
|
||||
priv->handler.profile_set = inspur_platform_profile_set;
|
||||
|
||||
|
|
|
|||
|
|
@ -10571,6 +10571,7 @@ static void dytc_profile_refresh(void)
|
|||
}
|
||||
|
||||
static struct platform_profile_handler dytc_profile = {
|
||||
.name = "thinkpad-acpi",
|
||||
.profile_get = dytc_profile_get,
|
||||
.profile_set = dytc_profile_set,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ enum platform_profile_option {
|
|||
};
|
||||
|
||||
struct platform_profile_handler {
|
||||
const char *name;
|
||||
unsigned long choices[BITS_TO_LONGS(PLATFORM_PROFILE_LAST)];
|
||||
int (*profile_get)(struct platform_profile_handler *pprof,
|
||||
enum platform_profile_option *profile);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user