diff options
author | Jon Mayo <jmayo@nvidia.com> | 2011-04-12 18:14:22 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:45:47 -0800 |
commit | 0d6badd13e205f7a5a3df85f8991efabc82076ec (patch) | |
tree | ae97ec772c2348719a350ca19ab06bb19265fdd7 /arch/arm/mach-tegra/board-cardhu-panel.c | |
parent | da4e6da71a717f0c7506295e8f0d4788276ad983 (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>
Original-Change-Id: I6d98bdd58c90e02085d13bf29f2046baf144722e
Rebase-Id: R437d456adfe1d45272cd6b3cc5dd6da0d8488156
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-panel.c')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-panel.c | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c index 3a99f4a73e28..966675830b61 100644 --- a/arch/arm/mach-tegra/board-cardhu-panel.c +++ b/arch/arm/mach-tegra/board-cardhu-panel.c @@ -243,6 +243,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; @@ -274,24 +306,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; } @@ -306,9 +320,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[] = { @@ -452,6 +463,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 = { |