]> www.infradead.org Git - users/jedix/linux-maple.git/commit
platform/x86/amd/pmf: Fix to update SPS thermals when power supply change
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Wed, 25 Jan 2023 09:59:36 +0000 (15:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:07 +0000 (11:28 +0100)
commit7f7f441347b49b3df569f1fd942f2d43aa4aa2b9
tree314ea2d928b935eefff9d2e28840561ebb5b460d
parentdadc3820a3d98105360477949bd3be94b7d6a3af
platform/x86/amd/pmf: Fix to update SPS thermals when power supply change

[ Upstream commit f21bf62290dd4d769594dcf0e6a688783d74f6a0 ]

Every power mode of static power slider has its own AC and DC power
settings.

When the power source changes from AC to DC, corresponding DC thermals
were not updated from PMF config store and this leads the system to always
run on AC power settings.

Fix it by registering with power_supply notifier and apply DC settings
upon getting notified by the power_supply handler.

Fixes: da5ce22df5fe ("platform/x86/amd/pmf: Add support for PMF core layer")
Suggested-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230125095936.3292883-6-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/amd/pmf/core.c
drivers/platform/x86/amd/pmf/pmf.h