summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-01-12 13:54:25 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2024-01-12 13:54:25 -0800
commit0c4b09cb542fd0c4134e3f87442c89abffbfeedd (patch)
treedd2f548c306cb57d0011dac87e05a6b575cc235f /drivers/firmware
parentbf9ca811bbadd7d853469d58284ed87906cc9321 (diff)
parentd6948c13b663a284574cb9e502dd663e70d910e8 (diff)
Merge tag 'pmdomain-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain updates from Ulf Hansson: "Core: - Move the generic PM domain and its governor to the pmdomain subsystem - Drop the unused pm_genpd_opp_to_performance_state() Providers: - Convert some providers to let the ->remove() callback return void - amlogic: Add support for G12A ISP power domain - arm: Move the SCPI power-domain driver to the pmdomain subsystem - arm: Move Kconfig options to the pmdomain subsystem - qcom: Update part number to X1E80100 for the rpmhpd" * tag 'pmdomain-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: PM: domains: Move genpd and its governor to the pmdomain subsystem PM: domains: Drop redundant header for genpd PM: domains: Drop the unused pm_genpd_opp_to_performance_state() PM: domains: fix domain_governor kernel-doc warnings pmdomain: xilinx/zynqmp: Convert to platform remove callback returning void pmdomain: qcom-cpr: Convert to platform remove callback returning void pmdomain: imx93-pd: Convert to platform remove callback returning void pmdomain: imx93-blk-ctrl: Convert to platform remove callback returning void pmdomain: imx8mp-blk-ctrl: Convert to platform remove callback returning void pmdomain: imx8m-blk-ctrl: Convert to platform remove callback returning void pmdomain: imx-gpcv2: Convert to platform remove callback returning void pmdomain: imx-gpc: Convert to platform remove callback returning void pmdomain: imx-pgc: Convert to platform remove callback returning void pmdomain: amlogic: meson-ee-pwrc: add support for G12A ISP power domain dt-bindings: power: meson-g12a-power: document ISP power domain firmware: arm_scpi: Move power-domain driver to the pmdomain dir pmdomain: arm_scmi: Move Kconfig options to the pmdomain subsystem pmdomain: qcom: rpmhpd: Update part number to X1E80100 dt-bindings: power: rpmpd: Update part number to X1E80100
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/Kconfig9
-rw-r--r--drivers/firmware/Makefile1
-rw-r--r--drivers/firmware/arm_scmi/Kconfig25
-rw-r--r--drivers/firmware/scpi_pm_domain.c157
4 files changed, 0 insertions, 192 deletions
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 61eba7646edc..afd38539b92e 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -28,15 +28,6 @@ config ARM_SCPI_PROTOCOL
This protocol library provides interface for all the client drivers
making use of the features offered by the SCP.
-config ARM_SCPI_POWER_DOMAIN
- tristate "SCPI power domain driver"
- depends on ARM_SCPI_PROTOCOL || (COMPILE_TEST && OF)
- default y
- select PM_GENERIC_DOMAINS if PM
- help
- This enables support for the SCPI power domains which can be
- enabled or disabled via the SCP firmware
-
config ARM_SDE_INTERFACE
bool "ARM Software Delegated Exception Interface (SDEI)"
depends on ARM64
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index d305d66bc820..7a8d486e718f 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -3,7 +3,6 @@
# Makefile for the linux kernel.
#
obj-$(CONFIG_ARM_SCPI_PROTOCOL) += arm_scpi.o
-obj-$(CONFIG_ARM_SCPI_POWER_DOMAIN) += scpi_pm_domain.o
obj-$(CONFIG_ARM_SDE_INTERFACE) += arm_sdei.o
obj-$(CONFIG_DMI) += dmi_scan.o
obj-$(CONFIG_DMI_SYSFS) += dmi-sysfs.o
diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig
index 706d1264d038..aa5842be19b2 100644
--- a/drivers/firmware/arm_scmi/Kconfig
+++ b/drivers/firmware/arm_scmi/Kconfig
@@ -168,31 +168,6 @@ config ARM_SCMI_TRANSPORT_VIRTIO_ATOMIC_ENABLE
endif #ARM_SCMI_PROTOCOL
-config ARM_SCMI_POWER_DOMAIN
- tristate "SCMI power domain driver"
- depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
- default y
- select PM_GENERIC_DOMAINS if PM
- help
- This enables support for the SCMI power domains which can be
- enabled or disabled via the SCP firmware
-
- This driver can also be built as a module. If so, the module
- will be called scmi_pm_domain. Note this may needed early in boot
- before rootfs may be available.
-
-config ARM_SCMI_PERF_DOMAIN
- tristate "SCMI performance domain driver"
- depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
- default y
- select PM_GENERIC_DOMAINS if PM
- help
- This enables support for the SCMI performance domains which can be
- enabled or disabled via the SCP firmware.
-
- This driver can also be built as a module. If so, the module will be
- called scmi_perf_domain.
-
config ARM_SCMI_POWER_CONTROL
tristate "SCMI system power control driver"
depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/firmware/scpi_pm_domain.c
deleted file mode 100644
index 2231e6dd2070..000000000000
--- a/drivers/firmware/scpi_pm_domain.c
+++ /dev/null
@@ -1,157 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * SCPI Generic power domain support.
- *
- * Copyright (C) 2016 ARM Ltd.
- */
-
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/module.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/pm_domain.h>
-#include <linux/scpi_protocol.h>
-
-struct scpi_pm_domain {
- struct generic_pm_domain genpd;
- struct scpi_ops *ops;
- u32 domain;
-};
-
-/*
- * These device power state values are not well-defined in the specification.
- * In case, different implementations use different values, we can make these
- * specific to compatibles rather than getting these values from device tree.
- */
-enum scpi_power_domain_state {
- SCPI_PD_STATE_ON = 0,
- SCPI_PD_STATE_OFF = 3,
-};
-
-#define to_scpi_pd(gpd) container_of(gpd, struct scpi_pm_domain, genpd)
-
-static int scpi_pd_power(struct scpi_pm_domain *pd, bool power_on)
-{
- int ret;
- enum scpi_power_domain_state state;
-
- if (power_on)
- state = SCPI_PD_STATE_ON;
- else
- state = SCPI_PD_STATE_OFF;
-
- ret = pd->ops->device_set_power_state(pd->domain, state);
- if (ret)
- return ret;
-
- return !(state == pd->ops->device_get_power_state(pd->domain));
-}
-
-static int scpi_pd_power_on(struct generic_pm_domain *domain)
-{
- struct scpi_pm_domain *pd = to_scpi_pd(domain);
-
- return scpi_pd_power(pd, true);
-}
-
-static int scpi_pd_power_off(struct generic_pm_domain *domain)
-{
- struct scpi_pm_domain *pd = to_scpi_pd(domain);
-
- return scpi_pd_power(pd, false);
-}
-
-static int scpi_pm_domain_probe(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
- struct scpi_pm_domain *scpi_pd;
- struct genpd_onecell_data *scpi_pd_data;
- struct generic_pm_domain **domains;
- struct scpi_ops *scpi_ops;
- int ret, num_domains, i;
-
- scpi_ops = get_scpi_ops();
- if (!scpi_ops)
- return -EPROBE_DEFER;
-
- if (!np) {
- dev_err(dev, "device tree node not found\n");
- return -ENODEV;
- }
-
- if (!scpi_ops->device_set_power_state ||
- !scpi_ops->device_get_power_state) {
- dev_err(dev, "power domains not supported in the firmware\n");
- return -ENODEV;
- }
-
- ret = of_property_read_u32(np, "num-domains", &num_domains);
- if (ret) {
- dev_err(dev, "number of domains not found\n");
- return -EINVAL;
- }
-
- scpi_pd = devm_kcalloc(dev, num_domains, sizeof(*scpi_pd), GFP_KERNEL);
- if (!scpi_pd)
- return -ENOMEM;
-
- scpi_pd_data = devm_kzalloc(dev, sizeof(*scpi_pd_data), GFP_KERNEL);
- if (!scpi_pd_data)
- return -ENOMEM;
-
- domains = devm_kcalloc(dev, num_domains, sizeof(*domains), GFP_KERNEL);
- if (!domains)
- return -ENOMEM;
-
- for (i = 0; i < num_domains; i++, scpi_pd++) {
- domains[i] = &scpi_pd->genpd;
-
- scpi_pd->domain = i;
- scpi_pd->ops = scpi_ops;
- scpi_pd->genpd.name = devm_kasprintf(dev, GFP_KERNEL,
- "%pOFn.%d", np, i);
- if (!scpi_pd->genpd.name) {
- dev_err(dev, "Failed to allocate genpd name:%pOFn.%d\n",
- np, i);
- continue;
- }
- scpi_pd->genpd.power_off = scpi_pd_power_off;
- scpi_pd->genpd.power_on = scpi_pd_power_on;
-
- /*
- * Treat all power domains as off at boot.
- *
- * The SCP firmware itself may have switched on some domains,
- * but for reference counting purpose, keep it this way.
- */
- pm_genpd_init(&scpi_pd->genpd, NULL, true);
- }
-
- scpi_pd_data->domains = domains;
- scpi_pd_data->num_domains = num_domains;
-
- of_genpd_add_provider_onecell(np, scpi_pd_data);
-
- return 0;
-}
-
-static const struct of_device_id scpi_power_domain_ids[] = {
- { .compatible = "arm,scpi-power-domains", },
- { /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(of, scpi_power_domain_ids);
-
-static struct platform_driver scpi_power_domain_driver = {
- .driver = {
- .name = "scpi_power_domain",
- .of_match_table = scpi_power_domain_ids,
- },
- .probe = scpi_pm_domain_probe,
-};
-module_platform_driver(scpi_power_domain_driver);
-
-MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
-MODULE_DESCRIPTION("ARM SCPI power domain driver");
-MODULE_LICENSE("GPL v2");