[ARM] tegra: stingray: implement display suspend/resume callbacks
authorJames Wylder <james.wylder@motorola.com>
Thu, 19 Aug 2010 02:15:03 +0000 (19:15 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:38 +0000 (16:33 -0700)
Implement the init/suspend/resume callbacks to initialize,
clear, and set the lvds gpio respectively.

Change-Id: Id7b7481ceff481088089b7b914cea321ad04350f
Signed-off-by: James Wylder <james.wylder@motorola.com>
arch/arm/mach-tegra/board-stingray-panel.c

index c36e4114c22050e5aab7bfc4a2dc586afb42b05c..460a31c7011e9a957b165f0b936907218988f454 100644 (file)
@@ -31,6 +31,7 @@
 #include "gpio-names.h"
 
 #define STINGRAY_AUO_DISP_BL   TEGRA_GPIO_PD0
+#define STINGRAY_LVDS_SHDN_B   TEGRA_GPIO_PB2
 
 /* Display Controller */
 static struct resource stingray_disp1_resources[] = {
@@ -101,6 +102,26 @@ static struct tegra_fb_data stingray_fb_data = {
        .bits_per_pixel = 32,
 };
 
+static int stingray_display_init(void)
+{
+       tegra_gpio_enable(STINGRAY_LVDS_SHDN_B);
+       gpio_request(STINGRAY_LVDS_SHDN_B, "lvds_shdn_b");
+       gpio_direction_output(STINGRAY_LVDS_SHDN_B, 1);
+       return 0;
+}
+
+static int stingray_display_suspend(pm_message_t state)
+{
+       gpio_set_value(STINGRAY_LVDS_SHDN_B, 0);
+       return 0;
+}
+
+static int stingray_display_resume(void)
+{
+       gpio_set_value(STINGRAY_LVDS_SHDN_B, 1);
+       return 0;
+}
+
 static struct tegra_dc_out stingray_disp1_out = {
        .type = TEGRA_DC_OUT_RGB,
 
@@ -109,6 +130,10 @@ static struct tegra_dc_out stingray_disp1_out = {
 
        .modes = stingray_panel_modes,
        .n_modes = ARRAY_SIZE(stingray_panel_modes),
+
+       .init = stingray_display_init,
+       .suspend = stingray_display_suspend,
+       .resume = stingray_display_resume,
 };
 
 static struct tegra_dc_platform_data stingray_disp1_pdata = {