arm: tegra: enterprise: adding power off support.
venu byravarasu [Wed, 22 Jun 2011 09:16:08 +0000 (14:16 +0530)]
Board related changes, needed to turn off the device,
are being addded.

bug 833661

Original-Change-Id: Ia5f5f69fc19367995e6ad988a185825bd7b4d969
Reviewed-on: http://git-master/r/36670
Reviewed-by: Niket Sirsi <nsirsi@nvidia.com>
Tested-by: Niket Sirsi <nsirsi@nvidia.com>

Rebase-Id: Reaa3eb086baabd1d3b37a86555c7d2cfcb2eea68

arch/arm/mach-tegra/board-enterprise-power.c

index b42940e..cb98b01 100644 (file)
@@ -340,6 +340,16 @@ static int __init enterprise_gpio_switch_regulator_init(void)
        return platform_device_register(&gswitch_regulator_pdata);
 }
 
+static void enterprise_power_off(void)
+{
+       int ret;
+       pr_info("enterprise: Powering off the device\n");
+       ret = tps80031_power_off();
+       if (ret)
+               pr_err("enterprise: failed to power off\n");
+       while(1);
+}
+
 int __init enterprise_regulator_init(void)
 {
        void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
@@ -353,6 +363,7 @@ int __init enterprise_regulator_init(void)
 
        i2c_register_board_info(4, enterprise_regulators, 1);
        enterprise_gpio_switch_regulator_init();
+       pm_power_off = enterprise_power_off;
        return 0;
 }