]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra13: laguna: move cl-dvfs to dt
authorBibek Basu <bbasu@nvidia.com>
Thu, 3 Jul 2014 08:32:40 +0000 (14:02 +0530)
committerBibek Basu <bbasu@nvidia.com>
Wed, 9 Jul 2014 05:02:36 +0000 (22:02 -0700)
Move cl-dvfs to DT for automatic voltage value
detection.

Bug 200017706

Change-Id: I3467c6e34648e6478b4929a47869ba71f0b251a0
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/434018
(cherry picked from commit f97127c812f2ec262497e775d59bc89ea9416141)
Reviewed-on: http://git-master/r/435000
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
arch/arm/mach-tegra/board-laguna-power.c
arch/arm64/boot/dts/tegra132-laguna.dts

index e3ba1ea0aee3611040bd27596654e5e974b59958..c705f346b2251e7affdc3c84bef430da3d1d80dd 100644 (file)
@@ -130,8 +130,28 @@ static struct tegra_cl_dvfs_platform_data laguna_cl_dvfs_data = {
        .cfg_param = &laguna_cl_dvfs_param,
 };
 
+static const struct of_device_id dfll_of_match[] = {
+       { .compatible   = "nvidia,tegra124-dfll", },
+       { .compatible   = "nvidia,tegra132-dfll", },
+       { },
+};
+
 static int __init laguna_cl_dvfs_init(void)
 {
+       struct device_node *dn = of_find_matching_node(NULL, dfll_of_match);
+
+       /*
+        * Laguna 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;
+       }
+
        fill_reg_map();
        laguna_cl_dvfs_data.flags = TEGRA_CL_DVFS_DYN_OUTPUT_CFG;
        tegra_cl_dvfs_device.dev.platform_data = &laguna_cl_dvfs_data;
index e1bf25ca17981b56d29c56284f7fa5bb2f6b8e26..d4fc7663f7297e61e44deff7c91afff498f3fe7e 100644 (file)
@@ -90,7 +90,7 @@
                status = "okay";
        };
 
-         xusb@70090000 {
+        xusb@70090000 {
                /* nvidia,uses_external_pmic; */
                nvidia,gpio_controls_muxed_ss_lanes;
                nvidia,gpio_ss1_sata = <&tca6416 9 0>;
                                "slow-charger", "apple-500ma", "apple-1a",
                                "apple-2a", "y-cable";
        };
+
+       dfll@70040084 {
+               board-params = <&{/cpu_dfll_board_params}>;
+               i2c-pmic-integration = <&{/cpu_dfll_pmic_integration}>;
+               monitor-data-new-workaround;
+               status = "okay";
+       };
+
+       cpu_dfll_board_params {
+               sample-rate = <12500>;
+               fixed-output-forcing;
+               cf = <10>;
+               ci = <0>;
+               cg = <2>;
+               droop-cut-value = <0xf>;
+               droop-restore-ramp = <0x0>;
+               scale-out-ramp = <0x0>;
+       };
+
+       cpu_dfll_pmic_integration {
+               pmic-i2c-address = <0x80>;
+               pmic-i2c-voltage-register = <0x00>;
+               i2c-fs-rate = <400000>;
+               sel-conversion-slope = <1>;
+       };
 };