summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-cardhu-panel.c
diff options
context:
space:
mode:
authorJon Mayo <jmayo@nvidia.com>2011-04-12 18:14:22 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:55:39 -0700
commit79997a2766061a7423b41f0475a9ede880ca5f09 (patch)
treefc2b899bc93c090f4a7ece0fe975828113bd0988 /arch/arm/mach-tegra/board-cardhu-panel.c
parentd05379b5925a25672aef058fc7a3029b75146724 (diff)
arm: tegra: cardhu: hdmi: use hotplug_init
use FB_BLANK_POWERDOWN on hdmi device in earlysuspend to cause tegra_dc_disable. use new hotplug_init / postsuspend callbacks to manage +5V hdmi power pin. this pin should be enabled whenever the device is active, and off when the device is suspended. bug 812083 bug 811523 Original-Change-Id: I6e8a2ae2683c79d5271aef9580df68c11628c823 Reviewed-on: http://git-master/r/27571 Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Tested-by: Jonathan Mayo <jmayo@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Change-Id: I6d98bdd58c90e02085d13bf29f2046baf144722e
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-panel.c')
-rw-r--r--arch/arm/mach-tegra/board-cardhu-panel.c66
1 files changed, 41 insertions, 25 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c
index e312793f6b12..e272aae6a6e3 100644
--- a/arch/arm/mach-tegra/board-cardhu-panel.c
+++ b/arch/arm/mach-tegra/board-cardhu-panel.c
@@ -244,6 +244,38 @@ static int cardhu_panel_disable(void)
return 0;
}
+static int cardhu_hdmi_vddio_enable(void)
+{
+ int ret;
+ if (!cardhu_hdmi_vddio) {
+ cardhu_hdmi_vddio = regulator_get(NULL, "vdd_hdmi_con");
+ if (IS_ERR_OR_NULL(cardhu_hdmi_vddio)) {
+ ret = PTR_ERR(cardhu_hdmi_vddio);
+ pr_err("hdmi: couldn't get regulator vdd_hdmi_con\n");
+ cardhu_hdmi_vddio = NULL;
+ return ret;
+ }
+ }
+ ret = regulator_enable(cardhu_hdmi_vddio);
+ if (ret < 0) {
+ pr_err("hdmi: couldn't enable regulator vdd_hdmi_con\n");
+ regulator_put(cardhu_hdmi_vddio);
+ cardhu_hdmi_vddio = NULL;
+ return ret;
+ }
+ return ret;
+}
+
+static int cardhu_hdmi_vddio_disable(void)
+{
+ if (cardhu_hdmi_vddio) {
+ regulator_disable(cardhu_hdmi_vddio);
+ regulator_put(cardhu_hdmi_vddio);
+ cardhu_hdmi_vddio = NULL;
+ }
+ return 0;
+}
+
static int cardhu_hdmi_enable(void)
{
int ret;
@@ -275,24 +307,6 @@ static int cardhu_hdmi_enable(void)
pr_err("hdmi: couldn't enable regulator avdd_hdmi_pll\n");
return ret;
}
- if (!cardhu_hdmi_vddio) {
- cardhu_hdmi_vddio = regulator_get(NULL, "vdd_hdmi_con");
- if (IS_ERR_OR_NULL(cardhu_hdmi_vddio)) {
- pr_err("hdmi: couldn't get regulator vdd_hdmi_con\n");
- cardhu_hdmi_vddio = NULL;
- regulator_put(cardhu_hdmi_pll);
- cardhu_hdmi_pll = NULL;
- regulator_put(cardhu_hdmi_reg);
- cardhu_hdmi_reg = NULL;
-
- return PTR_ERR(cardhu_hdmi_vddio);
- }
- }
- ret = regulator_enable(cardhu_hdmi_vddio);
- if (ret < 0) {
- pr_err("hdmi: couldn't enable regulator vdd_hdmi_con\n");
- return ret;
- }
return 0;
}
@@ -307,9 +321,6 @@ static int cardhu_hdmi_disable(void)
regulator_put(cardhu_hdmi_pll);
cardhu_hdmi_pll = NULL;
- regulator_disable(cardhu_hdmi_vddio);
- regulator_put(cardhu_hdmi_vddio);
- cardhu_hdmi_vddio = NULL;
return 0;
}
static struct resource cardhu_disp1_resources[] = {
@@ -453,6 +464,9 @@ static struct tegra_dc_out cardhu_disp2_out = {
.enable = cardhu_hdmi_enable,
.disable = cardhu_hdmi_disable,
+
+ .postsuspend = cardhu_hdmi_vddio_disable,
+ .hotplug_init = cardhu_hdmi_vddio_enable,
};
static struct tegra_dc_platform_data cardhu_disp2_pdata = {
@@ -756,14 +770,16 @@ struct early_suspend cardhu_panel_early_suspender;
static void cardhu_panel_early_suspend(struct early_suspend *h)
{
- if (num_registered_fb > 0)
- fb_blank(registered_fb[0], FB_BLANK_POWERDOWN);
+ unsigned i;
+ for (i = 0; i < num_registered_fb; i++)
+ fb_blank(registered_fb[i], FB_BLANK_POWERDOWN);
}
static void cardhu_panel_late_resume(struct early_suspend *h)
{
- if (num_registered_fb > 0)
- fb_blank(registered_fb[0], FB_BLANK_UNBLANK);
+ unsigned i;
+ for (i = 0; i < num_registered_fb; i++)
+ fb_blank(registered_fb[i], FB_BLANK_UNBLANK);
}
#endif