diff options
| author | Kurt Borja <[email protected]> | 2025-01-16 00:27:07 +0000 |
|---|---|---|
| committer | Ilpo Järvinen <[email protected]> | 2025-01-16 15:26:30 +0000 |
| commit | 58d5629dc8b8b8d9928fc649d9f2aaa361a8a5c5 (patch) | |
| tree | b66e4f7da4e1ab555cb23b74860c204748cbc4fc /drivers/platform/x86/amd/pmf/sps.c | |
| parent | ACPI: platform_profile: Add `ops` member to handlers (diff) | |
| download | kernel-58d5629dc8b8b8d9928fc649d9f2aaa361a8a5c5.tar.gz kernel-58d5629dc8b8b8d9928fc649d9f2aaa361a8a5c5.zip | |
ACPI: platform_profile: Add `probe` to platform_profile_ops
Add a `probe` callback to platform_profile_ops, which lets drivers
initialize the choices member manually. This is a step towards
unexposing the struct platform_profile_handler from the consumer
drivers.
Reviewed-by: Mario Limonciello <[email protected]>
Signed-off-by: Kurt Borja <[email protected]>
Reviewed-by: Mark Pearson <[email protected]>
Tested-by: Mark Pearson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/amd/pmf/sps.c')
| -rw-r--r-- | drivers/platform/x86/amd/pmf/sps.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/platform/x86/amd/pmf/sps.c b/drivers/platform/x86/amd/pmf/sps.c index 6ae82ae86d22..e710405b581f 100644 --- a/drivers/platform/x86/amd/pmf/sps.c +++ b/drivers/platform/x86/amd/pmf/sps.c @@ -387,7 +387,17 @@ static int amd_pmf_profile_set(struct device *dev, return 0; } +static int amd_pmf_profile_probe(void *drvdata, unsigned long *choices) +{ + set_bit(PLATFORM_PROFILE_LOW_POWER, choices); + set_bit(PLATFORM_PROFILE_BALANCED, choices); + set_bit(PLATFORM_PROFILE_PERFORMANCE, choices); + + return 0; +} + static const struct platform_profile_ops amd_pmf_profile_ops = { + .probe = amd_pmf_profile_probe, .profile_get = amd_pmf_profile_get, .profile_set = amd_pmf_profile_set, }; @@ -414,11 +424,6 @@ int amd_pmf_init_sps(struct amd_pmf_dev *dev) dev->pprof.dev = dev->dev; dev->pprof.ops = &amd_pmf_profile_ops; - /* Setup supported modes */ - set_bit(PLATFORM_PROFILE_LOW_POWER, dev->pprof.choices); - set_bit(PLATFORM_PROFILE_BALANCED, dev->pprof.choices); - set_bit(PLATFORM_PROFILE_PERFORMANCE, dev->pprof.choices); - /* Create platform_profile structure and register */ err = platform_profile_register(&dev->pprof, dev); if (err) |
