]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: norrin: Support DT variants w/wo DFLL data
authorAlex Frid <afrid@nvidia.com>
Fri, 21 Feb 2014 08:47:49 +0000 (00:47 -0800)
committerYu-Huan Hsu <yhsu@nvidia.com>
Mon, 24 Feb 2014 19:27:40 +0000 (11:27 -0800)
Norrin platform can be used with different DT variants. Some of them
include DFLL device node, some - not. Added run-time check to Norrin
board file: continue with platform device registration only if DT DFLL
node is not present.

Bug 1442709

Change-Id: I4138392dd4e56d3812159783eb392fd2428d93ef
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/372788
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
arch/arm/mach-tegra/board-norrin-power.c

index 3c380f4a86609432304760bb22e5850295b1eeaa..4eac66a9df1b429141076626470bc8d5da0f4079 100644 (file)
@@ -388,9 +388,29 @@ static struct tegra_cl_dvfs_platform_data norrin_cl_dvfs_data = {
        .cfg_param = &norrin_cl_dvfs_param,
 };
 
+
+static const struct of_device_id dfll_of_match[] = {
+       { .compatible   = "nvidia,tegra124-dfll", },
+       { .compatible   = "nvidia,tegra132-dfll", },
+       { },
+};
+
 static int __init norrin_cl_dvfs_init(void)
 {
        struct board_info board_info;
+       struct device_node *dn = of_find_matching_node(NULL, dfll_of_match);
+
+       /*
+        * Norrin platforms maybe used with different DT variants. Some of them
+        * include DFLL data in DT, some - not. Check DT here, and continue with
+        * platform device registration only if DT DFLL node is not present.
+        */
+       if (dn) {
+               bool available = of_device_is_available(dn);
+               of_node_put(dn);
+               if (available)
+                       return 0;
+       }
 
        tegra_get_board_info(&board_info);