summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-enterprise-panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/board-enterprise-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-enterprise-panel.c74
1 files changed, 52 insertions, 22 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c
index 913a5775eaf3..5b3dacea135f 100644
--- a/arch/arm/mach-tegra/board-enterprise-panel.c
+++ b/arch/arm/mach-tegra/board-enterprise-panel.c
@@ -28,7 +28,7 @@
#include <linux/tegra_pwm_bl.h>
#include <asm/atomic.h>
#include <linux/nvhost.h>
-#include <mach/nvmap.h>
+#include <linux/nvmap.h>
#include <mach/irqs.h>
#include <mach/iomap.h>
#include <mach/dc.h>
@@ -63,6 +63,7 @@
#ifdef CONFIG_TEGRA_DC
static struct regulator *enterprise_dsi_reg;
+static bool dsi_regulator_status;
static struct regulator *enterprise_lcd_reg;
static struct regulator *enterprise_hdmi_reg;
@@ -149,7 +150,6 @@ static bool kernel_1st_panel_init = true;
static int enterprise_backlight_notify(struct device *unused, int brightness)
{
int cur_sd_brightness = atomic_read(&sd_brightness);
- int orig_brightness = brightness;
/* SD brightness is a percentage, 8-bit value. */
brightness = (brightness * cur_sd_brightness) / 255;
@@ -454,27 +454,61 @@ static struct tegra_dc_platform_data enterprise_disp2_pdata = {
.emc_clk_rate = 300000000,
};
-static int enterprise_dsi_panel_enable(void)
+static int avdd_dsi_csi_rail_enable(void)
{
int ret;
- struct board_info board_info;
- tegra_get_board_info(&board_info);
+ if (dsi_regulator_status == true)
+ return 0;
if (enterprise_dsi_reg == NULL) {
enterprise_dsi_reg = regulator_get(NULL, "avdd_dsi_csi");
if (IS_ERR_OR_NULL(enterprise_dsi_reg)) {
pr_err("dsi: Could not get regulator avdd_dsi_csi\n");
- enterprise_dsi_reg = NULL;
- return PTR_ERR(enterprise_dsi_reg);
+ enterprise_dsi_reg = NULL;
+ return PTR_ERR(enterprise_dsi_reg);
}
}
ret = regulator_enable(enterprise_dsi_reg);
if (ret < 0) {
- printk(KERN_ERR
- "DSI regulator avdd_dsi_csi could not be enabled\n");
+ pr_err("DSI regulator avdd_dsi_csi could not be enabled\n");
return ret;
}
+ dsi_regulator_status = true;
+ return 0;
+}
+
+static int avdd_dsi_csi_rail_disable(void)
+{
+ int ret;
+
+ if (dsi_regulator_status == false)
+ return 0;
+
+ if (enterprise_dsi_reg == NULL) {
+ pr_warn("%s: unbalanced disable\n", __func__);
+ return -EIO;
+ }
+
+ ret = regulator_disable(enterprise_dsi_reg);
+ if (ret < 0) {
+ pr_err("DSI regulator avdd_dsi_csi cannot be disabled\n");
+ return ret;
+ }
+ dsi_regulator_status = false;
+ return 0;
+}
+
+static int enterprise_dsi_panel_enable(void)
+{
+ int ret;
+ struct board_info board_info;
+
+ tegra_get_board_info(&board_info);
+
+ ret = avdd_dsi_csi_rail_enable();
+ if (ret)
+ return ret;
#if DSI_PANEL_RESET
@@ -562,8 +596,8 @@ static void enterprise_stereo_set_orientation(int mode)
#ifdef CONFIG_TEGRA_DC
static int enterprise_dsi_panel_postsuspend(void)
{
- /* Do nothing for enterprise dsi panel */
- return 0;
+ /* Disable enterprise dsi rail */
+ return avdd_dsi_csi_rail_disable();
}
#endif
@@ -782,17 +816,12 @@ static void enterprise_panel_early_suspend(struct early_suspend *h)
fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
if (num_registered_fb > 1)
fb_blank(registered_fb[1], FB_BLANK_NORMAL);
-#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
- cpufreq_save_default_governor();
- cpufreq_set_conservative_governor();
- cpufreq_set_conservative_governor_param("up_threshold",
- SET_CONSERVATIVE_GOVERNOR_UP_THRESHOLD);
-
- cpufreq_set_conservative_governor_param("down_threshold",
- SET_CONSERVATIVE_GOVERNOR_DOWN_THRESHOLD);
- cpufreq_set_conservative_governor_param("freq_step",
- SET_CONSERVATIVE_GOVERNOR_FREQ_STEP);
+#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
+ cpufreq_store_default_gov();
+ if (cpufreq_change_gov(cpufreq_conservative_gov))
+ pr_err("Early_suspend: Error changing governor to %s\n",
+ cpufreq_conservative_gov);
#endif
}
@@ -801,7 +830,8 @@ static void enterprise_panel_late_resume(struct early_suspend *h)
unsigned i;
#ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND
- cpufreq_restore_default_governor();
+ if (cpufreq_restore_default_gov())
+ pr_err("Early_suspend: Unable to restore governor\n");
#endif
for (i = 0; i < num_registered_fb; i++)
fb_blank(registered_fb[i], FB_BLANK_UNBLANK);