diff options
Diffstat (limited to 'drivers/platform/x86/amd')
-rw-r--r-- | drivers/platform/x86/amd/Kconfig | 16 | ||||
-rw-r--r-- | drivers/platform/x86/amd/Makefile | 3 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmc/Kconfig | 20 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmc/Makefile | 8 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmc/pmc-quirks.c (renamed from drivers/platform/x86/amd/pmc-quirks.c) | 0 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmc/pmc.c (renamed from drivers/platform/x86/amd/pmc.c) | 0 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmc/pmc.h (renamed from drivers/platform/x86/amd/pmc.h) | 0 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmf/cnqf.c | 5 | ||||
-rw-r--r-- | drivers/platform/x86/amd/pmf/core.c | 3 |
9 files changed, 35 insertions, 20 deletions
diff --git a/drivers/platform/x86/amd/Kconfig b/drivers/platform/x86/amd/Kconfig index d9685aef0887..55f3a2fc6aec 100644 --- a/drivers/platform/x86/amd/Kconfig +++ b/drivers/platform/x86/amd/Kconfig @@ -4,21 +4,7 @@ # source "drivers/platform/x86/amd/pmf/Kconfig" - -config AMD_PMC - tristate "AMD SoC PMC driver" - depends on ACPI && PCI && RTC_CLASS && AMD_NB - select SERIO - help - The driver provides support for AMD Power Management Controller - primarily responsible for S2Idle transactions that are driven from - a platform firmware running on SMU. This driver also provides a debug - mechanism to investigate the S2Idle transactions and failures. - - Say Y or M here if you have a notebook powered by AMD RYZEN CPU/APU. - - If you choose to compile this driver as a module the module will be - called amd-pmc. +source "drivers/platform/x86/amd/pmc/Kconfig" config AMD_HSMP tristate "AMD HSMP Driver" diff --git a/drivers/platform/x86/amd/Makefile b/drivers/platform/x86/amd/Makefile index 65732f0a3913..f04932b7a7d1 100644 --- a/drivers/platform/x86/amd/Makefile +++ b/drivers/platform/x86/amd/Makefile @@ -4,8 +4,7 @@ # AMD x86 Platform-Specific Drivers # -amd-pmc-y := pmc.o pmc-quirks.o -obj-$(CONFIG_AMD_PMC) += amd-pmc.o +obj-$(CONFIG_AMD_PMC) += pmc/ amd_hsmp-y := hsmp.o obj-$(CONFIG_AMD_HSMP) += amd_hsmp.o obj-$(CONFIG_AMD_PMF) += pmf/ diff --git a/drivers/platform/x86/amd/pmc/Kconfig b/drivers/platform/x86/amd/pmc/Kconfig new file mode 100644 index 000000000000..883c0a95ac0c --- /dev/null +++ b/drivers/platform/x86/amd/pmc/Kconfig @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# AMD PMC Driver +# + +config AMD_PMC + tristate "AMD SoC PMC driver" + depends on ACPI && PCI && RTC_CLASS && AMD_NB + depends on SUSPEND + select SERIO + help + The driver provides support for AMD Power Management Controller + primarily responsible for S2Idle transactions that are driven from + a platform firmware running on SMU. This driver also provides a debug + mechanism to investigate the S2Idle transactions and failures. + + Say Y or M here if you have a notebook powered by AMD RYZEN CPU/APU. + + If you choose to compile this driver as a module the module will be + called amd-pmc. diff --git a/drivers/platform/x86/amd/pmc/Makefile b/drivers/platform/x86/amd/pmc/Makefile new file mode 100644 index 000000000000..4aaa29d351c9 --- /dev/null +++ b/drivers/platform/x86/amd/pmc/Makefile @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for linux/drivers/platform/x86/amd/pmc +# AMD Power Management Controller Driver +# + +amd-pmc-objs := pmc.o pmc-quirks.o +obj-$(CONFIG_AMD_PMC) += amd-pmc.o diff --git a/drivers/platform/x86/amd/pmc-quirks.c b/drivers/platform/x86/amd/pmc/pmc-quirks.c index ad702463a65d..ad702463a65d 100644 --- a/drivers/platform/x86/amd/pmc-quirks.c +++ b/drivers/platform/x86/amd/pmc/pmc-quirks.c diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index c1e788b67a74..c1e788b67a74 100644 --- a/drivers/platform/x86/amd/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c diff --git a/drivers/platform/x86/amd/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index c27bd6a5642f..c27bd6a5642f 100644 --- a/drivers/platform/x86/amd/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h diff --git a/drivers/platform/x86/amd/pmf/cnqf.c b/drivers/platform/x86/amd/pmf/cnqf.c index 539b186e9027..bc8899e15c91 100644 --- a/drivers/platform/x86/amd/pmf/cnqf.c +++ b/drivers/platform/x86/amd/pmf/cnqf.c @@ -8,6 +8,7 @@ * Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> */ +#include <linux/string_choices.h> #include <linux/workqueue.h> #include "pmf.h" @@ -399,7 +400,7 @@ static ssize_t cnqf_enable_store(struct device *dev, amd_pmf_set_sps_power_limits(pdev); } - dev_dbg(pdev->dev, "Received CnQF %s\n", input ? "on" : "off"); + dev_dbg(pdev->dev, "Received CnQF %s\n", str_on_off(input)); return count; } @@ -409,7 +410,7 @@ static ssize_t cnqf_enable_show(struct device *dev, { struct amd_pmf_dev *pdev = dev_get_drvdata(dev); - return sysfs_emit(buf, "%s\n", pdev->cnqf_enabled ? "on" : "off"); + return sysfs_emit(buf, "%s\n", str_on_off(pdev->cnqf_enabled)); } static DEVICE_ATTR_RW(cnqf_enable); diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c index 57bf1a9f0e76..78ed3ee22555 100644 --- a/drivers/platform/x86/amd/pmf/core.c +++ b/drivers/platform/x86/amd/pmf/core.c @@ -324,7 +324,8 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev) static void amd_pmf_deinit_features(struct amd_pmf_dev *dev) { - if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) { + if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR) || + is_apmf_func_supported(dev, APMF_FUNC_OS_POWER_SLIDER_UPDATE)) { power_supply_unreg_notifier(&dev->pwr_src_notifier); amd_pmf_deinit_sps(dev); } |