summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-kai-panel.c
diff options
context:
space:
mode:
authorKen Chang <kenc@nvidia.com>2012-05-15 18:02:04 +0800
committerSimone Willett <swillett@nvidia.com>2012-06-25 17:34:40 -0700
commit81a8d469a7e9d70d0a2cc0345ddf509038bb620a (patch)
tree209eb35319974f4b8b72183b12fdbc45304a9040 /arch/arm/mach-tegra/board-kai-panel.c
parentcd17fa91e37f8b867ab1ae2759bda03e950fdf83 (diff)
arm: tegra: kai: Fix panel power on/off sequence
Panel power on/off sequence should meet the panel spec as below. power on: 1. EN_VDD_PNL 2. PCLK 3. LVDS_EN 4. LCD_BL_PWN power off: 1. LCD_BL_PWN 2. LVDS_EN 3. PCLK 4. EN_VDD_PNL Pixel clock on/off is controlled by dc driver, we need to separate the setting of panel enable/disable into two parts. The first, i.e., before pclk on/off, is done in kai_panel_enable()/kai_panel_prepoweroff(). And the second part, i.e., after pclk on/off, is done in kai_panel_postpoweron()/kai_panel_disable(). bug 976081 Signed-off-by: Ken Chang <kenc@nvidia.com> Reviewed-on: http://git-master/r/102555 Reviewed-by: Artiste Hsu <chhsu@nvidia.com> Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com> (cherry picked from commit 8149532e20729c359eb1680297f19a8f46343054) Change-Id: Ifc0d60c2caabf60f4186179e64756a4caabf9af6 Reviewed-on: http://git-master/r/110297 Tested-by: Ken Chang <kenc@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Artiste Hsu <chhsu@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-kai-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-kai-panel.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/arch/arm/mach-tegra/board-kai-panel.c b/arch/arm/mach-tegra/board-kai-panel.c
index d98550faf123..e16b17c919ee 100644
--- a/arch/arm/mach-tegra/board-kai-panel.c
+++ b/arch/arm/mach-tegra/board-kai-panel.c
@@ -173,7 +173,7 @@ static struct platform_device kai_backlight_device = {
},
};
-static int kai_panel_enable(void)
+static int kai_panel_postpoweron(void)
{
if (kai_lvds_reg == NULL) {
kai_lvds_reg = regulator_get(NULL, "vdd_lvds");
@@ -184,15 +184,6 @@ static int kai_panel_enable(void)
regulator_enable(kai_lvds_reg);
}
- if (kai_lvds_vdd_panel == NULL) {
- kai_lvds_vdd_panel = regulator_get(NULL, "vdd_lcd_panel");
- if (WARN_ON(IS_ERR(kai_lvds_vdd_panel)))
- pr_err("%s: couldn't get regulator vdd_lcd_panel: %ld\n",
- __func__, PTR_ERR(kai_lvds_vdd_panel));
- else
- regulator_enable(kai_lvds_vdd_panel);
- }
-
mdelay(5);
gpio_set_value(kai_lvds_avdd_en, 1);
@@ -208,8 +199,31 @@ static int kai_panel_enable(void)
return 0;
}
+static int kai_panel_enable(void)
+{
+ if (kai_lvds_vdd_panel == NULL) {
+ kai_lvds_vdd_panel = regulator_get(NULL, "vdd_lcd_panel");
+ if (WARN_ON(IS_ERR(kai_lvds_vdd_panel)))
+ pr_err("%s: couldn't get regulator vdd_lcd_panel: %ld\n",
+ __func__, PTR_ERR(kai_lvds_vdd_panel));
+ else
+ regulator_enable(kai_lvds_vdd_panel);
+ }
+
+ return 0;
+}
+
static int kai_panel_disable(void)
{
+ regulator_disable(kai_lvds_vdd_panel);
+ regulator_put(kai_lvds_vdd_panel);
+ kai_lvds_vdd_panel = NULL;
+
+ return 0;
+}
+
+static int kai_panel_prepoweroff(void)
+{
gpio_set_value(kai_lvds_lr, 0);
gpio_set_value(kai_lvds_shutdown, 0);
gpio_set_value(kai_lvds_rst, 0);
@@ -223,10 +237,6 @@ static int kai_panel_disable(void)
regulator_put(kai_lvds_reg);
kai_lvds_reg = NULL;
- regulator_disable(kai_lvds_vdd_panel);
- regulator_put(kai_lvds_vdd_panel);
- kai_lvds_vdd_panel = NULL;
-
return 0;
}
@@ -526,6 +536,8 @@ static struct tegra_dc_out kai_disp1_out = {
.n_modes = ARRAY_SIZE(kai_panel_modes),
.enable = kai_panel_enable,
+ .postpoweron = kai_panel_postpoweron,
+ .prepoweroff = kai_panel_prepoweroff,
.disable = kai_panel_disable,
};