diff options
author | Daniel Kurtz <djkurtz@chromium.org> | 2017-03-02 06:03:45 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-12 18:10:53 -0400 |
commit | cf9a2438257da2cbc55f82085b2e0add7583cf79 (patch) | |
tree | 3a529a95b14d6a30c73e5f97e3ab1c91b2236cb4 | |
parent | 08a74cbb1ba337fca6add5674506440c044b2c03 (diff) |
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>
-rw-r--r-- | drivers/cpufreq/mt8173-cpufreq.c | 21 |
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 = { | |||
573 | .probe = mt8173_cpufreq_probe, | 573 | .probe = mt8173_cpufreq_probe, |
574 | }; | 574 | }; |
575 | 575 | ||
576 | /* List of machines supported by this driver */ | ||
577 | static const struct of_device_id mt8173_cpufreq_machines[] __initconst = { | ||
578 | { .compatible = "mediatek,mt817x", }, | ||
579 | { .compatible = "mediatek,mt8173", }, | ||
580 | { .compatible = "mediatek,mt8176", }, | ||
581 | |||
582 | { } | ||
583 | }; | ||
584 | |||
576 | static int __init mt8173_cpufreq_driver_init(void) | 585 | static int __init mt8173_cpufreq_driver_init(void) |
577 | { | 586 | { |
587 | struct device_node *np; | ||
588 | const struct of_device_id *match; | ||
578 | struct platform_device *pdev; | 589 | struct platform_device *pdev; |
579 | int err; | 590 | int err; |
580 | 591 | ||
581 | if (!of_machine_is_compatible("mediatek,mt8173")) | 592 | np = of_find_node_by_path("/"); |
593 | if (!np) | ||
582 | return -ENODEV; | 594 | return -ENODEV; |
583 | 595 | ||
596 | match = of_match_node(mt8173_cpufreq_machines, np); | ||
597 | of_node_put(np); | ||
598 | if (!match) { | ||
599 | pr_warn("Machine is not compatible with mt8173-cpufreq\n"); | ||
600 | return -ENODEV; | ||
601 | } | ||
602 | |||
584 | err = platform_driver_register(&mt8173_cpufreq_platdrv); | 603 | err = platform_driver_register(&mt8173_cpufreq_platdrv); |
585 | if (err) | 604 | if (err) |
586 | return err; | 605 | return err; |