diff options
author | mohit singh <mpsingh@nvidia.com> | 2011-05-30 16:39:42 +0530 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-06-01 11:46:44 -0700 |
commit | a2702eb970b4e623a29fdc3585670531cfae0a47 (patch) | |
tree | deeba670554190a20750faace55c94ec97f35071 | |
parent | 0b3b701c73330acb569ee1d3e6ae8ee1fb092e50 (diff) |
arm: tegra: hdmi: changes for enabling 5v supply.
- merged changes from board-cardhu-panel.c to board-enterprise-panel.c
- also changed the 5v string name.
- bug 830124.
Change-Id: I6d0058611062fda5afbceb2e0082906cdb3ad422
Reviewed-on: http://git-master/r/34470
Tested-by: Mohit Singh <mpsingh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-panel.c | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c index 53a737d1291c..9424852ae4ad 100644 --- a/arch/arm/mach-tegra/board-enterprise-panel.c +++ b/arch/arm/mach-tegra/board-enterprise-panel.c @@ -123,6 +123,37 @@ static struct platform_device enterprise_backlight_device = { .platform_data = &enterprise_backlight_data, }, }; +static int enterprise_hdmi_vddio_enable(void) +{ + int ret; + if (!enterprise_hdmi_vddio) { + enterprise_hdmi_vddio = regulator_get(NULL, "hdmi_5v0"); + if (IS_ERR_OR_NULL(enterprise_hdmi_vddio)) { + ret = PTR_ERR(enterprise_hdmi_vddio); + pr_err("hdmi: couldn't get regulator hdmi_5v0\n"); + enterprise_hdmi_vddio = NULL; + return ret; + } + } + ret = regulator_enable(enterprise_hdmi_vddio); + if (ret < 0) { + pr_err("hdmi: couldn't enable regulator hdmi_5v0\n"); + regulator_put(enterprise_hdmi_vddio); + enterprise_hdmi_vddio = NULL; + return ret; + } + return ret; +} + +static int enterprise_hdmi_vddio_disable(void) +{ + if (enterprise_hdmi_vddio) { + regulator_disable(enterprise_hdmi_vddio); + regulator_put(enterprise_hdmi_vddio); + enterprise_hdmi_vddio = NULL; + } + return 0; +} static int enterprise_hdmi_enable(void) { @@ -155,24 +186,6 @@ static int enterprise_hdmi_enable(void) pr_err("hdmi: couldn't enable regulator avdd_hdmi_pll\n"); return ret; } - if (!enterprise_hdmi_vddio) { - enterprise_hdmi_vddio = regulator_get(NULL, "vdd_hdmi_con"); - if (IS_ERR_OR_NULL(enterprise_hdmi_vddio)) { - pr_err("hdmi: couldn't get regulator vdd_hdmi_con\n"); - enterprise_hdmi_vddio = NULL; - regulator_put(enterprise_hdmi_pll); - enterprise_hdmi_pll = NULL; - regulator_put(enterprise_hdmi_reg); - enterprise_hdmi_reg = NULL; - - return PTR_ERR(enterprise_hdmi_vddio); - } - } - ret = regulator_enable(enterprise_hdmi_vddio); - if (ret < 0) { - pr_err("hdmi: couldn't enable regulator vdd_hdmi_con\n"); - return ret; - } return 0; } @@ -187,9 +200,6 @@ static int enterprise_hdmi_disable(void) regulator_put(enterprise_hdmi_pll); enterprise_hdmi_pll = NULL; - regulator_disable(enterprise_hdmi_vddio); - regulator_put(enterprise_hdmi_vddio); - enterprise_hdmi_vddio = NULL; return 0; } static struct resource enterprise_disp1_resources[] = { @@ -300,6 +310,8 @@ static struct tegra_dc_out enterprise_disp2_out = { .enable = enterprise_hdmi_enable, .disable = enterprise_hdmi_disable, + .postsuspend = enterprise_hdmi_vddio_disable, + .hotplug_init = enterprise_hdmi_vddio_enable, }; static struct tegra_dc_platform_data enterprise_disp2_pdata = { |