ARM: tegra: cardhu: Update pm_power_off registration
Dan Willemsen [Thu, 1 Dec 2011 23:09:35 +0000 (15:09 -0800)]
Just set the opt in booleans in the platform data instead of checking
which function to register for pm_power_off.

Change-Id: If336ff69e4b61b4220e6766b2643c5fba74d01cc
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Reviewed-on: http://git-master/r/83597
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

Rebase-Id: R1a26cf9ace13f35e2246304b77d42fc9359eacac

arch/arm/mach-tegra/board-cardhu-pm298-power-rails.c
arch/arm/mach-tegra/board-cardhu-power.c
arch/arm/mach-tegra/board-cardhu.c
arch/arm/mach-tegra/board-cardhu.h

index 32a8da2..8a86227 100644 (file)
@@ -332,6 +332,8 @@ static struct max77663_platform_data max7763_pdata = {
 
        .num_subdevs    = ARRAY_SIZE(max77663_subdevs),
        .sub_devices    = max77663_subdevs,
+
+       .use_power_off  = true,
 };
 
 static struct i2c_board_info __initdata max77663_regulators[] = {
index 83f9483..2be32f7 100644 (file)
@@ -328,6 +328,7 @@ static struct tps6591x_platform_data tps_platform = {
        .gpio_base      = TPS6591X_GPIO_BASE,
        .dev_slp_en     = true,
        .slp_keepon     = &tps_slp_keepon,
+       .use_power_off  = true,
 };
 
 static struct i2c_board_info __initdata cardhu_regulators[] = {
@@ -1183,42 +1184,6 @@ int __init cardhu_suspend_init(void)
        return 0;
 }
 
-static void cardhu_power_off(void)
-{
-       int ret;
-       pr_err("cardhu: Powering off the device\n");
-       ret = tps6591x_power_off();
-       if (ret)
-               pr_err("cardhu: failed to power off\n");
-
-       while (1);
-}
-
-static void cardhu_pm298_power_off(void)
-{
-       int ret;
-       pr_err("cardhu-pm298: Powering off the device\n");
-       ret = max77663_power_off();
-       if (ret)
-               pr_err("cardhu-pm298: failed to power off\n");
-
-       while (1);
-}
-
-int __init cardhu_power_off_init(void)
-{
-       struct board_info pmu_board_info;
-
-       tegra_get_pmu_board_info(&pmu_board_info);
-
-       if (pmu_board_info.board_id == BOARD_PMU_PM298)
-               pm_power_off = cardhu_pm298_power_off;
-       else
-               pm_power_off = cardhu_power_off;
-
-       return 0;
-}
-
 static struct tegra_tsensor_pmu_data  tpdata = {
        .poweroff_reg_addr = 0x3F,
        .poweroff_reg_data = 0x80,
index f443f80..36f0fdd 100644 (file)
@@ -981,7 +981,6 @@ static void __init tegra_cardhu_init(void)
        cardhu_regulator_init();
        cardhu_dtv_init();
        cardhu_suspend_init();
-       cardhu_power_off_init();
        cardhu_touch_init();
        cardhu_gps_init();
        cardhu_modem_init();
index f3a402c..00022a4 100644 (file)
@@ -207,7 +207,6 @@ int cardhu_scroll_init(void);
 int cardhu_keys_init(void);
 int cardhu_pins_state_init(void);
 int cardhu_emc_init(void);
-int cardhu_power_off_init(void);
 int cardhu_edp_init(void);
 int cardhu_pmon_init(void);
 int cardhu_pm298_gpio_switch_regulator_init(void);