arm: tegra: Specify correct dev name for audio regulators
[linux-2.6.git] / arch / arm / mach-tegra / board-cardhu-power.c
index 97b168e..15bd8ae 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/regulator/gpio-switch-regulator.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/tps6591x-regulator.h>
-#include <linux/regulator/tps6236x-regulator.h>
+#include <linux/regulator/tps62360.h>
 #include <linux/power/gpio-charger.h>
 
 #include <asm/mach-types.h>
@@ -49,8 +49,6 @@
 #define PMC_CTRL               0x0
 #define PMC_CTRL_INTR_LOW      (1 << 17)
 
-static bool is_cardhu_machine = false;
-
 static struct regulator_consumer_supply tps6591x_vdd1_supply_skubit0_0[] = {
        REGULATOR_SUPPLY("vdd_core", NULL),
        REGULATOR_SUPPLY("en_vddio_ddr_1v2", NULL),
@@ -328,6 +326,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[] = {
@@ -339,11 +338,11 @@ static struct i2c_board_info __initdata cardhu_regulators[] = {
 };
 
 /* TPS62361B DC-DC converter */
-static struct regulator_consumer_supply tps6236x_dcdc_supply[] = {
+static struct regulator_consumer_supply tps62361_dcdc_supply[] = {
        REGULATOR_SUPPLY("vdd_core", NULL),
 };
 
-static struct tps6236x_regulator_platform_data tps6236x_pdata = {
+static struct tps62360_regulator_platform_data tps62361_pdata = {
        .reg_init_data = {                                      \
                .constraints = {                                \
                        .min_uV = 500000,                       \
@@ -357,20 +356,20 @@ static struct tps6236x_regulator_platform_data tps6236x_pdata = {
                        .boot_on =  1,                          \
                        .apply_uV = 0,                          \
                },                                              \
-               .num_consumer_supplies = ARRAY_SIZE(tps6236x_dcdc_supply), \
-               .consumer_supplies = tps6236x_dcdc_supply,              \
-               },                                                      \
-       .internal_pd_enable = 0,                                        \
-       .enable_discharge = true,                                       \
-       .vsel = 3,                                                      \
-       .init_uV = -1,                                                  \
-       .init_apply = 0,                                                \
+               .num_consumer_supplies = ARRAY_SIZE(tps62361_dcdc_supply), \
+               .consumer_supplies = tps62361_dcdc_supply,      \
+               },                                              \
+       .en_discharge = true,                                   \
+       .vsel0_gpio = -1,                                       \
+       .vsel1_gpio = -1,                                       \
+       .vsel0_def_state = 1,                                   \
+       .vsel1_def_state = 1,                                   \
 };
 
-static struct i2c_board_info __initdata tps6236x_boardinfo[] = {
+static struct i2c_board_info __initdata tps62361_boardinfo[] = {
        {
-               I2C_BOARD_INFO("tps62361B", 0x60),
-               .platform_data  = &tps6236x_pdata,
+               I2C_BOARD_INFO("tps62361", 0x60),
+               .platform_data  = &tps62361_pdata,
        },
 };
 
@@ -444,10 +443,9 @@ int __init cardhu_regulator_init(void)
        /* Resgister the TPS6236x for all boards whose sku bit 0 is set. */
        if ((board_info.sku & SKU_DCDC_TPS62361_SUPPORT) ||
                        (pmu_board_info.sku & SKU_DCDC_TPS62361_SUPPORT)) {
-               pr_info("Registering the device TPS62361B\n");
-               i2c_register_board_info(4, tps6236x_boardinfo, 1);
+               pr_info("Registering the device TPS62361\n");
+               i2c_register_board_info(4, tps62361_boardinfo, 1);
        }
-       is_cardhu_machine = true;
        return 0;
 }
 
@@ -512,7 +510,7 @@ static struct regulator_consumer_supply fixed_reg_en_3v3_sys_supply[] = {
        REGULATOR_SUPPLY("vdd_3v3_edid", NULL),
        REGULATOR_SUPPLY("vdd_3v3_hdmi_cec", NULL),
        REGULATOR_SUPPLY("vdd_3v3_gmi", NULL),
-       REGULATOR_SUPPLY("vdd_spk_amp", "tegra-snd-wm8903"),
+       REGULATOR_SUPPLY("vdd_spk_amp", "tegra-snd-wm8903.0"),
        REGULATOR_SUPPLY("vdd_3v3_sensor", NULL),
        REGULATOR_SUPPLY("vdd_3v3_cam", NULL),
        REGULATOR_SUPPLY("vdd_3v3_als", NULL),
@@ -1022,7 +1020,7 @@ int __init cardhu_fixed_regulator_init(void)
        struct platform_device **fixed_reg_devs;
        int    nfixreg_devs;
 
-       if (!is_cardhu_machine)
+       if (!machine_is_cardhu())
                return 0;
 
        tegra_get_board_info(&board_info);
@@ -1183,42 +1181,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,
@@ -1230,11 +1192,6 @@ static struct tegra_tsensor_pmu_data  tpdata = {
        .pmu_i2c_addr = 0x2D,
 };
 
-void __init cardhu_tsensor_init(void)
-{
-       tegra3_tsensor_init(&tpdata);
-}
-
 #ifdef CONFIG_TEGRA_EDP_LIMITS
 
 int __init cardhu_edp_init(void)