Commit 7ac839a0 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm

Pull ARM cpufreq changes for v5.12 from Viresh Kumar:

"- Removal of Tango driver as the platform got removed (Arnd Bergmann).

 - Use resource managed APIs for tegra20 (Dmitry Osipenko).

 - Generic cleanups for brcmstb (Christophe JAILLET).

 - Enable boost support for qcom-hw (Shawn Guo)."

* 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  cpufreq: remove tango driver
  cpufreq: brcmstb-avs-cpufreq: Fix resource leaks in ->remove()
  cpufreq: brcmstb-avs-cpufreq: Free resources in error path
  cpufreq: qcom-hw: enable boost support
  cpufreq: tegra20: Use resource-managed API
parents 2f053186 7114ebff
...@@ -289,11 +289,6 @@ config ARM_STI_CPUFREQ ...@@ -289,11 +289,6 @@ config ARM_STI_CPUFREQ
this config option if you wish to add CPUFreq support for STi based this config option if you wish to add CPUFreq support for STi based
SoCs. SoCs.
config ARM_TANGO_CPUFREQ
bool
depends on CPUFREQ_DT && ARCH_TANGO
default y
config ARM_TEGRA20_CPUFREQ config ARM_TEGRA20_CPUFREQ
tristate "Tegra20/30 CPUFreq support" tristate "Tegra20/30 CPUFreq support"
depends on ARCH_TEGRA && CPUFREQ_DT depends on ARCH_TEGRA && CPUFREQ_DT
......
...@@ -79,7 +79,6 @@ obj-$(CONFIG_ARM_SCPI_CPUFREQ) += scpi-cpufreq.o ...@@ -79,7 +79,6 @@ obj-$(CONFIG_ARM_SCPI_CPUFREQ) += scpi-cpufreq.o
obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o
obj-$(CONFIG_ARM_STI_CPUFREQ) += sti-cpufreq.o obj-$(CONFIG_ARM_STI_CPUFREQ) += sti-cpufreq.o
obj-$(CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM) += sun50i-cpufreq-nvmem.o obj-$(CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM) += sun50i-cpufreq-nvmem.o
obj-$(CONFIG_ARM_TANGO_CPUFREQ) += tango-cpufreq.o
obj-$(CONFIG_ARM_TEGRA20_CPUFREQ) += tegra20-cpufreq.o obj-$(CONFIG_ARM_TEGRA20_CPUFREQ) += tegra20-cpufreq.o
obj-$(CONFIG_ARM_TEGRA124_CPUFREQ) += tegra124-cpufreq.o obj-$(CONFIG_ARM_TEGRA124_CPUFREQ) += tegra124-cpufreq.o
obj-$(CONFIG_ARM_TEGRA186_CPUFREQ) += tegra186-cpufreq.o obj-$(CONFIG_ARM_TEGRA186_CPUFREQ) += tegra186-cpufreq.o
......
...@@ -597,6 +597,16 @@ static int brcm_avs_prepare_init(struct platform_device *pdev) ...@@ -597,6 +597,16 @@ static int brcm_avs_prepare_init(struct platform_device *pdev)
return ret; return ret;
} }
static void brcm_avs_prepare_uninit(struct platform_device *pdev)
{
struct private_data *priv;
priv = platform_get_drvdata(pdev);
iounmap(priv->avs_intr_base);
iounmap(priv->base);
}
static int brcm_avs_cpufreq_init(struct cpufreq_policy *policy) static int brcm_avs_cpufreq_init(struct cpufreq_policy *policy)
{ {
struct cpufreq_frequency_table *freq_table; struct cpufreq_frequency_table *freq_table;
...@@ -732,21 +742,21 @@ static int brcm_avs_cpufreq_probe(struct platform_device *pdev) ...@@ -732,21 +742,21 @@ static int brcm_avs_cpufreq_probe(struct platform_device *pdev)
brcm_avs_driver.driver_data = pdev; brcm_avs_driver.driver_data = pdev;
return cpufreq_register_driver(&brcm_avs_driver); ret = cpufreq_register_driver(&brcm_avs_driver);
if (ret)
brcm_avs_prepare_uninit(pdev);
return ret;
} }
static int brcm_avs_cpufreq_remove(struct platform_device *pdev) static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
{ {
struct private_data *priv;
int ret; int ret;
ret = cpufreq_unregister_driver(&brcm_avs_driver); ret = cpufreq_unregister_driver(&brcm_avs_driver);
if (ret) WARN_ON(ret);
return ret;
priv = platform_get_drvdata(pdev); brcm_avs_prepare_uninit(pdev);
iounmap(priv->base);
iounmap(priv->avs_intr_base);
return 0; return 0;
} }
......
...@@ -141,8 +141,6 @@ static const struct of_device_id blacklist[] __initconst = { ...@@ -141,8 +141,6 @@ static const struct of_device_id blacklist[] __initconst = {
{ .compatible = "st,stih410", }, { .compatible = "st,stih410", },
{ .compatible = "st,stih418", }, { .compatible = "st,stih418", },
{ .compatible = "sigma,tango4", },
{ .compatible = "ti,am33xx", }, { .compatible = "ti,am33xx", },
{ .compatible = "ti,am43", }, { .compatible = "ti,am43", },
{ .compatible = "ti,dra7", }, { .compatible = "ti,dra7", },
......
...@@ -347,6 +347,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) ...@@ -347,6 +347,12 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
dev_pm_opp_of_register_em(cpu_dev, policy->cpus); dev_pm_opp_of_register_em(cpu_dev, policy->cpus);
if (policy_has_boost_freq(policy)) {
ret = cpufreq_enable_boost_support();
if (ret)
dev_warn(cpu_dev, "failed to enable boost: %d\n", ret);
}
return 0; return 0;
error: error:
devm_iounmap(dev, base); devm_iounmap(dev, base);
......
#include <linux/of.h>
#include <linux/cpu.h>
#include <linux/clk.h>
#include <linux/pm_opp.h>
#include <linux/platform_device.h>
static const struct of_device_id machines[] __initconst = {
{ .compatible = "sigma,tango4" },
{ /* sentinel */ }
};
static int __init tango_cpufreq_init(void)
{
struct device *cpu_dev = get_cpu_device(0);
unsigned long max_freq;
struct clk *cpu_clk;
void *res;
if (!of_match_node(machines, of_root))
return -ENODEV;
cpu_clk = clk_get(cpu_dev, NULL);
if (IS_ERR(cpu_clk))
return -ENODEV;
max_freq = clk_get_rate(cpu_clk);
dev_pm_opp_add(cpu_dev, max_freq / 1, 0);
dev_pm_opp_add(cpu_dev, max_freq / 2, 0);
dev_pm_opp_add(cpu_dev, max_freq / 3, 0);
dev_pm_opp_add(cpu_dev, max_freq / 5, 0);
dev_pm_opp_add(cpu_dev, max_freq / 9, 0);
res = platform_device_register_data(NULL, "cpufreq-dt", -1, NULL, 0);
return PTR_ERR_OR_ZERO(res);
}
device_initcall(tango_cpufreq_init);
...@@ -32,6 +32,16 @@ static bool cpu0_node_has_opp_v2_prop(void) ...@@ -32,6 +32,16 @@ static bool cpu0_node_has_opp_v2_prop(void)
return ret; return ret;
} }
static void tegra20_cpufreq_put_supported_hw(void *opp_table)
{
dev_pm_opp_put_supported_hw(opp_table);
}
static void tegra20_cpufreq_dt_unregister(void *cpufreq_dt)
{
platform_device_unregister(cpufreq_dt);
}
static int tegra20_cpufreq_probe(struct platform_device *pdev) static int tegra20_cpufreq_probe(struct platform_device *pdev)
{ {
struct platform_device *cpufreq_dt; struct platform_device *cpufreq_dt;
...@@ -68,42 +78,31 @@ static int tegra20_cpufreq_probe(struct platform_device *pdev) ...@@ -68,42 +78,31 @@ static int tegra20_cpufreq_probe(struct platform_device *pdev)
return err; return err;
} }
err = devm_add_action_or_reset(&pdev->dev,
tegra20_cpufreq_put_supported_hw,
opp_table);
if (err)
return err;
cpufreq_dt = platform_device_register_simple("cpufreq-dt", -1, NULL, 0); cpufreq_dt = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
err = PTR_ERR_OR_ZERO(cpufreq_dt); err = PTR_ERR_OR_ZERO(cpufreq_dt);
if (err) { if (err) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"failed to create cpufreq-dt device: %d\n", err); "failed to create cpufreq-dt device: %d\n", err);
goto err_put_supported_hw; return err;
} }
platform_set_drvdata(pdev, cpufreq_dt); err = devm_add_action_or_reset(&pdev->dev,
tegra20_cpufreq_dt_unregister,
return 0; cpufreq_dt);
if (err)
err_put_supported_hw: return err;
dev_pm_opp_put_supported_hw(opp_table);
return err;
}
static int tegra20_cpufreq_remove(struct platform_device *pdev)
{
struct platform_device *cpufreq_dt;
struct opp_table *opp_table;
cpufreq_dt = platform_get_drvdata(pdev);
platform_device_unregister(cpufreq_dt);
opp_table = dev_pm_opp_get_opp_table(get_cpu_device(0));
dev_pm_opp_put_supported_hw(opp_table);
dev_pm_opp_put_opp_table(opp_table);
return 0; return 0;
} }
static struct platform_driver tegra20_cpufreq_driver = { static struct platform_driver tegra20_cpufreq_driver = {
.probe = tegra20_cpufreq_probe, .probe = tegra20_cpufreq_probe,
.remove = tegra20_cpufreq_remove,
.driver = { .driver = {
.name = "tegra20-cpufreq", .name = "tegra20-cpufreq",
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment