ARM: tegra: dynamically init sys EDP cap
Sivaram Nair [Wed, 29 May 2013 10:21:29 +0000 (13:21 +0300)]
If the device is not powered by a battery, use virtualy unlimited
battery cap.

Change-Id: I1f6bf578af2309d1070034e57ca9b6b6e9575568
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/233652
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>

arch/arm/mach-tegra/board-macallan-power.c
arch/arm/mach-tegra/board-pluto-power.c

index e5a4221..e712a9f 100644 (file)
@@ -848,6 +848,9 @@ void __init macallan_sysedp_init(void)
        if (!IS_ENABLED(CONFIG_EDP_FRAMEWORK))
                return;
 
+       if (get_power_supply_type() != POWER_SUPPLY_TYPE_BATTERY)
+               macallan_sysedp_manager.max = INT_MAX;
+
        r = edp_register_manager(&macallan_sysedp_manager);
        WARN_ON(r);
        if (r)
index 9cd779f..55c34f6 100644 (file)
@@ -922,6 +922,9 @@ void __init pluto_sysedp_init(void)
        if (!IS_ENABLED(CONFIG_EDP_FRAMEWORK))
                return;
 
+       if (get_power_supply_type() != POWER_SUPPLY_TYPE_BATTERY)
+               pluto_sysedp_manager.max = INT_MAX;
+
        r = edp_register_manager(&pluto_sysedp_manager);
        WARN_ON(r);
        if (r)