summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/mt8173-cpufreq.c
diff options
context:
space:
mode:
authorDaniel Kurtz2017-03-02 12:03:45 +0100
committerRafael J. Wysocki2017-03-12 23:10:53 +0100
commitcf9a2438257da2cbc55f82085b2e0add7583cf79 (patch)
tree3a529a95b14d6a30c73e5f97e3ab1c91b2236cb4 /drivers/cpufreq/mt8173-cpufreq.c
parentcpufreq: mt8173: Mark mt8173_cpufreq_driver_init as __init (diff)
downloadkernel-qcow2-linux-cf9a2438257da2cbc55f82085b2e0add7583cf79.tar.gz
kernel-qcow2-linux-cf9a2438257da2cbc55f82085b2e0add7583cf79.tar.xz
kernel-qcow2-linux-cf9a2438257da2cbc55f82085b2e0add7583cf79.zip
cpufreq: mediatek: Add support for MT8176 and MT817x
The Mediatek MT8173 is just one of several SOCs from the same MT817x family, including the 6-core (4-little/2-big) MT8176. The mt8173-cpufreq driver supports all of these SOCs, however, machines using them may use a different machine compatible. Since this driver checks explicitly for the machine compatible string, add support for the whole family. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/mt8173-cpufreq.c')
-rw-r--r--drivers/cpufreq/mt8173-cpufreq.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c
index 72bc1192bd30..fd1886faf33a 100644
--- a/drivers/cpufreq/mt8173-cpufreq.c
+++ b/drivers/cpufreq/mt8173-cpufreq.c
@@ -573,14 +573,33 @@ static struct platform_driver mt8173_cpufreq_platdrv = {
.probe = mt8173_cpufreq_probe,
};
+/* List of machines supported by this driver */
+static const struct of_device_id mt8173_cpufreq_machines[] __initconst = {
+ { .compatible = "mediatek,mt817x", },
+ { .compatible = "mediatek,mt8173", },
+ { .compatible = "mediatek,mt8176", },
+
+ { }
+};
+
static int __init mt8173_cpufreq_driver_init(void)
{
+ struct device_node *np;
+ const struct of_device_id *match;
struct platform_device *pdev;
int err;
- if (!of_machine_is_compatible("mediatek,mt8173"))
+ np = of_find_node_by_path("/");
+ if (!np)
return -ENODEV;
+ match = of_match_node(mt8173_cpufreq_machines, np);
+ of_node_put(np);
+ if (!match) {
+ pr_warn("Machine is not compatible with mt8173-cpufreq\n");
+ return -ENODEV;
+ }
+
err = platform_driver_register(&mt8173_cpufreq_platdrv);
if (err)
return err;