Commit 0a9db0a0 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 cpufreq material for v5.6 from Viresh Kumar:

"This contains:

- Update to imx cpufreq driver to add support for i.MX8MP platform.

- Blacklists few NVIDIA SoCs from cpufreq-dt-platdev layer.

- Convertion of few platform drivers to use
  devm_platform_ioremap_resource().

- Fixed refcount imbalance in few drivers."

* 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  cpufreq: brcmstb-avs: fix imbalance of cpufreq policy refcount
  cpufreq: s3c: fix unbalances of cpufreq policy refcount
  cpufreq: imx-cpufreq-dt: Add i.MX8MP support
  cpufreq: Use imx-cpufreq-dt for i.MX8MP's speed grading
  cpufreq: tegra186: convert to devm_platform_ioremap_resource
  cpufreq: kirkwood: convert to devm_platform_ioremap_resource
parents 1250c1a5 a48ac1c9
...@@ -455,6 +455,8 @@ static unsigned int brcm_avs_cpufreq_get(unsigned int cpu) ...@@ -455,6 +455,8 @@ static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
struct private_data *priv = policy->driver_data; struct private_data *priv = policy->driver_data;
cpufreq_cpu_put(policy);
return brcm_avs_get_frequency(priv->base); return brcm_avs_get_frequency(priv->base);
} }
......
...@@ -109,6 +109,7 @@ static const struct of_device_id blacklist[] __initconst = { ...@@ -109,6 +109,7 @@ static const struct of_device_id blacklist[] __initconst = {
{ .compatible = "fsl,imx8mq", }, { .compatible = "fsl,imx8mq", },
{ .compatible = "fsl,imx8mm", }, { .compatible = "fsl,imx8mm", },
{ .compatible = "fsl,imx8mn", }, { .compatible = "fsl,imx8mn", },
{ .compatible = "fsl,imx8mp", },
{ .compatible = "marvell,armadaxp", }, { .compatible = "marvell,armadaxp", },
......
...@@ -35,7 +35,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) ...@@ -35,7 +35,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
if (of_machine_is_compatible("fsl,imx8mn")) if (of_machine_is_compatible("fsl,imx8mn") ||
of_machine_is_compatible("fsl,imx8mp"))
speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK) speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
>> OCOTP_CFG3_SPEED_GRADE_SHIFT; >> OCOTP_CFG3_SPEED_GRADE_SHIFT;
else else
...@@ -54,7 +55,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev) ...@@ -54,7 +55,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
if (of_machine_is_compatible("fsl,imx8mm") || if (of_machine_is_compatible("fsl,imx8mm") ||
of_machine_is_compatible("fsl,imx8mq")) of_machine_is_compatible("fsl,imx8mq"))
speed_grade = 1; speed_grade = 1;
if (of_machine_is_compatible("fsl,imx8mn")) if (of_machine_is_compatible("fsl,imx8mn") ||
of_machine_is_compatible("fsl,imx8mp"))
speed_grade = 0xb; speed_grade = 0xb;
} }
......
...@@ -102,13 +102,11 @@ static struct cpufreq_driver kirkwood_cpufreq_driver = { ...@@ -102,13 +102,11 @@ static struct cpufreq_driver kirkwood_cpufreq_driver = {
static int kirkwood_cpufreq_probe(struct platform_device *pdev) static int kirkwood_cpufreq_probe(struct platform_device *pdev)
{ {
struct device_node *np; struct device_node *np;
struct resource *res;
int err; int err;
priv.dev = &pdev->dev; priv.dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv.base = devm_platform_ioremap_resource(pdev, 0);
priv.base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv.base)) if (IS_ERR(priv.base))
return PTR_ERR(priv.base); return PTR_ERR(priv.base);
......
...@@ -304,6 +304,7 @@ static int s3c2416_cpufreq_reboot_notifier_evt(struct notifier_block *this, ...@@ -304,6 +304,7 @@ static int s3c2416_cpufreq_reboot_notifier_evt(struct notifier_block *this,
{ {
struct s3c2416_data *s3c_freq = &s3c2416_cpufreq; struct s3c2416_data *s3c_freq = &s3c2416_cpufreq;
int ret; int ret;
struct cpufreq_policy *policy;
mutex_lock(&cpufreq_lock); mutex_lock(&cpufreq_lock);
...@@ -318,7 +319,16 @@ static int s3c2416_cpufreq_reboot_notifier_evt(struct notifier_block *this, ...@@ -318,7 +319,16 @@ static int s3c2416_cpufreq_reboot_notifier_evt(struct notifier_block *this,
*/ */
if (s3c_freq->is_dvs) { if (s3c_freq->is_dvs) {
pr_debug("cpufreq: leave dvs on reboot\n"); pr_debug("cpufreq: leave dvs on reboot\n");
ret = cpufreq_driver_target(cpufreq_cpu_get(0), FREQ_SLEEP, 0);
policy = cpufreq_cpu_get(0);
if (!policy) {
pr_debug("cpufreq: get no policy for cpu0\n");
return NOTIFY_BAD;
}
ret = cpufreq_driver_target(policy, FREQ_SLEEP, 0);
cpufreq_cpu_put(policy);
if (ret < 0) if (ret < 0)
return NOTIFY_BAD; return NOTIFY_BAD;
} }
......
...@@ -555,8 +555,17 @@ static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this, ...@@ -555,8 +555,17 @@ static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this,
unsigned long event, void *ptr) unsigned long event, void *ptr)
{ {
int ret; int ret;
struct cpufreq_policy *policy;
policy = cpufreq_cpu_get(0);
if (!policy) {
pr_debug("cpufreq: get no policy for cpu0\n");
return NOTIFY_BAD;
}
ret = cpufreq_driver_target(policy, SLEEP_FREQ, 0);
cpufreq_cpu_put(policy);
ret = cpufreq_driver_target(cpufreq_cpu_get(0), SLEEP_FREQ, 0);
if (ret < 0) if (ret < 0)
return NOTIFY_BAD; return NOTIFY_BAD;
......
...@@ -187,7 +187,6 @@ static int tegra186_cpufreq_probe(struct platform_device *pdev) ...@@ -187,7 +187,6 @@ static int tegra186_cpufreq_probe(struct platform_device *pdev)
{ {
struct tegra186_cpufreq_data *data; struct tegra186_cpufreq_data *data;
struct tegra_bpmp *bpmp; struct tegra_bpmp *bpmp;
struct resource *res;
unsigned int i = 0, err; unsigned int i = 0, err;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
...@@ -205,8 +204,7 @@ static int tegra186_cpufreq_probe(struct platform_device *pdev) ...@@ -205,8 +204,7 @@ static int tegra186_cpufreq_probe(struct platform_device *pdev)
if (IS_ERR(bpmp)) if (IS_ERR(bpmp))
return PTR_ERR(bpmp); return PTR_ERR(bpmp);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->regs = devm_platform_ioremap_resource(pdev, 0);
data->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(data->regs)) { if (IS_ERR(data->regs)) {
err = PTR_ERR(data->regs); err = PTR_ERR(data->regs);
goto put_bpmp; goto put_bpmp;
......
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