diff options
-rw-r--r-- | arch/arm/mach-tegra/board-tegratab-memory.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-tegratab-power.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-tegra/common.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-tegra/panel-lgd-wxga-7-0.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra11_emc.c | 6 |
6 files changed, 36 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/board-tegratab-memory.c b/arch/arm/mach-tegra/board-tegratab-memory.c index f72b4fb255d4..a3b22832f1ba 100644 --- a/arch/arm/mach-tegra/board-tegratab-memory.c +++ b/arch/arm/mach-tegra/board-tegratab-memory.c @@ -4194,7 +4194,8 @@ static struct tegra11_emc_pdata *tegratab_get_emc_data(void) else return NULL; - if (!get_androidboot_mode_charger()) +#ifdef CONFIG_ANDROID + if (get_androidboot_mode() != BOOTMODE_CHARGER) return pdata; else { int i; @@ -4215,6 +4216,9 @@ static struct tegra11_emc_pdata *tegratab_get_emc_data(void) charger_emc_pdata.num_tables = num; return &charger_emc_pdata; } +#else + return pdata; +#endif } int __init tegratab_emc_init(void) diff --git a/arch/arm/mach-tegra/board-tegratab-power.c b/arch/arm/mach-tegra/board-tegratab-power.c index e1ccb8b1689a..88b19deb587d 100644 --- a/arch/arm/mach-tegra/board-tegratab-power.c +++ b/arch/arm/mach-tegra/board-tegratab-power.c @@ -628,11 +628,11 @@ int __init tegratab_palmas_regulator_init(void) palmas_pdata.clk32k_init_data_size = ARRAY_SIZE(tegratab_palmas_clk32k_idata); } - - if (get_androidboot_mode_charger()) +#ifdef CONFIG_ANDROID + if (get_androidboot_mode() == BOOTMODE_CHARGER) palmas_pdata.long_press_delay = PALMAS_LONG_PRESS_KEY_TIME_12SECONDS; - +#endif i2c_register_board_info(4, palma_device, ARRAY_SIZE(palma_device)); return 0; @@ -771,6 +771,13 @@ int __init tegratab_regulator_init(void) tegratab_max17048_boardinfo[0].irq = gpio_to_irq(TEGRA_GPIO_PQ5); i2c_register_board_info(0, tegratab_max17048_boardinfo, 1); #endif +#ifdef CONFIG_ANDROID + /* In factory mode boot case, charging until 70% */ + if (get_androidboot_mode() == BOOTMODE_FACTORY) { + tegratab_bq2419x_charger_pdata.vcell_check = NULL; + tegratab_bq2419x_charger_pdata.chg_complete_soc = 70; + } +#endif /* Disable charger when adapter is power source. */ if (get_power_supply_type() != POWER_SUPPLY_TYPE_BATTERY) tegratab_bq2419x_pdata.bcharger_pdata = NULL; diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 9bacda51ceb8..65a37b69c41b 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -186,6 +186,14 @@ enum image_type { rck_image, }; +#ifdef CONFIG_ANDROID +enum androidboot_mode { + BOOTMODE_NORMAL = 0, + BOOTMODE_CHARGER, + BOOTMODE_FACTORY, +}; +#endif + void tegra_get_board_info(struct board_info *); void tegra_get_pmu_board_info(struct board_info *bi); void tegra_get_display_board_info(struct board_info *bi); @@ -216,7 +224,7 @@ int tegra_soc_device_init(const char *machine); int get_pwr_i2c_clk_rate(void); int tegra_get_pmic_rst_reason(void); #ifdef CONFIG_ANDROID -bool get_androidboot_mode_charger(void); +int get_androidboot_mode(void); #endif extern void tegra_set_usb_vbus_internal_wake(bool enable); extern void tegra_set_usb_id_internal_wake(bool enable); diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index e3c930e054f7..61d37f017c81 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -1357,18 +1357,20 @@ static int __init tegra_pmic_rst_reason(char *id) __setup("pmic_rst_reason=", tegra_pmic_rst_reason); #ifdef CONFIG_ANDROID -static bool androidboot_mode_charger; +static int androidboot_mode; -bool get_androidboot_mode_charger(void) +int get_androidboot_mode(void) { - return androidboot_mode_charger; + return androidboot_mode; } static int __init tegra_androidboot_mode(char *options) { - if (!strcmp(options, "charger")) - androidboot_mode_charger = true; + if (!strcmp(options, "factory2")) + androidboot_mode = BOOTMODE_FACTORY; + else if (!strcmp(options, "charger")) + androidboot_mode = BOOTMODE_CHARGER; else - androidboot_mode_charger = false; + androidboot_mode = BOOTMODE_NORMAL; return 1; } __setup("androidboot.mode=", tegra_androidboot_mode); diff --git a/arch/arm/mach-tegra/panel-lgd-wxga-7-0.c b/arch/arm/mach-tegra/panel-lgd-wxga-7-0.c index eab60deda8b9..544a1d77b012 100644 --- a/arch/arm/mach-tegra/panel-lgd-wxga-7-0.c +++ b/arch/arm/mach-tegra/panel-lgd-wxga-7-0.c @@ -549,7 +549,7 @@ static int __init dsi_lgd_wxga_7_0_register_bl_dev(void) int err = 0; #ifdef CONFIG_ANDROID - if (get_androidboot_mode_charger()) + if (get_androidboot_mode() == BOOTMODE_CHARGER) dsi_lgd_wxga_7_0_bl_data.dft_brightness = 60; #endif err = platform_add_devices(dsi_lgd_wxga_7_0_bl_devices, diff --git a/arch/arm/mach-tegra/tegra11_emc.c b/arch/arm/mach-tegra/tegra11_emc.c index 132301ee2135..b095e1ff99c4 100644 --- a/arch/arm/mach-tegra/tegra11_emc.c +++ b/arch/arm/mach-tegra/tegra11_emc.c @@ -1393,14 +1393,14 @@ static int init_emc_table(const struct tegra11_emc_table *table, int table_size) if (table_rate == boot_rate) emc_stats.last_sel = i; - - if (get_androidboot_mode_charger() && +#ifdef CONFIG_ANDROID + if ((get_androidboot_mode() == BOOTMODE_CHARGER) && (table_rate == boot_rate)) { /* EMC max rate = bootloader emc rate */ max_entry = true; break; } - +#endif if (emc_max_dvfs_sel) { /* EMC max rate = max table entry above boot pll_m */ if (table_rate >= max_rate) { |