video: add rgb disable handler
authorJames Wylder <james.wylder@motorola.com>
Thu, 11 Nov 2010 18:55:59 +0000 (12:55 -0600)
committerErik Gilling <konkers@android.com>
Thu, 11 Nov 2010 22:16:51 +0000 (14:16 -0800)
Adjust pinmux on disable in order to save power/leakage

Change-Id: I65b642c128a780aa8932205052ccee199e4c41bf
Signed-off-by: James Wylder <james.wylder@motorola.com>
Signed-off-by: Erik Gilling <konkers@android.com>
drivers/video/tegra/dc/rgb.c

index c56e1f9e126bd9a754ec027df3e332c92daeccc6..b0652f10fe9672d67c9e330ddb915a970e1af9f9 100644 (file)
@@ -23,7 +23,7 @@
 #include "dc_priv.h"
 
 
-static const u32 tegra_dc_rgb_pintable[] = {
+static const u32 tegra_dc_rgb_enable_pintable[] = {
        DC_COM_PIN_OUTPUT_ENABLE0,      0x00000000,
        DC_COM_PIN_OUTPUT_ENABLE1,      0x00000000,
        DC_COM_PIN_OUTPUT_ENABLE2,      0x00000000,
@@ -45,6 +45,27 @@ static const u32 tegra_dc_rgb_pintable[] = {
        DC_COM_PIN_OUTPUT_SELECT6,      0x00020000,
 };
 
+static const u32 tegra_dc_rgb_disable_pintable[] = {
+       DC_COM_PIN_OUTPUT_ENABLE0,      0x55555555,
+       DC_COM_PIN_OUTPUT_ENABLE1,      0x55150005,
+       DC_COM_PIN_OUTPUT_ENABLE2,      0x55555555,
+       DC_COM_PIN_OUTPUT_ENABLE3,      0x55555555,
+       DC_COM_PIN_OUTPUT_POLARITY0,    0x00000000,
+       DC_COM_PIN_OUTPUT_POLARITY1,    0x00000000,
+       DC_COM_PIN_OUTPUT_POLARITY2,    0x00000000,
+       DC_COM_PIN_OUTPUT_POLARITY3,    0x00000000,
+       DC_COM_PIN_OUTPUT_DATA0,        0xaaaaaaaa,
+       DC_COM_PIN_OUTPUT_DATA1,        0xaaaaaaaa,
+       DC_COM_PIN_OUTPUT_DATA2,        0xaaaaaaaa,
+       DC_COM_PIN_OUTPUT_DATA3,        0xaaaaaaaa,
+       DC_COM_PIN_OUTPUT_SELECT0,      0x00000000,
+       DC_COM_PIN_OUTPUT_SELECT1,      0x00000000,
+       DC_COM_PIN_OUTPUT_SELECT2,      0x00000000,
+       DC_COM_PIN_OUTPUT_SELECT3,      0x00000000,
+       DC_COM_PIN_OUTPUT_SELECT4,      0x00000000,
+       DC_COM_PIN_OUTPUT_SELECT5,      0x00000000,
+       DC_COM_PIN_OUTPUT_SELECT6,      0x00000000,
+};
 
 void tegra_dc_rgb_enable(struct tegra_dc *dc)
 {
@@ -54,10 +75,18 @@ void tegra_dc_rgb_enable(struct tegra_dc *dc)
 
        tegra_dc_writel(dc, DISP_CTRL_MODE_C_DISPLAY, DC_CMD_DISPLAY_COMMAND);
 
-       tegra_dc_write_table(dc, tegra_dc_rgb_pintable);
+       tegra_dc_write_table(dc, tegra_dc_rgb_enable_pintable);
+}
+
+void tegra_dc_rgb_disable(struct tegra_dc *dc)
+{
+       tegra_dc_writel(dc, 0x00000000, DC_CMD_DISPLAY_POWER_CONTROL);
+
+       tegra_dc_write_table(dc, tegra_dc_rgb_disable_pintable);
 }
 
 struct tegra_dc_out_ops tegra_dc_rgb_ops = {
        .enable = tegra_dc_rgb_enable,
+       .disable = tegra_dc_rgb_disable,
 };