Commit 862e0104 authored by Sean Wang's avatar Sean Wang Committed by Rafael J. Wysocki

cpufreq: mediatek: add cleanups with the more generic naming

Since more MediaTek SoCs can be supported with the cpufreq driver and not
limited to MT8173, a couple of cleanups are done here with renaming those
functions and related structures with "mtk" instead of "mt8173".
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 034def59
...@@ -507,7 +507,7 @@ static int mtk_cpufreq_exit(struct cpufreq_policy *policy) ...@@ -507,7 +507,7 @@ static int mtk_cpufreq_exit(struct cpufreq_policy *policy)
return 0; return 0;
} }
static struct cpufreq_driver mt8173_cpufreq_driver = { static struct cpufreq_driver mtk_cpufreq_driver = {
.flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK |
CPUFREQ_HAVE_GOVERNOR_PER_POLICY, CPUFREQ_HAVE_GOVERNOR_PER_POLICY,
.verify = cpufreq_generic_frequency_table_verify, .verify = cpufreq_generic_frequency_table_verify,
...@@ -520,7 +520,7 @@ static struct cpufreq_driver mt8173_cpufreq_driver = { ...@@ -520,7 +520,7 @@ static struct cpufreq_driver mt8173_cpufreq_driver = {
.attr = cpufreq_generic_attr, .attr = cpufreq_generic_attr,
}; };
static int mt8173_cpufreq_probe(struct platform_device *pdev) static int mtk_cpufreq_probe(struct platform_device *pdev)
{ {
struct mtk_cpu_dvfs_info *info, *tmp; struct mtk_cpu_dvfs_info *info, *tmp;
int cpu, ret; int cpu, ret;
...@@ -547,7 +547,7 @@ static int mt8173_cpufreq_probe(struct platform_device *pdev) ...@@ -547,7 +547,7 @@ static int mt8173_cpufreq_probe(struct platform_device *pdev)
list_add(&info->list_head, &dvfs_info_list); list_add(&info->list_head, &dvfs_info_list);
} }
ret = cpufreq_register_driver(&mt8173_cpufreq_driver); ret = cpufreq_register_driver(&mtk_cpufreq_driver);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to register mtk cpufreq driver\n"); dev_err(&pdev->dev, "failed to register mtk cpufreq driver\n");
goto release_dvfs_info_list; goto release_dvfs_info_list;
...@@ -564,15 +564,15 @@ static int mt8173_cpufreq_probe(struct platform_device *pdev) ...@@ -564,15 +564,15 @@ static int mt8173_cpufreq_probe(struct platform_device *pdev)
return ret; return ret;
} }
static struct platform_driver mt8173_cpufreq_platdrv = { static struct platform_driver mtk_cpufreq_platdrv = {
.driver = { .driver = {
.name = "mt8173-cpufreq", .name = "mtk-cpufreq",
}, },
.probe = mt8173_cpufreq_probe, .probe = mtk_cpufreq_probe,
}; };
/* List of machines supported by this driver */ /* List of machines supported by this driver */
static const struct of_device_id mt8173_cpufreq_machines[] __initconst = { static const struct of_device_id mtk_cpufreq_machines[] __initconst = {
{ .compatible = "mediatek,mt2701", }, { .compatible = "mediatek,mt2701", },
{ .compatible = "mediatek,mt7623", }, { .compatible = "mediatek,mt7623", },
{ .compatible = "mediatek,mt817x", }, { .compatible = "mediatek,mt817x", },
...@@ -582,7 +582,7 @@ static const struct of_device_id mt8173_cpufreq_machines[] __initconst = { ...@@ -582,7 +582,7 @@ static const struct of_device_id mt8173_cpufreq_machines[] __initconst = {
{ } { }
}; };
static int __init mt8173_cpufreq_driver_init(void) static int __init mtk_cpufreq_driver_init(void)
{ {
struct device_node *np; struct device_node *np;
const struct of_device_id *match; const struct of_device_id *match;
...@@ -593,14 +593,14 @@ static int __init mt8173_cpufreq_driver_init(void) ...@@ -593,14 +593,14 @@ static int __init mt8173_cpufreq_driver_init(void)
if (!np) if (!np)
return -ENODEV; return -ENODEV;
match = of_match_node(mt8173_cpufreq_machines, np); match = of_match_node(mtk_cpufreq_machines, np);
of_node_put(np); of_node_put(np);
if (!match) { if (!match) {
pr_warn("Machine is not compatible with mt8173-cpufreq\n"); pr_warn("Machine is not compatible with mtk-cpufreq\n");
return -ENODEV; return -ENODEV;
} }
err = platform_driver_register(&mt8173_cpufreq_platdrv); err = platform_driver_register(&mtk_cpufreq_platdrv);
if (err) if (err)
return err; return err;
...@@ -610,7 +610,7 @@ static int __init mt8173_cpufreq_driver_init(void) ...@@ -610,7 +610,7 @@ static int __init mt8173_cpufreq_driver_init(void)
* and the device registration codes are put here to handle defer * and the device registration codes are put here to handle defer
* probing. * probing.
*/ */
pdev = platform_device_register_simple("mt8173-cpufreq", -1, NULL, 0); pdev = platform_device_register_simple("mtk-cpufreq", -1, NULL, 0);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
pr_err("failed to register mtk-cpufreq platform device\n"); pr_err("failed to register mtk-cpufreq platform device\n");
return PTR_ERR(pdev); return PTR_ERR(pdev);
...@@ -618,4 +618,4 @@ static int __init mt8173_cpufreq_driver_init(void) ...@@ -618,4 +618,4 @@ static int __init mt8173_cpufreq_driver_init(void)
return 0; return 0;
} }
device_initcall(mt8173_cpufreq_driver_init); device_initcall(mtk_cpufreq_driver_init);
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