Commit 44e94fec authored by Mario Limonciello's avatar Mario Limonciello Committed by Rafael J. Wysocki
Browse files

platform/x86/amd: pmf: Add 'quiet' to hidden choices



When amd-pmf and asus-wmi are both bound no low power option shows
up in sysfs.  Add a hidden choice for amd-pmf to support 'quiet' mode
to let both bind.

Fixes: 68883474 ("ACPI: platform_profile: Allow multiple handlers")
Suggested-by: default avatarAntheas Kapenekakis <lkml@antheas.dev>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Tested-by: default avatarAntheas Kapenekakis <lkml@antheas.dev>
Tested-by: default avatarDerek J. Clark <derekjohn.clark@gmail.com>
Acked-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20250228170155.2623386-3-superm1@kernel.org


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 778b94d7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@ int amd_pmf_get_pprof_modes(struct amd_pmf_dev *pmf)
		mode = POWER_MODE_BALANCED_POWER;
		break;
	case PLATFORM_PROFILE_LOW_POWER:
	case PLATFORM_PROFILE_QUIET:
		mode = POWER_MODE_POWER_SAVER;
		break;
	default:
@@ -387,6 +388,13 @@ static int amd_pmf_profile_set(struct device *dev,
	return 0;
}

static int amd_pmf_hidden_choices(void *drvdata, unsigned long *choices)
{
	set_bit(PLATFORM_PROFILE_QUIET, choices);

	return 0;
}

static int amd_pmf_profile_probe(void *drvdata, unsigned long *choices)
{
	set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
@@ -398,6 +406,7 @@ static int amd_pmf_profile_probe(void *drvdata, unsigned long *choices)

static const struct platform_profile_ops amd_pmf_profile_ops = {
	.probe = amd_pmf_profile_probe,
	.hidden_choices = amd_pmf_hidden_choices,
	.profile_get = amd_pmf_profile_get,
	.profile_set = amd_pmf_profile_set,
};